SOAP, SRW codecs and HTTP transport for YAZ using libxml2.
[yaz-moved-to-github.git] / z39.50 / z3950v3.asn
1 Z39-50-APDU-1995 -- OID for this definition, assigned in OID.3.1, is {Z39-50 2 1} 
2 DEFINITIONS ::=  
3 BEGIN   -- Z39.50 Maintenance Agency Official Text for ANSI/NISO Z39.50-1995 - July 1995
4 --
5 EXPORTS OtherInformation, Term, AttributeSetId, AttributeList, AttributeElement, ElementSetName, SortElement, DatabaseName,
6 CompSpec, Specification, Permissions, InternationalString, IntUnit, Unit, StringOrNumeric, Query, Records, ResultSetId,
7 DefaultDiagFormat, DiagRec;
8 --
9
10 PDU ::= CHOICE{
11  initRequest        [20] IMPLICIT InitializeRequest,
12  initResponse      [21] IMPLICIT InitializeResponse,
13  searchRequest      [22] IMPLICIT SearchRequest,
14  searchResponse      [23] IMPLICIT SearchResponse,
15  presentRequest      [24] IMPLICIT PresentRequest,
16  presentResponse      [25] IMPLICIT PresentResponse,
17  deleteResultSetRequest    [26] IMPLICIT DeleteResultSetRequest,
18  deleteResultSetResponse    [27] IMPLICIT DeleteResultSetResponse,
19  accessControlRequest    [28] IMPLICIT AccessControlRequest,
20  accessControlResponse    [29] IMPLICIT AccessControlResponse,
21  resourceControlRequest         [30] IMPLICIT ResourceControlRequest,
22  resourceControlResponse    [31] IMPLICIT ResourceControlResponse,
23  triggerResourceControlRequest  [32] IMPLICIT TriggerResourceControlRequest,
24  resourceReportRequest          [33] IMPLICIT ResourceReportRequest,
25  resourceReportResponse    [34] IMPLICIT ResourceReportResponse,
26  scanRequest         [35] IMPLICIT ScanRequest,
27  scanResponse      [36] IMPLICIT ScanResponse,
28               -- [37] through [42] reserved
29  sortRequest        [43] IMPLICIT SortRequest,
30  sortResponse      [44] IMPLICIT SortResponse,
31  segmentRequest      [45] IMPLICIT Segment,
32  extendedServicesRequest    [46] IMPLICIT ExtendedServicesRequest,
33  extendedServicesResponse    [47] IMPLICIT ExtendedServicesResponse,
34  close          [48] IMPLICIT Close,
35  duplicateDetectionRequest      [49] IMPLICIT DuplicateDetectionRequest,
36  duplicateDetectionResponse     [50] IMPLICIT DuplicateDetectionResponse}
37
38
39 -- Initialize APDUs
40 --
41   InitializeRequest ::= SEQUENCE{
42   referenceId        ReferenceId OPTIONAL,
43   protocolVersion      ProtocolVersion,
44   options        Options,
45   preferredMessageSize  [5]  IMPLICIT INTEGER,
46    exceptionalRecordSize  [6]  IMPLICIT INTEGER,
47    idAuthentication    [7]    IdAuthentication OPTIONAL, -- see note below
48   implementationId    [110]  IMPLICIT InternationalString OPTIONAL,
49   implementationName  [111]  IMPLICIT InternationalString OPTIONAL,
50    implementationVersion  [112]  IMPLICIT InternationalString OPTIONAL,   
51   userInformationField  [11]  EXTERNAL OPTIONAL,
52   otherInfo        OtherInformation OPTIONAL}
53 --Note:
54 -- For idAuthentication, the type ANY is retained for compatibility with earlier versions. 
55 -- For interoperability, the following is recommended:
56 IdAuthentication ::=
57    CHOICE{
58       open   VisibleString,
59       idPass  SEQUENCE {
60       groupId  [0]  IMPLICIT InternationalString OPTIONAL,
61       userId   [1]  IMPLICIT InternationalString OPTIONAL,
62       password  [2]  IMPLICIT InternationalString OPTIONAL },
63       anonymous  NULL,
64       other    EXTERNAL
65    }
66 -- May use access control formats for 'other'.  See Appendix 7 ACC.
67 --
68   InitializeResponse ::= SEQUENCE{
69   referenceId        ReferenceId OPTIONAL,
70    protocolVersion                ProtocolVersion,
71   options              Options,
72   preferredMessageSize  [5]  IMPLICIT INTEGER,
73    exceptionalRecordSize  [6]  IMPLICIT INTEGER,
74   result        [12]  IMPLICIT BOOLEAN,    -- reject = FALSE; Accept = TRUE
75   implementationId    [110]  IMPLICIT InternationalString OPTIONAL,
76   implementationName  [111]  IMPLICIT InternationalString OPTIONAL,
77    implementationVersion  [112]  IMPLICIT InternationalString OPTIONAL,   
78   userInformationField  [11]  EXTERNAL OPTIONAL,
79   otherInfo        OtherInformation OPTIONAL}
80 -- Begin auxiliary definitions for Init PDUs
81   ProtocolVersion  ::=  [3]   IMPLICIT BIT STRING{
82     version-1      (0),       -- This bit should always be set, but does not
83               -- correspond to any Z39.50 version.
84     version-2      (1),              -- "Version 2 supported."
85               -- This bit should always be set.
86     version-3      (2)        -- "Version 3 supported."
87 -- Values higher than 'version-3' should be ignored. Both the Initialize request and Initialize Response APDUs
88 -- include a value string corresponding to the supported versions. The highest common version is selected
89 -- for use. If there are no versions in common, "Result" in the Init Response should indicate "reject."
90 -- Note: Versions 1 and 2 are identical. Systems supporting version 2 should indicate support for version
91 -- 1 as well, for interoperability with systems that indicate support for version 1 only (e.g. ISO 10163-1991
92 -- implementations).  
93   }
94   Options  ::= [4] IMPLICIT BIT STRING{ 
95       search        (0), 
96       present       (1), 
97       delSet        (2),
98        resourceReport    (3),
99       triggerResourceCtrl    (4),
100       resourceCtrl       (5), 
101       accessCtrl       (6),
102       scan         (7),
103       sort        (8), 
104       -- (not used) (9),
105       extendedServices    (10),
106       level-1Segmentation    (11),
107       level-2Segmentation    (12),
108       concurrentOperations  (13),
109       namedResultSets    (14),
110       encapsulation    (15),
111       resultCount    (16),
112       negotiationModel (17),
113       duplicateDetection (18),
114       queryType104 (19),
115       pQESCorrection (20),
116       stringSchema (21)
117 }
118 -- end auxiliary definitions for Init PDUs
119
120
121 --Search APDUs
122   SearchRequest ::= SEQUENCE{
123   referenceId          ReferenceId OPTIONAL,
124       smallSetUpperBound    [13]  IMPLICIT INTEGER,
125   largeSetLowerBound    [14]  IMPLICIT INTEGER,
126   mediumSetPresentNumber    [15]  IMPLICIT INTEGER,
127   replaceIndicator      [16]  IMPLICIT BOOLEAN,
128   resultSetName      [17]  IMPLICIT InternationalString,
129    databaseNames      [18]   IMPLICIT SEQUENCE OF DatabaseName,
130    smallSetElementSetNames    [100]  ElementSetNames OPTIONAL,
131     mediumSetElementSetNames  [101]  ElementSetNames OPTIONAL,
132   preferredRecordSyntax    [104]  IMPLICIT OBJECT IDENTIFIER OPTIONAL,
133   query          [21]  Query,
134     -- Following two parameters may be used only if version 3 is in force.
135    additionalSearchInfo    [203]  IMPLICIT OtherInformation OPTIONAL,
136   otherInfo          OtherInformation OPTIONAL}
137
138
139 -- Query Definitions
140   Query  ::=  CHOICE{
141       type-0  [0]  ANY,  
142         type-1    [1]  IMPLICIT RPNQuery,
143         type-2      [2]  OCTET STRING,
144         type-100  [100]  OCTET STRING,
145         type-101  [101]  IMPLICIT RPNQuery,
146        type-102  [102]  OCTET STRING,
147        type-104  [104]  IMPLICIT EXTERNAL
148 }
149 --
150 -- Definitions for RPN query
151      RPNQuery ::= SEQUENCE{
152       attributeSet    AttributeSetId,
153       rpn      RPNStructure}
154 --
155   RPNStructure ::= CHOICE{
156     op    [0] Operand, 
157      rpnRpnOp  [1] IMPLICIT SEQUENCE{
158           rpn1    RPNStructure,
159                 rpn2    RPNStructure,
160                 op    Operator }} 
161   Operand ::= CHOICE{
162     attrTerm  AttributesPlusTerm, 
163     resultSet  ResultSetId, 
164           -- If version 2 is in force: 
165           --   - If query type is 1, one of the above two must be chosen; 
166           --   - resultAttr (below) may be used only if query type is 101. 
167     resultAttr  ResultSetPlusAttributes}
168
169   AttributesPlusTerm ::= [102] IMPLICIT SEQUENCE{
170          attributes  AttributeList, 
171         term    Term}
172   ResultSetPlusAttributes ::= [214] IMPLICIT SEQUENCE{
173         resultSet  ResultSetId,
174         attributes  AttributeList}
175   AttributeList ::=    [44]  IMPLICIT SEQUENCE OF AttributeElement
176 --
177   Term ::= CHOICE{
178     general      [45]  IMPLICIT OCTET STRING,
179               -- values below may be used only if version 3 is in force
180     numeric      [215]  IMPLICIT INTEGER,
181     characterString    [216]  IMPLICIT InternationalString,
182     oid        [217]  IMPLICIT OBJECT IDENTIFIER,
183     dateTime      [218]  IMPLICIT GeneralizedTime,
184     external      [219]  IMPLICIT EXTERNAL,
185     integerAndUnit    [220] IMPLICIT IntUnit,
186     null        [221] IMPLICIT NULL}   
187
188   Operator ::= [46] CHOICE{
189          and    [0] IMPLICIT NULL,
190             or    [1] IMPLICIT NULL,
191                 and-not  [2] IMPLICIT NULL,
192               -- If version 2 is in force: 
193               --  - For query type 1, one of the above three must be chosen;
194               --  - prox (below) may be used only if query type is 101. 
195         prox    [3] IMPLICIT ProximityOperator}
196   AttributeElement  ::=  SEQUENCE{
197     attributeSet    [1]    IMPLICIT AttributeSetId OPTIONAL,
198                 -- Must be omitted if version 2 is in force.
199                 -- If included, overrides value of attributeSet
200                 -- in RPNQuery above, but only for this attribute.
201     attributeType  [120]  IMPLICIT INTEGER,
202     attributeValue    CHOICE{
203               numeric  [121]   IMPLICIT INTEGER,
204                   -- If version 2 is in force, 
205                   -- Must select 'numeric' for attributeValue.
206
207       complex  [224] IMPLICIT SEQUENCE{ 
208                list      [1] IMPLICIT SEQUENCE OF StringOrNumeric,
209                     semanticAction  [2] IMPLICIT SEQUENCE OF INTEGER OPTIONAL}}}
210                        
211
212   ProximityOperator ::= SEQUENCE{
213     exclusion      [1] IMPLICIT BOOLEAN OPTIONAL,
214     distance      [2] IMPLICIT INTEGER,
215     ordered      [3] IMPLICIT BOOLEAN,
216     relationType      [4] IMPLICIT INTEGER{
217               lessThan      (1),
218               lessThanOrEqual    (2),
219               equal        (3),
220               greaterThanOrEqual    (4),
221               greaterThan      (5),
222               notEqual      (6)},
223     proximityUnitCode    [5] CHOICE{
224               known  [1] IMPLICIT KnownProximityUnit,
225               private  [2] IMPLICIT INTEGER}}
226 --
227     KnownProximityUnit ::= INTEGER{
228           character  (1),
229           word     (2),
230           sentence   (3),
231           paragraph   (4),
232           section   (5),
233           chapter   (6),
234           document   (7),
235           element  (8),
236           subelement  (9),
237           elementType  (10),
238            byte    (11) -- Version 3 only
239           }
240 -- End definitions for RPN Query
241
242
243 SearchResponse ::= SEQUENCE{
244   referenceId        ReferenceId OPTIONAL,
245   resultCount       [23]  IMPLICIT INTEGER,
246   numberOfRecordsReturned  [24]  IMPLICIT INTEGER,
247   nextResultSetPosition  [25]  IMPLICIT INTEGER,
248   searchStatus      [22]  IMPLICIT BOOLEAN,
249   resultSetStatus    [26]  IMPLICIT INTEGER{
250               subset    (1),
251                  interim  (2), 
252                none    (3)} OPTIONAL,
253   presentStatus        PresentStatus  OPTIONAL,
254     records        Records OPTIONAL,
255     -- Following two parameters may be used only if version 3 is in force.
256   additionalSearchInfo  [203]  IMPLICIT OtherInformation OPTIONAL,
257   otherInfo        OtherInformation OPTIONAL}
258 --Retrieval APDUs 
259   PresentRequest ::= SEQUENCE{
260   referenceId          ReferenceId OPTIONAL,
261       resultSetId          ResultSetId,
262   resultSetStartPoint      [30]  IMPLICIT INTEGER,
263   numberOfRecordsRequested  [29]  IMPLICIT INTEGER,
264   additionalRanges      [212]  IMPLICIT SEQUENCE OF Range OPTIONAL,
265       -- additionalRanges may be included only if version 3 is in force.
266   recordComposition      CHOICE{
267                 simple  [19]         ElementSetNames,
268                 -- must choose 'simple' if version 2 is in force
269                 complex  [209]               IMPLICIT CompSpec} OPTIONAL,
270   preferredRecordSyntax    [104]  IMPLICIT OBJECT IDENTIFIER OPTIONAL,
271   maxSegmentCount      [204]  IMPLICIT INTEGER OPTIONAL, -- level 1 or 2
272   maxRecordSize      [206]  IMPLICIT INTEGER OPTIONAL, -- level 2 only
273   maxSegmentSize      [207]  IMPLICIT INTEGER OPTIONAL, -- level 2 only
274   otherInfo          OtherInformation OPTIONAL}
275 --
276   Segment ::= SEQUENCE{
277       -- Segment PDU may only be used when version 3 is in force, 
278       -- and only when segmentation is in effect.
279    referenceId          ReferenceId OPTIONAL,
280      numberOfRecordsReturned    [24]  IMPLICIT INTEGER,
281   segmentRecords      [0]  IMPLICIT SEQUENCE OF NamePlusRecord,
282   otherInfo          OtherInformation OPTIONAL}
283 --
284   PresentResponse ::= SEQUENCE{
285   referenceId          ReferenceId OPTIONAL,
286   numberOfRecordsReturned    [24]  IMPLICIT INTEGER,
287    nextResultSetPosition    [25]  IMPLICIT INTEGER,
288     presentStatus          PresentStatus,
289   records          Records OPTIONAL,
290   otherInfo          OtherInformation OPTIONAL} 
291 -- begin auxiliary definitions for Search and Present APDUs
292
293 -- begin definition of records
294   Records ::= CHOICE{
295   responseRecords      [28]  IMPLICIT SEQUENCE OF NamePlusRecord,
296   nonSurrogateDiagnostic     [130]  IMPLICIT DefaultDiagFormat,
297   multipleNonSurDiagnostics   [205]  IMPLICIT SEQUENCE OF DiagRec} 
298 --
299   NamePlusRecord  ::=  SEQUENCE{
300   name    [0] IMPLICIT DatabaseName OPTIONAL,
301   record  [1] CHOICE{
302         retrievalRecord        [1] EXTERNAL,
303         surrogateDiagnostic    [2] DiagRec, 
304           -- Must select one of the above two, retrievalRecord or
305           -- surrogateDiagnostic, unless 'level 2 segmentation' is in effect.
306         startingFragment    [3] FragmentSyntax,
307         intermediateFragment  [4] FragmentSyntax,
308         finalFragment    [5] FragmentSyntax}}
309   FragmentSyntax ::= CHOICE{
310     externallyTagged    EXTERNAL,
311     notExternallyTagged  OCTET STRING}
312
313   DiagRec ::= CHOICE{
314       defaultFormat    DefaultDiagFormat,
315                 -- Must choose defaultFormat if version 2 is in effect.
316       externallyDefined    EXTERNAL}
317
318   DefaultDiagFormat::= SEQUENCE{ 
319   diagnosticSetId  OBJECT IDENTIFIER,
320   condition    INTEGER,
321   addinfo      CHOICE{
322            v2Addinfo  VisibleString,  -- version 2
323            v3Addinfo  InternationalString  -- version 3
324             }}
325   -- end definition of records
326   Range  ::= SEQUENCE{
327     startingPosition    [1] IMPLICIT INTEGER,
328     numberOfRecords    [2] IMPLICIT INTEGER} 
329 --
330   ElementSetNames ::= CHOICE {
331     genericElementSetName  [0] IMPLICIT InternationalString,
332     databaseSpecific    [1] IMPLICIT SEQUENCE OF SEQUENCE{
333               dbName  DatabaseName,
334               esn    ElementSetName}}
335
336   PresentStatus   ::=    [27]  IMPLICIT INTEGER{
337                             success  (0),
338                              partial-1   (1),
339                               partial-2   (2),
340               partial-3   (3),
341                                       partial-4   (4),
342                                failure    (5)}
343
344 -- begin definition of composition specification
345   CompSpec ::= SEQUENCE{
346   selectAlternativeSyntax  [1] IMPLICIT BOOLEAN,
347             -- See comment for recordSyntax, below.
348   generic             [2] IMPLICIT Specification OPTIONAL,
349   dbSpecific      [3] IMPLICIT SEQUENCE OF SEQUENCE{
350                 db  [1] DatabaseName,
351                 spec  [2] IMPLICIT Specification} OPTIONAL,
352     -- At least one of generic and dbSpecific must occur, and both may occur. If both, then for
353      -- any record not in the list of databases within dbSpecific, generic applies.
354    recordSyntax               [4] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL
355                -- For each record, the target selects the first record syntax
356                -- in this list that it can support.  If the list is exhausted, the
357                -- target may select an alternative syntax if
358                -- selectAlternativeSyntax is 'true'.
359         }
360   Specification ::= SEQUENCE{
361   schema CHOICE {
362               oid [1]   IMPLICIT OBJECT IDENTIFIER,
363               uri [300] IMPLICIT InternationalString
364   } OPTIONAL,
365   elementSpec    [2] CHOICE{
366               elementSetName   [1] IMPLICIT InternationalString,
367           externalEspec  [2] IMPLICIT EXTERNAL} OPTIONAL}
368 -- end definition of composition specification
369 -- end auxiliary definitions for search and response APDUs
370
371 -- Delete APDUs
372   DeleteResultSetRequest ::= SEQUENCE{
373   referenceId          ReferenceId OPTIONAL,
374       deleteFunction      [32]  IMPLICIT INTEGER{
375                     list   (0),
376                     all   (1)},
377    resultSetList          SEQUENCE OF ResultSetId OPTIONAL,
378   otherInfo          OtherInformation OPTIONAL} 
379 --
380   DeleteResultSetResponse ::= SEQUENCE{
381   referenceId          ReferenceId OPTIONAL,
382     deleteOperationStatus    [0]  IMPLICIT DeleteSetStatus,
383   deleteListStatuses      [1]  IMPLICIT ListStatuses OPTIONAL,
384   numberNotDeleted       [34]  IMPLICIT INTEGER OPTIONAL,
385      bulkStatuses        [35]   IMPLICIT ListStatuses OPTIONAL,
386    deleteMessage      [36]  IMPLICIT InternationalString OPTIONAL,
387   otherInfo          OtherInformation OPTIONAL}
388   ListStatuses ::= SEQUENCE OF SEQUENCE{ 
389         id  ResultSetId, 
390         status  DeleteSetStatus}
391
392   DeleteSetStatus ::= [33] IMPLICIT INTEGER{
393                   success          (0),
394                    resultSetDidNotExist      (1),
395                     previouslyDeletedByTarget      (2),
396                      systemProblemAtTarget      (3),
397                    accessNotAllowed        (4),
398       resourceControlAtOrigin      (5),
399                    resourceControlAtTarget      (6),
400                     bulkDeleteNotSupported      (7),
401                    notAllRsltSetsDeletedOnBulkDlte    (8),
402       notAllRequestedResultSetsDeleted    (9),
403       resultSetInUse        (10)}
404 --
405
406 --Access- and Resource-control APDUs
407 --
408   AccessControlRequest ::= SEQUENCE{
409   referenceId        ReferenceId OPTIONAL,
410   securityChallenge      CHOICE{
411               simpleForm      [37] IMPLICIT OCTET STRING,
412                externallyDefined    [0]  EXTERNAL},
413   otherInfo        OtherInformation OPTIONAL}
414
415   AccessControlResponse ::= SEQUENCE{
416   referenceId        ReferenceId OPTIONAL,
417   securityChallengeResponse  CHOICE{
418               simpleForm      [38]   IMPLICIT OCTET STRING,
419                externallyDefined    [0]  EXTERNAL} OPTIONAL,
420               -- Optional only in version 3; mandatory in version 2. If
421               -- omitted (in version 3) then diagnostic must occur.
422   diagnostic    [223]    DiagRec OPTIONAL, -- Version 3 only.
423   otherInfo        OtherInformation OPTIONAL}
424
425
426
427   ResourceControlRequest ::= SEQUENCE{
428   referenceId          ReferenceId OPTIONAL,
429   suspendedFlag      [39]  IMPLICIT BOOLEAN OPTIONAL,
430   resourceReport      [40]  ResourceReport OPTIONAL,
431   partialResultsAvailable    [41]  IMPLICIT INTEGER{
432                 subset    (1),
433                 interim  (2),
434                 none    (3)} OPTIONAL,
435   responseRequired      [42]   IMPLICIT BOOLEAN, 
436   triggeredRequestFlag    [43]   IMPLICIT BOOLEAN OPTIONAL,
437   otherInfo          OtherInformation OPTIONAL}
438
439
440   ResourceControlResponse ::= SEQUENCE{
441      referenceId          ReferenceId OPTIONAL,
442     continueFlag       [44]   IMPLICIT BOOLEAN, 
443   resultSetWanted      [45]  IMPLICIT BOOLEAN OPTIONAL,
444   otherInfo          OtherInformation OPTIONAL}
445
446
447
448   TriggerResourceControlRequest ::= SEQUENCE{
449      referenceId          ReferenceId OPTIONAL,
450   requestedAction      [46]  IMPLICIT INTEGER{
451                 resourceReport  (1),
452                 resourceControl  (2),
453                 cancel      (3)}, 
454   prefResourceReportFormat    [47]   IMPLICIT ResourceReportId OPTIONAL,
455   resultSetWanted      [48]   IMPLICIT BOOLEAN OPTIONAL,
456   otherInfo          OtherInformation OPTIONAL}
457
458
459
460   ResourceReportRequest ::= SEQUENCE{
461      referenceId          ReferenceId OPTIONAL,
462   opId          [210]  IMPLICIT ReferenceId OPTIONAL,
463   prefResourceReportFormat    [49]   IMPLICIT ResourceReportId OPTIONAL,
464   otherInfo          OtherInformation OPTIONAL}
465 --
466   ResourceReportResponse ::= SEQUENCE{
467      referenceId          ReferenceId OPTIONAL,
468   resourceReportStatus    [50]   IMPLICIT INTEGER{
469                 success    (0),
470                 partial    (1),
471                 failure-1    (2),
472                 failure-2    (3),
473                 failure-3    (4),
474                 failure-4    (5),
475                 failure-5    (6),
476                 failure-6    (7)},
477   resourceReport               [51]   ResourceReport OPTIONAL,
478   otherInfo          OtherInformation OPTIONAL}
479 --
480    ResourceReport     ::=   EXTERNAL
481   ResourceReportId    ::=    OBJECT IDENTIFIER
482
483 --Scan APDUs
484   ScanRequest ::= SEQUENCE{
485   referenceId              ReferenceId OPTIONAL,
486     databaseNames        [3]  IMPLICIT SEQUENCE OF DatabaseName,
487     attributeSet            AttributeSetId OPTIONAL,
488     termListAndStartPoint        AttributesPlusTerm,
489     stepSize           [5]   IMPLICIT INTEGER OPTIONAL,
490     numberOfTermsRequested         [6]   IMPLICIT INTEGER,
491     preferredPositionInResponse      [7]   IMPLICIT INTEGER OPTIONAL,
492     otherInfo            OtherInformation OPTIONAL}
493
494   ScanResponse ::= SEQUENCE{
495    referenceId              ReferenceId OPTIONAL,
496    stepSize           [3]  IMPLICIT INTEGER OPTIONAL,
497    scanStatus           [4]  IMPLICIT INTEGER {
498                                 success   (0),
499                                 partial-1   (1),
500                                 partial-2   (2),
501                                 partial-3   (3),
502                                 partial-4   (4),
503                                 partial-5   (5),
504                                 failure  (6) },
505    numberOfEntriesReturned       [5]  IMPLICIT INTEGER,
506    positionOfTerm         [6]  IMPLICIT INTEGER OPTIONAL,
507    entries           [7]  IMPLICIT ListEntries  OPTIONAL,  
508    attributeSet          [8]  IMPLICIT AttributeSetId OPTIONAL,
509    otherInfo            OtherInformation OPTIONAL}
510
511 -- begin auxiliary definitions for Scan
512   ListEntries ::= SEQUENCE{
513   entries        [1]   IMPLICIT SEQUENCE OF Entry OPTIONAL,
514     nonsurrogateDiagnostics    [2]  IMPLICIT SEQUENCE OF DiagRec OPTIONAL
515     -- At least one of entries and nonsurrogateDiagnostics must occur
516           }
517
518   Entry  ::= CHOICE {
519      termInfo               [1]   IMPLICIT TermInfo,
520      surrogateDiagnostic    [2]   DiagRec}
521 --
522   TermInfo ::= SEQUENCE {
523    term                    Term,
524      displayTerm      [0]   IMPLICIT InternationalString OPTIONAL,
525                                      -- Presence of displayTerm means that term is not considered by
526               -- the target to be suitable for display, and displayTerm should
527               -- instead be displayed. 'term' is the actual term in the term list;
528                -- 'displayTerm' is for display purposes only, and is not an actual
529               -- term in the term list.
530   suggestedAttributes            AttributeList OPTIONAL,
531      alternativeTerm    [4]  IMPLICIT SEQUENCE OF AttributesPlusTerm OPTIONAL, 
532      globalOccurrences    [2]  IMPLICIT INTEGER OPTIONAL,
533      byAttributes      [3]  IMPLICIT OccurrenceByAttributes OPTIONAL,
534      otherTermInfo      OtherInformation OPTIONAL} 
535
536   OccurrenceByAttributes ::= SEQUENCE OF SEQUENCE{
537      attributes    [1]  AttributeList, 
538      occurrences       CHOICE{
539                global    [2] INTEGER,
540             byDatabase  [3] IMPLICIT SEQUENCE OF SEQUENCE{ 
541               db      DatabaseName,
542               num     [1]  IMPLICIT INTEGER OPTIONAL,
543               otherDbInfo    OtherInformation OPTIONAL}} OPTIONAL,
544      otherOccurInfo    OtherInformation OPTIONAL} 
545 -- end auxiliary definitions for Scan
546
547 -- Sort APDUs
548 SortRequest  ::= SEQUENCE{
549   referenceId              ReferenceId OPTIONAL,
550   inputResultSetNames  [3]  IMPLICIT SEQUENCE OF InternationalString,
551   sortedResultSetName  [4]    IMPLICIT InternationalString,
552   sortSequence     [5]  IMPLICIT SEQUENCE OF SortKeySpec,
553               -- order of occurrence is from major to minor
554   otherInfo        OtherInformation OPTIONAL}
555
556 SortResponse  ::= SEQUENCE{
557   referenceId          ReferenceId OPTIONAL,
558   sortStatus         [3]  IMPLICIT INTEGER{
559                             success  (0), 
560               partial-1  (1),
561               failure  (2)},
562   resultSetStatus    [4]  IMPLICIT INTEGER{
563               empty    (1), 
564                   interim  (2), 
565                   unchanged  (3),
566               none    (4)} OPTIONAL,
567   diagnostics        [5]             IMPLICIT SEQUENCE OF DiagRec OPTIONAL,
568   otherInfo        OtherInformation OPTIONAL}
569
570 -- begin auxiliary definitions for Sort
571   SortKeySpec ::= SEQUENCE{
572     sortElement      SortElement, 
573        sortRelation    [1]  IMPLICIT INTEGER{
574                                 ascending      (0),
575               descending      (1),
576               ascendingByFrequency    (3),
577               descendingByfrequency  (4)},
578       caseSensitivity    [2]   IMPLICIT INTEGER{
579                                  caseSensitive      (0), 
580               caseInsensitive    (1)},
581       missingValueAction    [3]   CHOICE{
582                                      abort    [1] IMPLICIT NULL,
583                                      null      [2] IMPLICIT NULL,
584                     --supply a null value for missing value
585           missingValueData  [3] IMPLICIT OCTET STRING} OPTIONAL}
586
587   SortElement ::=   CHOICE{
588     generic        [1] SortKey,
589        datbaseSpecific    [2] IMPLICIT SEQUENCE OF SEQUENCE{
590                        databaseName  DatabaseName,
591                        dbSort    SortKey}} 
592
593   SortKey ::= CHOICE{
594     sortfield       [0]  IMPLICIT InternationalString,
595                   -- An element, element-group-tag, or alias supported by the target
596                -- and denoting a set of elements associated with each record.
597      elementSpec    [1]  IMPLICIT Specification,
598         sortAttributes    [2]  IMPLICIT SEQUENCE{
599               id  AttributeSetId,
600               list  AttributeList}}
601 -- end auxiliary definitions for sort
602
603
604
605 -- Extended Service APDUs
606   ExtendedServicesRequest  ::= SEQUENCE{
607   referenceId              ReferenceId OPTIONAL,
608   function      [3]  IMPLICIT INTEGER {
609               create    (1),
610               delete    (2),
611               modify  (3)},
612   packageType      [4]  IMPLICIT OBJECT IDENTIFIER,
613   packageName    [5]  IMPLICIT InternationalString OPTIONAL,
614               -- PackageName mandatory for 'modify' or 'delete'; optional for
615               -- 'create'. Following four parameters mandatory for 'create'; should
616               -- be included on 'modify' if being modified; not needed on 'delete'.
617   userId        [6]   IMPLICIT InternationalString OPTIONAL,
618   retentionTime    [7]   IMPLICIT IntUnit OPTIONAL,
619   permissions      [8]   IMPLICIT Permissions OPTIONAL,
620   description      [9]   IMPLICIT InternationalString OPTIONAL,
621
622 -- (ExtendedServiceRequest APDU continued)
623   taskSpecificParameters  [10]  IMPLICIT EXTERNAL OPTIONAL, 
624               -- Mandatory for 'create'; included on 'modify' if specific
625               -- parameters being modified; not necessary on 'delete'. For the
626               -- 'EXTERNAL,' use OID of specific ES definition and select
627               --  CHOICE [1]: 'esRequest'.
628   waitAction      [11]  IMPLICIT INTEGER{
629               wait      (1),
630               waitIfPossible  (2),
631               dontWait    (3),
632               dontReturnPackage  (4)},
633   elements          ElementSetName OPTIONAL,
634   otherInfo          OtherInformation OPTIONAL}
635 --
636
637 ExtendedServicesResponse ::= SEQUENCE{
638   referenceId                ReferenceId OPTIONAL,
639   operationStatus    [3]    IMPLICIT INTEGER{
640                 done      (1),
641                 accepted    (2),  
642                 failure    (3)},
643   diagnostics      [4]    IMPLICIT SEQUENCE OF DiagRec OPTIONAL,
644   taskPackage      [5]    IMPLICIT EXTERNAL OPTIONAL,
645                 -- Use OID: {Z39-50-recordSyntax (106)} and corresponding
646                 -- syntax. For the EXTERNAL, 'taskSpecific,' within that
647                 -- definition, use OID of the specific es, and choose [2],
648                 -- 'taskPackage'.
649   otherInfo          OtherInformation OPTIONAL}
650
651  Permissions ::= SEQUENCE OF SEQUENCE{
652   userId      [1] IMPLICIT InternationalString,
653   allowableFunctions  [2] IMPLICIT SEQUENCE OF INTEGER{
654               delete      (1),
655               modifyContents  (2),
656               modifyPermissions  (3),
657               present    (4),
658                  invoke    (5)}} 
659
660 Close ::= SEQUENCE{
661   referenceId          ReferenceId OPTIONAL,  -- See 3.2.11.1.5.
662   closeReason          CloseReason,
663   diagnosticInformation    [3]  IMPLICIT InternationalString OPTIONAL,
664   resourceReportFormat    [4]  IMPLICIT ResourceReportId OPTIONAL, 
665                 -- For use by origin only, and only on Close request;
666                 -- origin requests target to include report in response.
667    resourceReport      [5]  ResourceReport OPTIONAL,
668                 -- For use by target only, unilaterally on Close request;
669                 -- on Close response may be unilateral or in response
670                 -- to origin request.
671   otherInfo          OtherInformation OPTIONAL}
672
673   CloseReason ::=  [211]  IMPLICIT INTEGER{
674             finished      (0),
675             shutdown      (1),
676             systemProblem    (2),
677             costLimit      (3),
678             resources      (4),
679             securityViolation    (5),
680             protocolError    (6),
681             lackOfActivity    (7),
682             peerAbort      (8),
683             unspecified      (9)}
684
685 --Duplicate detection APDUs
686 DuplicateDetectionRequest ::= SEQUENCE {
687   referenceId                      ReferenceId  OPTIONAL,
688   inputResultSetIds            [3] IMPLICIT SEQUENCE OF InternationalString,
689   outputResultSetName          [4] IMPLICIT InternationalString,
690   applicablePortionOfRecord    [5] IMPLICIT EXTERNAL OPTIONAL,
691   duplicateDetectionCriteria   [6] IMPLICIT SEQUENCE OF
692                                    DuplicateDetectionCriterion OPTIONAL,
693   clustering                   [7] IMPLICIT BOOLEAN OPTIONAL,
694                                         -- 'true' means "clustered".
695                                         -- This parameter may be omitted
696                                         -- only if retentionCriteria CHOICE is
697                                         -- 'numberOfEntries' and its value is 1.
698   retentionCriteria            [8] IMPLICIT SEQUENCE OF
699                                             RetentionCriterion,
700   sortCriteria                 [9] IMPLICIT SEQUENCE OF
701                                             SortCriterion OPTIONAL,
702   otherInfo                        OtherInformation OPTIONAL}
703
704 DuplicateDetectionCriterion ::= CHOICE{
705                            levelOfMatch         [1] IMPLICIT INTEGER,
706                                 -- a percentage; 1-100.
707                            caseSensitive        [2] IMPLICIT NULL,
708                            punctuationSensitive [3] IMPLICIT NULL,
709                            regularExpression    [4] IMPLICIT EXTERNAL,
710                            rsDuplicates         [5] IMPLICIT NULL
711                  -- values 6-100 reserved for future assignment.
712                                                        }
713
714 RetentionCriterion ::= CHOICE{
715                           numberOfEntries       [1] IMPLICIT INTEGER, 
716                                                         --  greater than 0
717                           percentOfEntries      [2] IMPLICIT INTEGER,
718                                                         -- 1-100,
719                           duplicatesOnly        [3] IMPLICIT NULL,
720                                                  -- should not be chosen 
721                                                  -- if clustering is 'true'
722                           discardRsDuplicates   [4] IMPLICIT NULL
723                  -- values 5-100 reserved for future assignment.
724                                                        }
725
726 SortCriterion ::= CHOICE{
727                          mostComprehensive      [1] IMPLICIT NULL,
728                          leastConmprehensive    [2] IMPLICIT NULL,
729                          mostRecent             [3] IMPLICIT NULL,
730                          oldest                 [4] IMPLICIT NULL,
731                          leastCost              [5] IMPLICIT NULL,
732                          preferredDatabases     [6] IMPLICIT
733                                      SEQUENCE OF InternationalString
734                  -- values 7-100 reserved for future assignment.
735 }
736
737 DuplicateDetectionResponse ::= SEQUENCE {
738   referenceId                          ReferenceId  OPTIONAL,
739   status                       [3]     IMPLICIT INTEGER{
740                                          success               (0),
741                                          failure               (1)},
742   resultSetCount               [4]     IMPLICIT INTEGER OPTIONAL,
743   diagnostics                  [5]     IMPLICIT SEQUENCE OF DiagRec OPTIONAL,
744   otherInfo                           OtherInformation OPTIONAL}
745
746 -- Global auxiliary definitions
747   ReferenceId       ::=      [2]  IMPLICIT OCTET STRING
748   ResultSetId        ::=      [31]    IMPLICIT InternationalString
749   ElementSetName     ::=     [103]   IMPLICIT InternationalString
750   DatabaseName     ::=    [105]   IMPLICIT InternationalString
751   AttributeSetId     ::=       OBJECT IDENTIFIER
752
753
754 -- OtherInformation
755   OtherInformation   ::= [201] IMPLICIT SEQUENCE OF SEQUENCE{
756     category            [1]   IMPLICIT InfoCategory OPTIONAL, 
757     information        CHOICE{
758       characterInfo        [2]  IMPLICIT InternationalString,
759       binaryInfo        [3]  IMPLICIT OCTET STRING,
760       externallyDefinedInfo    [4]  IMPLICIT EXTERNAL,
761       oid          [5]  IMPLICIT OBJECT IDENTIFIER}}
762 --
763   InfoCategory ::= SEQUENCE{
764       categoryTypeId  [1]   IMPLICIT OBJECT IDENTIFIER OPTIONAL,
765       categoryValue  [2]   IMPLICIT INTEGER}
766
767
768 -- Units
769   -- IntUnit is used when value and unit are supplied together. Unit, alone, is used when just
770   -- specifying a unit (without a value).  For example, IntUnit is used in Term, in an RPNQuery, or
771   -- it can be the datatype of an element within a retrieval record. Unit (alone) would be used in an
772   -- element request, when requesting data be returned according to a particular unit.
773
774   IntUnit ::= SEQUENCE{
775     value    [1] IMPLICIT INTEGER,
776     unitUsed  [2] IMPLICIT Unit}
777 --
778   Unit ::= SEQUENCE{
779     unitSystem    [1] InternationalString OPTIONAL,    -- e.g. 'SI'
780     unitType    [2] StringOrNumeric OPTIONAL,    -- e.g. 'mass'
781     unit      [3] StringOrNumeric OPTIONAL,    -- e.g. 'kilograms'
782     scaleFactor    [4] IMPLICIT INTEGER OPTIONAL    -- e.g. 9 means 10**9
783         }
784
785 --CharacterString
786   InternationalString ::= GeneralString
787     -- When version 2 is in force, this collapses to VisibleString. That is, only characters in the
788     -- visibleString repertoire may be used. (Datatype compatibility with version 2 is not affected,
789      -- because references are IMPLICIT.)  When version 3 is in force, the semantics of the
790     -- GeneralString content may be altered by negotiation during initialization. If no such
791     -- negotiation is in effect, then GeneralString semantics are in force.
792
793 StringOrNumeric ::= CHOICE{
794   string    [1] IMPLICIT InternationalString,
795   numeric  [2] IMPLICIT INTEGER}
796
797 END -- IR DEFINITIONS
798
799
800
801 DiagnosticFormatDiag1 
802 {Z39-50-diagnosticFormat diag-1 (2)} DEFINITIONS ::=
803 BEGIN
804 IMPORTS Term, Specification, AttributeList, SortElement, DatabaseName, 
805 DefaultDiagFormat, InternationalString FROM Z39-50-APDU-1995;
806
807
808 DiagnosticFormat ::=  SEQUENCE OF SEQUENCE{ 
809   diagnostic  [1] CHOICE{
810               defaultDiagRec    [1]  IMPLICIT DefaultDiagFormat,
811               explicitDiagnostic    [2]  DiagFormat} OPTIONAL, 
812   message  [2] IMPLICIT InternationalString OPTIONAL} 
813
814
815 DiagFormat ::= CHOICE{
816
817 tooMany  [1000]   IMPLICIT SEQUENCE{
818                 tooManyWhat   [1]  IMPLICIT INTEGER{
819                                   argumentWords        (1), 
820                                   truncatedWords        (2), 
821                                   booleanOperators      (3),
822                                   incompleteSubfields    (4), 
823                                   characters          (5),
824                                   recordsRetrieved      (6), 
825                                   dataBasesSpecified      (7),
826                                   resultSetsCreated      (8), 
827                                   indexTermsProcessed    (9)},
828                 max        [2]  IMPLICIT INTEGER OPTIONAL},
829
830
831
832
833
834
835
836 badSpec    [1001]  IMPLICIT SEQUENCE{  -- element set name or specification
837                 spec        [1] IMPLICIT Specification, -- esn or element spec not supported
838                 db        [2] IMPLICIT DatabaseName OPTIONAL,
839                             -- if db specified, above spec not supported for db; otherwise,
840                             -- spec not supported period.
841                 goodOnes    [3] IMPLICIT SEQUENCE OF Specification OPTIONAL  
842                             -- target supplies ones that are supported
843                             },
844
845
846 dbUnavail  [1002]  IMPLICIT SEQUENCE{ -- database unavailable
847                 db  [1] IMPLICIT DatabaseName,
848                 why  [2] IMPLICIT SEQUENCE{
849                         reasonCode  [1] IMPLICIT INTEGER{
850                                       doesNotExist    (0),
851                                       existsButUnavail  (1),
852                                       locked      (2),
853                                       accessDenied    (3)} OPTIONAL,
854                         message    [2] IMPLICIT InternationalString OPTIONAL}},
855
856
857 unSupOp  [1003]  IMPLICIT INTEGER{  -- unsupported operator
858                 and     (0),
859                 or      (1),
860                 and-not  (2),
861                 prox    (3)},
862
863
864 attribute    [1004]  IMPLICIT SEQUENCE{
865                     -- Applies for unsupported attribute set, attribute type, 
866                     -- attribute value, or term (for a given attribute type or value).
867
868                 id      [1]  IMPLICIT OBJECT IDENTIFIER,
869                    -- if only "id" occurs, then attribute set is not supported
870                 type    [2]  IMPLICIT INTEGER OPTIONAL,
871                    -- must occur if value occurs.
872                 value    [3]   IMPLICIT INTEGER OPTIONAL,
873                     -- if omitted, and Type occurs, then Type is what is unsupported
874                 term    [4]  Term OPTIONAL
875                     -- If occurs, term is illegal or not supported, for attribute value,
876                     -- if value occurs; otherwise, for type.
877                                 },
878
879
880 attCombo  [1005]  IMPLICIT SEQUENCE{ -- attribute combination not supported
881               unsupportedCombination  [1] IMPLICIT AttributeList, 
882               recommendedAlternatives  [2] IMPLICIT SEQUENCE OF AttributeList OPTIONAL}, 
883
884
885
886
887 term      [1006]  IMPLICIT SEQUENCE{
888                 problem    [1] IMPLICIT INTEGER{
889                             codedValue  (1),
890                             unparsable  (2),
891                             tooShort    (3),
892                             type      (4)} OPTIONAL,
893                 term      [2] Term},
894
895
896 proximity  [1007] CHOICE{        -- proximity diagnostics:
897                resultSets  [1]    IMPLICIT NULL,         -- proximity between sets not supported
898               badSet    [2]    IMPLICIT InternationalString,  -- bad result set specified
899                  relation    [3]   IMPLICIT INTEGER,      -- 1 to 6 ; relation not supported
900               unit      [4]  IMPLICIT INTEGER,      -- unsupported unit code
901               distance    [5]  IMPLICIT INTEGER,      -- unsupported distance
902               attributes  [6]  AttributeList,             --  proximity not supported with specified
903                                                    -- attribute combination
904               ordered    [7]  IMPLICIT NULL,        -- ordered flag not supported
905               exclusion  [8]  IMPLICIT NULL          -- exclusion flag not supported
906                     },
907
908
909
910
911
912 scan     [1008] CHOICE{      -- scan diagnostics:
913               nonZeroStepSize  [0] IMPLICIT NULL,  -- only zero step size supported
914               specifiedStepSize  [1] IMPLICIT NULL,  -- specified step size not supported
915               termList1      [3] IMPLICIT NULL,  -- term list not supported (no alternative supplied)
916               termList2      [4] IMPLICIT SEQUENCE OF AttributeList,
917                                           -- term list not supported (alternatives supplied)
918               posInResponse    [5] IMPLICIT INTEGER{  --value of positionInResponse not supported
919                               mustBeOne        (1),
920                               mustBePositive    (2),
921                               mustBeNonNegative  (3),
922                               other            (4)},
923               resources      [6] IMPLICIT NULL,   -- resources exhausted looking for satisfying terms
924               endOfList      [7] IMPLICIT NULL  -- beginning or end of term list
925                 },
926
927
928 sort       [1009] CHOICE{
929               sequence    [0]  IMPLICIT NULL,        -- cannot sort according to sequence
930               noRsName    [1]  IMPLICIT NULL,        -- no result set name supplied
931               tooMany    [2]  IMPLICIT INTEGER,      --  Too many input result sets,
932                                                 --  maximum supplied.
933               incompatible  [3]  IMPLICIT NULL,        -- records with different formats
934                                                  -- not compatible for sorting
935               generic      [4]  IMPLICIT NULL,        -- generic sort not supported 
936                                                 -- (db specific only)
937               dbSpecific    [5]  IMPLICIT NULL,        -- db specific sort not supported
938               sortElement    [6]  SortElement,
939               key        [7]  IMPLICIT INTEGER{
940                               tooMany  (1),    -- too many sort keys
941                               duplicate  (2)},    -- duplicate sort keys
942               action      [8]  IMPLICIT NULL,  -- unsupported missing data action
943               illegal      [9]  IMPLICIT INTEGER{
944                               relation  (1),  -- illegal sort relation
945                               case    (2),  -- illegal case value
946                               action  (3),   -- illegal missing data action
947                               sort    (4)},  -- illegal sort
948             inputTooLarge    [10]  IMPLICIT SEQUENCE OF InternationalString,
949                                       --   one or more of the input result sets too large to sort
950           aggregateTooLarge  [11]  IMPLICIT NULL  --  aggregate result set too large
951                           },
952
953 segmentation  [1010]  CHOICE{
954                 segmentCount  [0]    IMPLICIT NULL,
955                                   -- Cannot guarantee record will fit within max segments. Target
956                                   -- suggests that origin try again to retrieve record, without
957                                   -- including max-segment-count.
958                 segmentSize  [1]    IMPLICIT INTEGER
959                                 -- record cannot be segmented into fragments such that the largest
960                                 -- will fit within max segment size specified. Target supplies (in
961                                 -- bytes) the smallest acceptable value of Max-segment-size to
962                                 -- retrieve the record.
963                           },
964
965
966 extServices  [1011] CHOICE{
967                 req        [1] IMPLICIT INTEGER{   -- bad request
968                             nameInUse    (1),  -- package name already in use
969                             noSuchName  (2),  -- no such package, on modify/delete
970                             quota        (3),  -- quota exceeded
971                             type        (4)},  -- extended service type not supported
972                 permission  [2] IMPLICIT INTEGER{ -- permission denied on ES, because: 
973                             id         (1),    --   id not authorized, or
974                             modifyDelete  (2)},    -- cannot modify or delete
975                 immediate  [3] IMPLICIT INTEGER{ -- immediate execution:
976                             failed      (1),    -- failed, 
977                             service      (2),    -- not supported for this service, or
978                             parameters    (3)    -- for these parameters.
979                                 }},
980
981
982 accessCtrl    [1012] CHOICE{
983                 noUser    [1] IMPLICIT NULL,    -- no user to display challenge to
984                 refused    [2] IMPLICIT NULL,    -- access control information refused by user
985                 simple    [3] IMPLICIT NULL,    -- only simple form supported (target used
986                                           -- externally defined)
987                 oid      [4] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER,
988                                           -- oid not supported (origin supplies alternative
989                                           -- suggested oids)
990                 alternative  [5] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER,
991                                           -- origin insists that target use an alternative
992                                           -- challenge for this data (e.g. stronger                                     
993    
994                                           -- authentication or stronger Access control). The                            
995               -- origin supplies suggested alternative oids.
996                 pwdInv    [6] IMPLICIT NULL,    -- password invalid
997                 pwdExp    [7] IMPLICIT NULL      -- password expired
998                     },
999
1000
1001 recordSyntax  [1013] IMPLICIT SEQUENCE{ -- record cannot be transferred in requested syntax
1002               unsupportedSyntax    [1] IMPLICIT OBJECT IDENTIFIER, 
1003               suggestedAlternatives  [2] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL}
1004 }
1005
1006 END
1007
1008
1009
1010
1011
1012 RecordSyntax-explain 
1013 {Z39-50-recordSyntax explain (100)} DEFINITIONS ::=
1014
1015 BEGIN 
1016 IMPORTS AttributeSetId, Term, OtherInformation, DatabaseName, ElementSetName, IntUnit, Unit,
1017  StringOrNumeric, Specification, InternationalString, AttributeList, AttributeElement FROM Z39-50-APDU-1995;
1018
1019 Explain-Record ::= CHOICE{
1020   -- Each of these may be used as search term  when Use attribute is 'explain-category'.
1021   targetInfo         [0]    IMPLICIT TargetInfo,
1022   databaseInfo      [1]    IMPLICIT DatabaseInfo,
1023   schemaInfo        [2]    IMPLICIT SchemaInfo,
1024   tagSetInfo         [3]    IMPLICIT TagSetInfo,
1025   recordSyntaxInfo    [4]    IMPLICIT RecordSyntaxInfo,
1026   attributeSetInfo    [5]    IMPLICIT AttributeSetInfo,
1027   termListInfo      [6]    IMPLICIT TermListInfo,
1028   extendedServicesInfo  [7]    IMPLICIT ExtendedServicesInfo,
1029   attributeDetails      [8]    IMPLICIT AttributeDetails,
1030   termListDetails    [9]    IMPLICIT TermListDetails,
1031   elementSetDetails    [10]  IMPLICIT ElementSetDetails,
1032   retrievalRecordDetails  [11]   IMPLICIT RetrievalRecordDetails,
1033   sortDetails             [12]   IMPLICIT SortDetails,
1034   processing           [13]  IMPLICIT ProcessingInformation,
1035   variants          [14]  IMPLICIT VariantSetInfo,
1036   units          [15]    IMPLICIT UnitInfo,
1037   categoryList            [100]  IMPLICIT CategoryList}
1038
1039 -- Element set name 'B' (brief)  retrieves:
1040 --  -  'commonInfo' (except for otherInfo within commonInfo)
1041 --  -  key elements
1042 --  -  other elements designated as 'non-key brief elements'
1043 -- Esn 'description' retrieves brief elements as well as 'description', and specific additional descriptive
1044 -- elements if designated.  
1045 -- Element set name 'F' (full) retrieves all of the above, as well as those designated as "non-brief elements". Some
1046 -- elements designated as OPTIONAL may be mandatory in full records, and are so identified. (Note that all elements
1047 -- that are not part of the brief element set must be designated as OPTIONAL in the ASN.1, otherwise it would be
1048 -- illegal to omit them.)
1049 -- Other esns are defined (below) as needed.
1050
1051 -- - - - - - - - - - - - -   Info Records
1052   -- Info records are mainly for software consumption
1053   -- They describe individual entities within the target system:
1054   --   The target itself
1055   --   Individual databases
1056   --   Schemas
1057   --   Tag sets
1058   --   Record syntaxes
1059   --   Attribute sets
1060   --   Term lists
1061   --   Extended services
1062  --     The information about each Schema, Tag Set, Record Syntax and Attribute Set should
1063   -- match the universal definitions of these items. The only exception is that a target may omit any
1064   -- items it doesn't support, for example the description of the bib-1 attribute set may omit attributes
1065   -- that the target does not support under any circumstances.
1066   --      Databases that may be searched together can be listed in the dbCominations element of the TargetInfo record.  
1067 TargetInfo ::= SEQUENCE {
1068   commonInfo      [0]    IMPLICIT CommonInfo OPTIONAL,
1069     -- Key elements follow:
1070   name          [1]    IMPLICIT InternationalString,
1071     -- Non-key brief elements follow:
1072   recent-news      [2]    IMPLICIT HumanString OPTIONAL,
1073   icon          [3]    IMPLICIT IconObject OPTIONAL,
1074   namedResultSets    [4]    IMPLICIT BOOLEAN,
1075   multipleDBsearch    [5]    IMPLICIT BOOLEAN,
1076   maxResultSets      [6]    IMPLICIT INTEGER OPTIONAL,
1077   maxResultSize      [7]    IMPLICIT INTEGER OPTIONAL,
1078   maxTerms        [8]    IMPLICIT INTEGER OPTIONAL,
1079   timeoutInterval      [9]    IMPLICIT IntUnit OPTIONAL,
1080   welcomeMessage    [10]  IMPLICIT HumanString OPTIONAL,
1081     -- non-brief elements follow:
1082   -- 'description' esn retrieves the following two (as well as brief):
1083   contactInfo      [11]  IMPLICIT ContactInfo OPTIONAL,
1084   description      [12]  IMPLICIT HumanString OPTIONAL,
1085   nicknames        [13]  IMPLICIT SEQUENCE OF InternationalString OPTIONAL,
1086   usage-restrictions    [14]  IMPLICIT HumanString OPTIONAL,
1087   paymentAddr      [15]  IMPLICIT HumanString OPTIONAL,
1088   hours          [16]  IMPLICIT HumanString OPTIONAL,
1089   dbCombinations    [17]  IMPLICIT SEQUENCE OF DatabaseList OPTIONAL,
1090   addresses        [18]  IMPLICIT SEQUENCE OF NetworkAddress OPTIONAL,
1091   languages        [101]  IMPLICIT SEQUENCE OF InternationalString OPTIONAL,
1092                   -- Languages supported for message strings.  Each is a three-character
1093                   -- language code from Z39.53-1994.
1094 -- characterSets      [102]  this tag reserved for "character sets supported for name and message strings".
1095   -- commonAccessInfo elements list objects the target supports. All objects listed in
1096   -- AccessInfo for any individual database should also be listed here.
1097   commonAccessInfo  [19]  IMPLICIT AccessInfo OPTIONAL}
1098
1099
1100 DatabaseInfo ::= SEQUENCE {
1101       -- A target may provide "virtual databases" that are combinations of individual database. These
1102       -- databases are indicated by the presence of subDbs in the combination database's DatabaseDescription.
1103   commonInfo        [0]    IMPLICIT CommonInfo OPTIONAL,
1104     -- Key elements follow:
1105   name            [1]    IMPLICIT DatabaseName,
1106     -- Non-key brief elements follow:
1107   explainDatabase      [2]             IMPLICIT NULL OPTIONAL,
1108                        -- If present, this database is the Explain database, or an Explain database
1109                     -- for a different server, possibly on a different host. The means by which
1110                     -- that server may be accessed is not addressed by this standard. One
1111                     -- suggested possibility is an implementor agreement whereby the
1112                     -- database name is a url which may be used to connect to the server.
1113   nicknames          [3]    IMPLICIT SEQUENCE OF DatabaseName OPTIONAL,
1114   icon            [4]    IMPLICIT IconObject OPTIONAL,
1115   user-fee          [5]    IMPLICIT BOOLEAN,
1116   available          [6]    IMPLICIT BOOLEAN,
1117   titleString          [7]    IMPLICIT HumanString OPTIONAL,
1118     -- Non-brief elements follow:
1119   keywords          [8]    IMPLICIT SEQUENCE OF HumanString OPTIONAL,
1120   description        [9]    IMPLICIT HumanString OPTIONAL,
1121   associatedDbs        [10]  IMPLICIT DatabaseList OPTIONAL,
1122                     -- databases that may be searched in combination with this one 
1123
1124   subDbs          [11]  IMPLICIT DatabaseList OPTIONAL,
1125                         -- When present, this database is a composite representing the combined
1126                      -- databases 'subDbs'. The individual subDbs are also available.
1127   disclaimers        [12]  IMPLICIT HumanString OPTIONAL,
1128   news            [13]  IMPLICIT HumanString OPTIONAL,
1129   recordCount           [14]    CHOICE {
1130                                    actualNumber  [0] IMPLICIT INTEGER,
1131                                     approxNumber  [1] IMPLICIT INTEGER} OPTIONAL,
1132   defaultOrder        [15]  IMPLICIT HumanString OPTIONAL,
1133   avRecordSize        [16]  IMPLICIT INTEGER OPTIONAL,
1134   maxRecordSize      [17]  IMPLICIT INTEGER OPTIONAL,
1135   hours            [18]  IMPLICIT HumanString OPTIONAL,
1136   bestTime          [19]  IMPLICIT HumanString OPTIONAL,
1137   lastUpdate          [20]  IMPLICIT GeneralizedTime OPTIONAL,
1138   updateInterval        [21]  IMPLICIT IntUnit OPTIONAL,
1139   coverage          [22]  IMPLICIT HumanString OPTIONAL,
1140   proprietary        [23]  IMPLICIT BOOLEAN OPTIONAL, -- mandatory in full record
1141   copyrightText        [24]  IMPLICIT HumanString OPTIONAL,
1142   copyrightNotice      [25]  IMPLICIT HumanString OPTIONAL,
1143   producerContactInfo    [26]  IMPLICIT ContactInfo OPTIONAL,
1144   supplierContactInfo      [27]  IMPLICIT ContactInfo OPTIONAL,
1145   submissionContactInfo    [28]  IMPLICIT ContactInfo OPTIONAL,
1146     -- accessInfo lists items connected with the database. All listed items should be in the target's AccessInfo.
1147   accessInfo                [29]  IMPLICIT AccessInfo OPTIONAL}
1148
1149
1150 SchemaInfo ::= SEQUENCE {
1151   commonInfo    [0]  IMPLICIT CommonInfo OPTIONAL,
1152     -- Key elements follow:
1153   schema      [1]  IMPLICIT OBJECT IDENTIFIER,
1154     -- Non-key brief elements follow:
1155   name        [2]  IMPLICIT InternationalString,
1156     -- Non-brief elements follow:
1157   description    [3]  IMPLICIT HumanString OPTIONAL,
1158   tagTypeMapping  [4]  IMPLICIT SEQUENCE OF SEQUENCE {
1159               tagType    [0] IMPLICIT INTEGER,
1160               tagSet       [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL,
1161                 -- If tagSet is omitted, then this tagType is for a tagSet locally defined
1162                 -- within the schema that cannot be referenced by another schema.
1163               defaultTagType  [2] IMPLICIT NULL OPTIONAL
1164                         } OPTIONAL,
1165   recordStructure  [5]  IMPLICIT SEQUENCE OF ElementInfo OPTIONAL}
1166
1167
1168   --  ElementInfo referenced in SchemaInfo and RecordSyntaxInfo
1169     ElementInfo ::= SEQUENCE {
1170       elementName  [1] IMPLICIT InternationalString,
1171       elementTagPath  [2] IMPLICIT Path,
1172       dataType      [3] ElementDataType OPTIONAL, -- If omitted, not specified. 
1173        required         [4] IMPLICIT BOOLEAN,
1174       repeatable     [5] IMPLICIT BOOLEAN,
1175        description    [6] IMPLICIT HumanString OPTIONAL}
1176
1177
1178   -- Path is referenced by ElementInfo as well as PerElementDetails
1179              Path ::= SEQUENCE OF SEQUENCE{
1180               tagType  [1] IMPLICIT INTEGER,
1181               tagValue     [2] StringOrNumeric}
1182       ElementDataType ::= CHOICE{
1183             primitive  [0] IMPLICIT PrimitiveDataType,
1184            structured  [1] IMPLICIT SEQUENCE OF ElementInfo}
1185       PrimitiveDataType ::= INTEGER{
1186             octetString        (0),
1187             numeric           (1),
1188             date            (2),
1189             external        (3),
1190             string          (4),
1191             trueOrFalse       (5),
1192             oid         (6),
1193             intUnit        (7),
1194         empty        (8),
1195             noneOfTheAbove  (100) -- see 'description'
1196             }
1197
1198
1199 TagSetInfo ::= SEQUENCE {
1200   commonInfo  [0]  IMPLICIT CommonInfo OPTIONAL,
1201     -- Key elements follow:
1202   tagSet      [1]  IMPLICIT OBJECT IDENTIFIER,
1203     -- non-key brief elements follow:
1204   name      [2]  IMPLICIT InternationalString,
1205     -- non-brief elements follow:
1206   description  [3]  IMPLICIT HumanString OPTIONAL,
1207   elements    [4]  IMPLICIT SEQUENCE OF SEQUENCE {
1208               elementname  [1]  IMPLICIT InternationalString,
1209                nicknames    [2]  IMPLICIT SEQUENCE OF InternationalString OPTIONAL,
1210               elementTag     [3]  StringOrNumeric, 
1211               description    [4]  IMPLICIT HumanString OPTIONAL, 
1212             dataType       [5]  PrimitiveDataType OPTIONAL,
1213               -- If the data type is expected to be structured, that is described in the schema info,
1214               -- and datatype is omitted here.
1215              otherTagInfo       OtherInformation OPTIONAL} OPTIONAL}
1216
1217 RecordSyntaxInfo ::= SEQUENCE {
1218   commonInfo    [0]  IMPLICIT CommonInfo OPTIONAL,
1219     -- Key elements follow:
1220   recordSyntax    [1]  IMPLICIT OBJECT IDENTIFIER,
1221     -- Non-key brief elements follow:
1222   name        [2]  IMPLICIT InternationalString,
1223     -- non-brief elements follow:
1224   transferSyntaxes  [3]  IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
1225   description    [4]  IMPLICIT HumanString OPTIONAL,
1226   asn1Module    [5]  IMPLICIT InternationalString OPTIONAL,
1227   abstractStructure  [6]  IMPLICIT SEQUENCE OF ElementInfo OPTIONAL
1228                -- Omitting abstractStructure only means target isn't using
1229                  -- Explain to describe the structure, not that there is no structure.
1230               }
1231
1232 AttributeSetInfo ::= SEQUENCE {
1233   commonInfo  [0]  IMPLICIT CommonInfo OPTIONAL,
1234     -- Key elements follow:
1235   attributeSet  [1]  IMPLICIT AttributeSetId,
1236     -- non-key brief elements follow:
1237   name      [2]  IMPLICIT InternationalString,
1238     -- non-brief elements follow:
1239   attributes    [3]  IMPLICIT SEQUENCE OF AttributeType OPTIONAL,
1240             -- mandatory in full record
1241   description   [4] IMPLICIT HumanString OPTIONAL}
1242 -- AttributeType referenced in AttributeSetInfo
1243   AttributeType ::= SEQUENCE {
1244       name             [0] IMPLICIT InternationalString OPTIONAL,
1245       description      [1] IMPLICIT HumanString OPTIONAL,
1246        attributeType    [2] IMPLICIT INTEGER,
1247       attributeValues  [3] IMPLICIT SEQUENCE OF AttributeDescription}
1248     AttributeDescription ::= SEQUENCE {
1249         name                 [0] IMPLICIT InternationalString OPTIONAL,
1250         description          [1] IMPLICIT HumanString OPTIONAL,
1251         attributeValue       [2] StringOrNumeric,
1252         equivalentAttributes  [3]  IMPLICIT SEQUENCE OF StringOrNumeric OPTIONAL
1253                   -- each is an occurrence of 'attributeValue' from AttributeDescription for a
1254                   -- different attribute. Equivalences listed here should be derived from the 
1255                   -- attribute set definition, not from a particular server's behavior.  
1256                     }
1257
1258
1259 TermListInfo ::= SEQUENCE{
1260   commonInfo    [0]  IMPLICIT CommonInfo OPTIONAL,
1261     -- Key elements follow:
1262   databaseName  [1]  IMPLICIT DatabaseName,
1263     -- Non-key brief elements follow:
1264   termLists      [2] IMPLICIT SEQUENCE OF SEQUENCE{
1265             name    [1] IMPLICIT InternationalString,
1266             title    [2] IMPLICIT HumanString OPTIONAL,
1267                                             -- Title is for users to see and can differ by language. Name, on the
1268                       -- other hand is typically a short string not necessarily meant to be
1269                        -- human-readable, and not variable by language.
1270             searchCost   [3]   IMPLICIT INTEGER {
1271                   optimized  (0),    -- The attribute (or combination) associated
1272                             -- with this   list will do fast searches. 
1273                       normal      (1),    -- The attribute (combination) will work as
1274                             -- expected. So there's probably an index for the
1275                             -- attribute (combination) or some similar
1276                              -- mechanism.
1277                       expensive   (2),    -- Can use the attribute (combination), but it
1278                             -- might not provide satisfactory results.
1279                             -- Probably there is no index, or post-
1280                             -- processing of records is required.
1281                       filter      (3)    -- can't search with this attribute (combination) alone.
1282                          } OPTIONAL,
1283               scanable  [4]  IMPLICIT BOOLEAN, -- 'true' means this list can be scanned.
1284                broader    [5] IMPLICIT SEQUENCE OF InternationalString OPTIONAL,
1285                narrower  [6] IMPLICIT SEQUENCE OF InternationalString OPTIONAL
1286                        -- broader and narrower list alternative term lists related to this one.
1287                        -- The term lists so listed should also be in this termLists structure.
1288                           }
1289   -- no non-brief elements
1290             }
1291
1292
1293 ExtendedServicesInfo ::= SEQUENCE {
1294   commonInfo          [0]  IMPLICIT CommonInfo OPTIONAL,
1295     -- Key elements follow:
1296   type          [1]  IMPLICIT OBJECT IDENTIFIER,
1297     -- Non-key brief elements follow:
1298   name                [2]  IMPLICIT InternationalString OPTIONAL,
1299                 -- should be supplied if privateType is 'true'
1300   privateType      [3]  IMPLICIT BOOLEAN,
1301   restrictionsApply    [5]  IMPLICIT BOOLEAN,  -- if 'true' see 'description'
1302   feeApply              [6]  IMPLICIT BOOLEAN,  -- if 'true' see 'description'
1303   available             [7]  IMPLICIT BOOLEAN,
1304   retentionSupported    [8]  IMPLICIT BOOLEAN,
1305   waitAction      [9]  IMPLICIT INTEGER{
1306                 waitSupported    (1),
1307                 waitAlways      (2),
1308                 waitNotSupported  (3),
1309                 depends      (4),
1310                 notSaying      (5)},
1311   -- non-brief elements follow:
1312     -- To get brief plus 'description' use esn 'description'
1313   description           [10]  IMPLICIT HumanString OPTIONAL,
1314       -- to get above elements and 'specificExplain' use esn 'specificExplain'
1315   specificExplain    [11]  IMPLICIT EXTERNAL OPTIONAL,
1316                   -- Use oid of specific ES, and select choice [3] 'explain'. Format
1317                   -- to be developed in conjunction with the specific ES definition.
1318     -- to get all elements except 'specificExplain', use esn 'asn'
1319   esASN          [12]  IMPLICIT InternationalString OPTIONAL -- the ASN.1 for this ES
1320                 }
1321
1322 -- - - - - - - - - - - - - Detail records
1323  -- The detail records describe relationships among entities supported by the target. RetrievalRecordDetails describes
1324  -- the way that schema elements are mapped into record elements. This mapping may be different for each
1325  -- combination of database, schema, record syntax. The per-element details describe the default mapping.
1326  -- Origin-request re-tagging can change that mapping. When multiple databases are listed in a databaseNames
1327  -- element, the record applies equally to all of the listed databases.  This is unrelated to searching the databases
1328  -- together. AttributeDetails describes how databases can be searched. Each supported attribute is listed, and the
1329  -- allowable combinations can be described.
1330
1331
1332 AttributeDetails ::= SEQUENCE {
1333   commonInfo        [0]  IMPLICIT CommonInfo OPTIONAL,
1334     -- Key elements follow:
1335   databaseName        [1]  IMPLICIT DatabaseName,
1336     -- Non-brief elements follow:
1337   attributesBySet        [2]  IMPLICIT SEQUENCE OF AttributeSetDetails OPTIONAL, 
1338                   -- mandatory in full record
1339   attributeCombinations    [3]  IMPLICIT AttributeCombinations OPTIONAL}
1340
1341
1342
1343
1344 -- AttributeSetDetails referenced by AttributeDetails
1345   AttributeSetDetails ::= SEQUENCE {
1346         attributeSet      [0] IMPLICIT AttributeSetId,
1347           attributesByType  [1] IMPLICIT SEQUENCE OF AttributeTypeDetails }
1348     AttributeTypeDetails ::= SEQUENCE {
1349          attributeType     [0] IMPLICIT INTEGER,
1350           defaultIfOmitted    [1] IMPLICIT OmittedAttributeInterpretation OPTIONAL,
1351           attributeValues    [2] IMPLICIT SEQUENCE OF AttributeValue OPTIONAL }
1352                           -- If no attributeValues are supplied, all values of this type are fully
1353                     -- supported, and the descriptions in AttributeSetInfo are adequate.
1354
1355     OmittedAttributeInterpretation ::= SEQUENCE {
1356         defaultValue           [0] StringOrNumeric OPTIONAL,
1357                                 -- A default value is listed if that's how the server works
1358         defaultDescription  [1] IMPLICIT HumanString OPTIONAL }
1359                           -- The human-readable description should generally be provided.
1360                     -- It is legal for both default elements to be missing, which
1361                     -- means that the target will allow the attribute type to be
1362                     -- omitted, but isn't saying what it will do.
1363
1364     AttributeValue ::= SEQUENCE {
1365         value              [0]  StringOrNumeric,
1366         description        [1]  IMPLICIT HumanString OPTIONAL,
1367         subAttributes     [2]  IMPLICIT SEQUENCE OF StringOrNumeric OPTIONAL,
1368         superAttributes    [3]  IMPLICIT SEQUENCE OF StringOrNumeric OPTIONAL,
1369         partialSupport    [4]  IMPLICIT NULL OPTIONAL }
1370         -- partialSupport indicates that an attributeValue is accepted, but may not be processed in the
1371         -- "expected" way. One important reason for this is composite databases: in this case partialSupport
1372         -- may indicate that only some of the subDbs support the attribute, and others ignore it.
1373
1374
1375
1376 TermListDetails ::= SEQUENCE{  -- one for each termList in TermListInfo
1377   commonInfo    [0]  IMPLICIT CommonInfo OPTIONAL,
1378     -- Key elements follow:
1379   termListName    [1]  IMPLICIT InternationalString,
1380     -- Non-key elements (all non-brief) follow:
1381   description    [2]  IMPLICIT HumanString OPTIONAL,
1382   attributes      [3]  IMPLICIT AttributeCombinations OPTIONAL,
1383                           -- Pattern for attributes that hit this list. Mandatory in full record
1384   scanInfo      [4]  IMPLICIT SEQUENCE {
1385                 maxStepSize         [0] IMPLICIT INTEGER OPTIONAL,
1386                 collatingSequence  [1] IMPLICIT HumanString OPTIONAL,
1387                 increasing            [2] IMPLICIT BOOLEAN OPTIONAL} OPTIONAL,
1388             -- Occurs only if list is scanable. If list is scanable and if scanInfo is omitted, 
1389             -- target doesn't consider these important.
1390   estNumberTerms  [5]  IMPLICIT INTEGER OPTIONAL,
1391   sampleTerms    [6]  IMPLICIT SEQUENCE OF Term OPTIONAL}
1392
1393
1394
1395 ElementSetDetails ::= SEQUENCE {
1396   -- ElementSetDetails describes the way that database records are mapped to record elements. This
1397   -- mapping may be different for each combination of database name and element set. The database record
1398    -- description is a schema, which may be private to the target. The schema's abstract record structure
1399   -- and tag sets provide the vocabulary for discussing record content; their presence in the Explain
1400   -- database does not imply support for complex retrieval specification.
1401   commonInfo      [0]  IMPLICIT CommonInfo OPTIONAL,
1402     -- Key elements follow:
1403   databaseName      [1]  IMPLICIT DatabaseName,
1404   elementSetName    [2]  IMPLICIT ElementSetName,
1405   recordSyntax      [3]  IMPLICIT OBJECT IDENTIFIER,
1406     -- Non-key Brief elements follow:
1407   schema        [4]  IMPLICIT OBJECT IDENTIFIER,
1408     -- Non-brief elements follow:
1409   description      [5]  IMPLICIT HumanString OPTIONAL,
1410   detailsPerElement    [6]  IMPLICIT SEQUENCE OF PerElementDetails OPTIONAL -- mandatory in full record
1411               }
1412
1413
1414 RetrievalRecordDetails ::= SEQUENCE {
1415   commonInfo      [0]  IMPLICIT CommonInfo OPTIONAL,
1416     -- Key elements follow:
1417   databaseName      [1]  IMPLICIT DatabaseName,
1418   schema        [2]  IMPLICIT OBJECT IDENTIFIER,
1419   recordSyntax      [3]  IMPLICIT OBJECT IDENTIFIER,
1420     -- Non-brief elements follow:
1421   description      [4]  IMPLICIT HumanString OPTIONAL,
1422   detailsPerElement    [5]  IMPLICIT SEQUENCE OF PerElementDetails OPTIONAL
1423                 -- mandatory in full record
1424             }
1425
1426 -- PerElementDetails is referenced in RetrievalRecordDetails and ElementSetDetails.
1427   PerElementDetails ::= SEQUENCE {
1428       name      [0]    IMPLICIT InternationalString OPTIONAL,
1429                    -- If the name is omitted, the record syntax's name for this element
1430                   -- is appropriate.
1431       recordTag    [1]    IMPLICIT RecordTag OPTIONAL,
1432                    -- The record tag may be omitted if tags are inappropriate for the record
1433                   -- syntax, or if the origin can be expected to know it for some other reason.
1434       schemaTags    [2]    IMPLICIT SEQUENCE OF Path OPTIONAL,
1435                       -- The information from the listed schema elements is combined
1436                   -- in some way to produce the data sent in the listed record tag. The
1437                   -- 'contents' element below may describe the logic used.
1438       maxSize    [3]    IMPLICIT INTEGER OPTIONAL,
1439       minSize    [4]    IMPLICIT INTEGER OPTIONAL,
1440       avgSize      [5]    IMPLICIT INTEGER OPTIONAL,
1441       fixedSize    [6]    IMPLICIT INTEGER OPTIONAL,
1442       repeatable    [8]    IMPLICIT BOOLEAN,
1443       required    [9]    IMPLICIT BOOLEAN, 
1444                   -- 'required' really means that target will always supply the element.
1445       description    [12]  IMPLICIT HumanString OPTIONAL,
1446       contents    [13]  IMPLICIT HumanString OPTIONAL,
1447       billingInfo    [14]  IMPLICIT HumanString OPTIONAL,
1448       restrictions    [15]  IMPLICIT HumanString OPTIONAL,
1449       alternateNames  [16]  IMPLICIT SEQUENCE OF InternationalString OPTIONAL,
1450       genericNames  [17]  IMPLICIT SEQUENCE OF InternationalString OPTIONAL,
1451       searchAccess  [18]  IMPLICIT AttributeCombinations OPTIONAL }
1452       -- RecordTag referenced in PerElementDetails above
1453         RecordTag ::= SEQUENCE {
1454               qualifier  [0] StringOrNumeric OPTIONAL,
1455                     -- E.g. tag set for GRS-1
1456               tagValue  [1] StringOrNumeric}
1457
1458 SortDetails ::= SEQUENCE {
1459   commonInfo    [0]  IMPLICIT CommonInfo OPTIONAL,
1460   -- Key elements follow:
1461   databaseName    [1]  IMPLICIT DatabaseName,
1462     -- No non-key brief elements
1463     -- Non-brief elements follow:
1464   sortKeys      [2]  IMPLICIT SEQUENCE OF SortKeyDetails OPTIONAL
1465               -- mandatory in full record
1466           }
1467   SortKeyDetails ::= SEQUENCE {
1468       description        [0]  IMPLICIT HumanString OPTIONAL,
1469       elementSpecifications  [1]  IMPLICIT SEQUENCE OF Specification OPTIONAL,
1470                       -- each specification is a way of specifying this same sort key
1471       attributeSpecifications  [2]  IMPLICIT AttributeCombinations OPTIONAL,
1472                       -- each combination is a way of specifying this same sort key
1473       sortType                   [3]  CHOICE {
1474                     character    [0]  IMPLICIT NULL,
1475                     numeric    [1]  IMPLICIT NULL,
1476                     structured    [2]  IMPLICIT HumanString} OPTIONAL,
1477       caseSensitivity      [4]  IMPLICIT INTEGER {
1478                       always    (0),  -- always case-sensitive
1479                     never    (1),            -- never case-sensitive
1480                     default-yes  (2),               -- case-sensitivity is as specified on request, and if not
1481                             -- specified, case-sensitive.
1482                     default-no  (3)} -- case-sensitivity is as specified on request, and if not
1483                             -- specified, not case-sensitive.
1484                           OPTIONAL}
1485
1486 ProcessingInformation ::= SEQUENCE{
1487   commonInfo      [0]  IMPLICIT CommonInfo OPTIONAL,
1488     -- Key elements follow:
1489   databaseName      [1]  IMPLICIT DatabaseName,
1490   processingContext    [2]  IMPLICIT INTEGER {
1491                   access        (0),   -- e.g. choosing databases
1492                   search        (1),   -- e.g. "search strategies" or search forms 
1493                   retrieval      (2),   -- e.g. recommended element combinations 
1494                   record-presentation  (3),    -- display of retrieved records
1495                   record-handling    (4)    -- handling (e.g. saving) of retrieved records
1496         },
1497   name          [3]  IMPLICIT InternationalString,
1498   oid          [4]  IMPLICIT OBJECT IDENTIFIER,
1499     -- No non-key brief elements
1500     -- Non-brief elements follow:
1501   description      [5]  IMPLICIT HumanString OPTIONAL,
1502                 -- use element set name 'description' to retrieve all except instructions.
1503   instructions      [6]  IMPLICIT EXTERNAL OPTIONAL -- mandatory in full record
1504               }
1505
1506
1507 VariantSetInfo ::= SEQUENCE {
1508     -- A record in this category describes a variant set definition, i.e., classes, types, and values, for a specific
1509     -- variant set definition supported by the target. Support by the target of a particular variant set definition
1510     -- does not imply that the definition is supported for any specific database or element. 
1511   commonInfo    [0] IMPLICIT CommonInfo OPTIONAL,
1512   -- Key elements follow:
1513   variantSet    [1] IMPLICIT OBJECT IDENTIFIER,
1514   -- Non-key brief elements follow:
1515   name      [2] IMPLICIT InternationalString,
1516   -- Non-brief elements follow:
1517   variants    [3] IMPLICIT SEQUENCE OF VariantClass OPTIONAL
1518                    -- mandatory in full record
1519            }
1520
1521   -- Subsidiary structures for VariantSetInfo
1522     VariantClass ::= SEQUENCE {
1523           name        [0] IMPLICIT InternationalString OPTIONAL,
1524           description    [1] IMPLICIT HumanString OPTIONAL,
1525           variantClass    [2] IMPLICIT INTEGER,
1526           variantTypes  [3] IMPLICIT SEQUENCE OF VariantType}
1527     VariantType ::= SEQUENCE {
1528           name            [0] IMPLICIT InternationalString OPTIONAL,
1529           description     [1] IMPLICIT HumanString OPTIONAL,
1530           variantType    [2] IMPLICIT INTEGER,
1531           variantValue  [3] IMPLICIT VariantValue OPTIONAL}
1532     VariantValue ::= SEQUENCE {
1533           dataType     [0] PrimitiveDataType,
1534           values        [1] ValueSet OPTIONAL }
1535     ValueSet ::= CHOICE {
1536           range       [0] IMPLICIT ValueRange,
1537           enumerated  [1] IMPLICIT SEQUENCE OF ValueDescription }
1538     ValueRange ::= SEQUENCE {
1539             -- At last one the following must be supplied, both may be supplied.
1540           lower      [0] ValueDescription OPTIONAL,
1541           upper     [1] ValueDescription OPTIONAL }
1542     ValueDescription ::= CHOICE{
1543       integer             INTEGER,
1544           string              InternationalString,
1545           octets              OCTET STRING,
1546           oid                 OBJECT IDENTIFIER,
1547           unit               [1]  IMPLICIT Unit,
1548           valueAndUnit   [2]  IMPLICIT IntUnit 
1549             -- oid and unit can't be used in a ValueRange
1550             }
1551
1552
1553
1554 UnitInfo ::= SEQUENCE {
1555   commonInfo  [0] IMPLICIT CommonInfo OPTIONAL,
1556   -- Key elements follow:
1557   unitSystem   [1] IMPLICIT InternationalString,
1558    -- No non-key brief elements
1559    -- Non-brief elements follow:
1560   description   [2] IMPLICIT HumanString OPTIONAL,
1561   units      [3] IMPLICIT SEQUENCE OF UnitType OPTIONAL
1562                          -- mandatory in full record
1563            }
1564
1565   -- Subsidiary structures for UnitInfo
1566     UnitType ::= SEQUENCE {
1567       name    [0] IMPLICIT InternationalString OPTIONAL,
1568       description  [1] IMPLICIT HumanString OPTIONAL,
1569       unitType  [2] StringOrNumeric,
1570       units     [3] IMPLICIT SEQUENCE OF Units}
1571
1572     Units ::= SEQUENCE {
1573       name     [0] IMPLICIT InternationalString OPTIONAL,
1574       description  [1] IMPLICIT HumanString OPTIONAL,
1575       unit      [2] StringOrNumeric}
1576
1577 CategoryList ::= SEQUENCE {
1578   commonInfo      [0] IMPLICIT CommonInfo OPTIONAL,
1579     -- Only one record expected per Explain database. All elements appear in brief presentation.
1580   categories      [1] IMPLICIT SEQUENCE OF CategoryInfo }
1581     CategoryInfo ::= SEQUENCE {
1582            category          [1] IMPLICIT InternationalString,
1583             originalCategory    [2] IMPLICIT InternationalString OPTIONAL,
1584           description         [3] IMPLICIT HumanString OPTIONAL,
1585          asn1Module      [4] IMPLICIT InternationalString OPTIONAL}
1586
1587
1588 -- - - - - - - - - - - - - - Subsidiary definitions
1589
1590 CommonInfo ::= SEQUENCE {
1591   dateAdded         [0] IMPLICIT GeneralizedTime OPTIONAL,
1592   dateChanged       [1] IMPLICIT GeneralizedTime OPTIONAL,
1593   expiry                [2] IMPLICIT GeneralizedTime OPTIONAL,
1594   humanString-Language  [3] IMPLICIT LanguageCode OPTIONAL,
1595   -- following not to occur for brief:
1596   otherInfo          OtherInformation OPTIONAL}
1597
1598
1599 HumanString ::= SEQUENCE OF SEQUENCE {
1600           language  [0] IMPLICIT LanguageCode OPTIONAL,
1601         text        [1] IMPLICIT InternationalString}
1602
1603 IconObject ::= SEQUENCE OF SEQUENCE{
1604       -- Note that the "SEQUENCE OF" is to allow alternative representations of the same Icon; it is not
1605       -- intended to allow multiple icons.
1606   bodyType [1] CHOICE{
1607            ianaType  [1] IMPLICIT InternationalString,
1608           z3950type  [2] IMPLICIT InternationalString,
1609            otherType  [3] IMPLICIT InternationalString},
1610   content  [2] IMPLICIT OCTET STRING}
1611
1612
1613 LanguageCode ::= InternationalString  -- from ANSI/NISO Z39.53-1994 
1614
1615 ContactInfo ::= SEQUENCE {
1616   name           [0] IMPLICIT InternationalString OPTIONAL,
1617   description  [1] IMPLICIT HumanString OPTIONAL,
1618   address        [2] IMPLICIT HumanString OPTIONAL,
1619   email         [3] IMPLICIT InternationalString OPTIONAL,
1620   phone         [4] IMPLICIT InternationalString OPTIONAL}
1621
1622 NetworkAddress ::= CHOICE {
1623   internetAddress      [0] IMPLICIT SEQUENCE {
1624                   hostAddress    [0]  IMPLICIT InternationalString,
1625                   port       [1]  IMPLICIT INTEGER},
1626   osiPresentationAddress    [1] IMPLICIT SEQUENCE { 
1627                     pSel         [0] IMPLICIT InternationalString,  
1628                     sSel         [1] IMPLICIT InternationalString OPTIONAL,  
1629                     tSel        [2] IMPLICIT InternationalString OPTIONAL,  
1630                     nSap      [3] IMPLICIT InternationalString},
1631   other            [2] IMPLICIT SEQUENCE {  
1632                       type        [0] IMPLICIT InternationalString,
1633                 address    [1] IMPLICIT InternationalString}}
1634
1635 AccessInfo ::= SEQUENCE {
1636     -- AccessInfo contains the fundamental information about what facilities are required to use this target
1637     -- or server. For example, if an origin can handle none of the record syntaxes a database can provide, 
1638     -- it might choose not to access the database.
1639   queryTypesSupported  [0]    IMPLICIT SEQUENCE OF QueryTypeDetails OPTIONAL,
1640   diagnosticsSets        [1]    IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
1641   attributeSetIds          [2]    IMPLICIT SEQUENCE OF AttributeSetId OPTIONAL,
1642   schemas                [3]    IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
1643   recordSyntaxes         [4]    IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
1644   resourceChallenges    [5]    IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
1645   restrictedAccess       [6]    IMPLICIT AccessRestrictions OPTIONAL,
1646   costInfo                 [8]    IMPLICIT Costs OPTIONAL,
1647   variantSets       [9]    IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
1648   elementSetNames    [10]  IMPLICIT SEQUENCE OF ElementSetName OPTIONAL,
1649   unitSystems      [11]  IMPLICIT SEQUENCE OF InternationalString}
1650
1651 -- begin auxiliary definitions for AccessInfo
1652 -- Begin Query Details
1653 QueryTypeDetails ::= CHOICE {
1654   private       [0]    IMPLICIT PrivateCapabilities,
1655   rpn            [1]    IMPLICIT RpnCapabilities,
1656   iso8777          [2]    IMPLICIT Iso8777Capabilities,
1657   z39-58      [100]  IMPLICIT HumanString,
1658   erpn        [101]  IMPLICIT RpnCapabilities,
1659   rankedList      [102]  IMPLICIT HumanString}
1660
1661 PrivateCapabilities ::= SEQUENCE {
1662   operators       [0]  IMPLICIT SEQUENCE OF SEQUENCE {
1663               operator  [0] IMPLICIT InternationalString,
1664               description  [1] IMPLICIT HumanString OPTIONAL } OPTIONAL,
1665   searchKeys    [1]  IMPLICIT SEQUENCE OF SearchKey OPTIONAL,  -- field names that can be searched
1666   description    [2]  IMPLICIT SEQUENCE OF HumanString OPTIONAL }
1667
1668 RpnCapabilities ::= SEQUENCE {
1669   operators                    [0] IMPLICIT SEQUENCE OF INTEGER OPTIONAL,
1670                                         -- Omitted means all operators are supported.
1671   resultSetAsOperandSupported  [1] IMPLICIT BOOLEAN,
1672   restrictionOperandSupported    [2] IMPLICIT BOOLEAN,
1673   proximity                    [3] IMPLICIT ProximitySupport OPTIONAL}
1674
1675 Iso8777Capabilities ::= SEQUENCE {
1676   searchKeys  [0]  IMPLICIT SEQUENCE OF SearchKey,  -- field names that may be searched
1677   restrictions   [1]  IMPLICIT HumanString OPTIONAL 
1678             -- Omitted means supported, not specifying units.
1679               }
1680
1681 ProximitySupport ::= SEQUENCE {
1682   anySupport      [0]   IMPLICIT BOOLEAN,
1683           -- 'false' means no proximity support, in which case unitsSupported not supplied.
1684   unitsSupported  [1]   IMPLICIT SEQUENCE OF CHOICE{  
1685              known  [1] IMPLICIT INTEGER, -- values from KnownProximityUnit
1686           private  [2] IMPLICIT SEQUENCE{  
1687                       unit    [0] IMPLICIT INTEGER,  
1688                 description  [1] HumanString OPTIONAL}} OPTIONAL}
1689
1690 SearchKey ::= SEQUENCE {
1691   searchKey     [0]  IMPLICIT InternationalString,
1692   description     [1]  IMPLICIT HumanString OPTIONAL }
1693 -- End Query details
1694 AccessRestrictions ::= SEQUENCE OF SEQUENCE {
1695   accessType      [0] INTEGER {
1696                   any         (0),
1697                   search         (1),
1698                   present         (2),
1699                   specific-elements  (3),
1700                   extended-services  (4),
1701             by-database      (5)},
1702   accessText         [1]  IMPLICIT HumanString OPTIONAL,
1703   accessChallenges  [2]  IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL}
1704
1705 Costs ::= SEQUENCE {
1706   connectCharge    [0] IMPLICIT Charge OPTIONAL,    -- Per-connection charge
1707   connectTime    [1] IMPLICIT Charge OPTIONAL,    -- Time-based charge
1708   displayCharge     [2] IMPLICIT Charge OPTIONAL,    -- Per-record charge
1709   searchCharge     [3] IMPLICIT Charge OPTIONAL,    -- Per-search charge
1710   subscriptCharge  [4]  IMPLICIT Charge OPTIONAL,  -- Subscription charges
1711   otherCharges    [5] IMPLICIT SEQUENCE OF SEQUENCE{   -- Other charges
1712             forWhat  [1]  IMPLICIT HumanString,
1713             charge    [2]  IMPLICIT Charge} OPTIONAL} 
1714     Charge ::= SEQUENCE{
1715         cost          [1] IMPLICIT IntUnit,
1716         perWhat  [2] IMPLICIT Unit OPTIONAL,
1717                       -- e.g. "second," "minute," "line," "record"...
1718         text          [3] IMPLICIT HumanString OPTIONAL} 
1719 -- End Auxiliary definitions for AccessInfo
1720
1721 DatabaseList ::= SEQUENCE OF DatabaseName
1722
1723 AttributeCombinations ::= SEQUENCE {
1724   defaultAttributeSet  [0] IMPLICIT AttributeSetId,
1725                  -- Default for the combinations. Also probably a good choice for the default
1726               -- in searches, but that isn't required.
1727   legalCombinations  [1] IMPLICIT SEQUENCE OF AttributeCombination }
1728
1729
1730 AttributeCombination ::= SEQUENCE OF AttributeOccurrence
1731             -- An AttributeCombination is a pattern for legal combination of attributes
1732
1733
1734 AttributeOccurrence ::= SEQUENCE {   
1735       -- An AttributeOccurrence lists the legal values for a specific attribute type in a combination.
1736        attributeSet       [0]  IMPLICIT AttributeSetId OPTIONAL,
1737        attributeType      [1]  IMPLICIT INTEGER,
1738        mustBeSupplied  [2]  IMPLICIT NULL OPTIONAL,
1739        attributeValues    CHOICE {
1740                       any-or-none  [3] IMPLICIT NULL, -- All supported values are OK 
1741                       specific    [4] IMPLICIT SEQUENCE OF StringOrNumeric}}
1742                                                   -- Only these values allowed
1743 END
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753 RecordSyntax-SUTRS
1754 {Z39-50-recordSyntax SUTRS (101)} DEFINITIONS ::=
1755 BEGIN 
1756 IMPORTS InternationalString  FROM Z39-50-APDU-1995;
1757         SutrsRecord ::=  InternationalString
1758 -- Line terminator is ASCII LF (X'0A').
1759 -- Recommended maximum line length is 72 characters.
1760 END
1761
1762
1763
1764
1765
1766 RecordSyntax-opac
1767 {Z39-50-recordSyntax opac (102)} DEFINITIONS ::=
1768 BEGIN 
1769 IMPORTS InternationalString  FROM Z39-50-APDU-1995;
1770 OPACRecord ::= SEQUENCE {
1771   bibliographicRecord   [1]   IMPLICIT EXTERNAL OPTIONAL,
1772   holdingsData     [2]   IMPLICIT SEQUENCE OF HoldingsRecord OPTIONAL}
1773 HoldingsRecord ::=  CHOICE {
1774   marcHoldingsRecord  [1]   IMPLICIT EXTERNAL,
1775   holdingsAndCirc  [2]  IMPLICIT HoldingsAndCircData}
1776 HoldingsAndCircData ::=  SEQUENCE {
1777 -- the following elements are required to display holdings in conformance with NISO standards.
1778   typeOfRecord    [1]   IMPLICIT InternationalString OPTIONAL, -- LDR 06
1779   encodingLevel    [2]   IMPLICIT InternationalString OPTIONAL, -- LDR 017
1780   format      [3]   IMPLICIT InternationalString OPTIONAL, -- 007 00-01
1781   receiptAcqStatus    [4]   IMPLICIT InternationalString OPTIONAL, -- 008 06
1782   generalRetention    [5]   IMPLICIT InternationalString OPTIONAL, -- 008 12
1783   completeness    [6]   IMPLICIT InternationalString OPTIONAL, -- 008 16
1784        dateOfReport     [7]   IMPLICIT InternationalString OPTIONAL, -- 008 26-31
1785   nucCode    [8]   IMPLICIT InternationalString OPTIONAL, -- 852 $a
1786   localLocation    [9]   IMPLICIT InternationalString OPTIONAL, -- 852 $b
1787   shelvingLocation  [10]   IMPLICIT InternationalString OPTIONAL, -- 852 $c
1788   callNumber    [11]   IMPLICIT InternationalString OPTIONAL, -- 852 $h and $i
1789   shelvingData     [12]   IMPLICIT InternationalString OPTIONAL, -- 852 $j thru $m
1790   copyNumber    [13]   IMPLICIT InternationalString OPTIONAL, -- 852 $t
1791   publicNote    [14]   IMPLICIT InternationalString OPTIONAL, -- 852 $z
1792   reproductionNote  [15]   IMPLICIT InternationalString OPTIONAL, -- 843
1793   termsUseRepro     [16]   IMPLICIT InternationalString OPTIONAL, -- 845
1794   enumAndChron    [17]   IMPLICIT InternationalString OPTIONAL, -- all 85x, 86x
1795   volumes     [18]   IMPLICIT SEQUENCE OF Volume OPTIONAL, 
1796             -- repeats for each volume held
1797   circulationData    [19]   IMPLICIT SEQUENCE OF CircRecord OPTIONAL 
1798             -- repeats for each circulating item.
1799             }
1800 Volume ::=  SEQUENCE {
1801   enumeration    [1]   IMPLICIT InternationalString OPTIONAL,
1802   chronology     [2]   IMPLICIT InternationalString OPTIONAL,
1803   enumAndChron    [3]   IMPLICIT InternationalString OPTIONAL }
1804 CircRecord ::=  SEQUENCE {
1805   availableNow    [1]   IMPLICIT BOOLEAN,
1806   availablityDate    [2]   IMPLICIT InternationalString OPTIONAL,
1807   availableThru      [3]   IMPLICIT InternationalString OPTIONAL,
1808   restrictions     [4]   IMPLICIT InternationalString OPTIONAL,
1809   itemId        [5]   IMPLICIT InternationalString OPTIONAL,
1810   renewable        [6]   IMPLICIT BOOLEAN,
1811   onHold        [7]   IMPLICIT BOOLEAN,
1812   enumAndChron     [8]   IMPLICIT InternationalString OPTIONAL,
1813   midspine    [9]   IMPLICIT InternationalString OPTIONAL,
1814   temporaryLocation  [10]   IMPLICIT InternationalString OPTIONAL}
1815 END
1816
1817
1818
1819 RecordSyntax-summary
1820
1821 {Z39-50-recordSyntax summary (103)} DEFINITIONS ::=
1822 BEGIN 
1823 IMPORTS OtherInformation, InternationalString  FROM Z39-50-APDU-1995;
1824 BriefBib ::= SEQUENCE {
1825   title           [1]   IMPLICIT InternationalString,
1826   author            [2]   IMPLICIT InternationalString OPTIONAL,
1827   callNumber         [3]   IMPLICIT InternationalString OPTIONAL,
1828   recordType      [4]   IMPLICIT InternationalString OPTIONAL,
1829   bibliographicLevel  [5]   IMPLICIT InternationalString OPTIONAL,
1830   format        [6]   IMPLICIT SEQUENCE OF FormatSpec OPTIONAL,
1831   publicationPlace    [7]   IMPLICIT InternationalString OPTIONAL,
1832   publicationDate     [8]   IMPLICIT InternationalString OPTIONAL,
1833   targetSystemKey   [9]   IMPLICIT InternationalString OPTIONAL,
1834   satisfyingElement  [10]   IMPLICIT InternationalString OPTIONAL,
1835   rank         [11]   IMPLICIT INTEGER OPTIONAL,
1836   documentId     [12]   IMPLICIT InternationalString OPTIONAL,
1837   abstract       [13]   IMPLICIT InternationalString OPTIONAL,
1838   otherInfo        OtherInformation OPTIONAL}
1839
1840 FormatSpec     ::=  SEQUENCE {
1841   type         [1]   IMPLICIT InternationalString,
1842   size      [2]   IMPLICIT INTEGER OPTIONAL,
1843   bestPosn     [3]   IMPLICIT INTEGER OPTIONAL}
1844 END
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855 RecordSyntax-generic  -- For detailed semantics, see Appendix RET.
1856 {Z39-50-recordSyntax GRS-1 (105)} DEFINITIONS ::=
1857 BEGIN 
1858 EXPORTS Variant;
1859 IMPORTS IntUnit, Unit, InternationalString, StringOrNumeric, Term FROM Z39-50-APDU-1995;
1860
1861 GenericRecord ::= SEQUENCE OF TaggedElement  
1862 TaggedElement ::= SEQUENCE {
1863   tagType    [1] IMPLICIT INTEGER OPTIONAL,
1864               -- If omitted, default should be supplied dynamically by tagSet-M; 
1865               -- otherwise it should be statically specified by the schema.
1866   tagValue    [2] StringOrNumeric,
1867   tagOccurrence  [3] IMPLICIT INTEGER OPTIONAL,
1868                              -- Occurrence within the database record, and relative to the parent. No
1869               -- default; if omitted, target not telling or it is irrelevant.
1870   content      [4] ElementData,
1871   metaData    [5] IMPLICIT ElementMetaData OPTIONAL,
1872   appliedVariant  [6] IMPLICIT Variant OPTIONAL}
1873
1874 ElementData ::= CHOICE{
1875   octets      OCTET STRING,
1876   numeric    INTEGER,
1877   date      GeneralizedTime,
1878   ext        EXTERNAL,
1879   string      InternationalString,
1880   trueOrFalse    BOOLEAN,
1881   oid        OBJECT IDENTIFIER,
1882   intUnit          [1]  IMPLICIT IntUnit,
1883    elementNotThere    [2] IMPLICIT NULL,  -- element requested but not there
1884   elementEmpty      [3] IMPLICIT NULL,  -- element there, but empty
1885   noDataRequested    [4] IMPLICIT NULL,  -- variant request said 'no data'
1886   diagnostic        [5] IMPLICIT EXTERNAL,
1887   subtree          [6] SEQUENCE OF TaggedElement -- recursive, for nested tags
1888               }
1889
1890
1891 ElementMetaData ::= SEQUENCE{
1892   seriesOrder        [1]   IMPLICIT Order OPTIONAL, -- only for a non-leaf node
1893   usageRight        [2]   IMPLICIT Usage OPTIONAL,
1894   hits            [3]    IMPLICIT SEQUENCE OF HitVector OPTIONAL,
1895   displayName      [4]    IMPLICIT InternationalString OPTIONAL, 
1896                     -- name for element that origin can use for display
1897   supportedVariants    [5]   IMPLICIT SEQUENCE OF Variant OPTIONAL,
1898   message        [6]    IMPLICIT InternationalString OPTIONAL,
1899   elementDescriptor    [7]   IMPLICIT OCTET STRING OPTIONAL,
1900   surrogateFor      [8]   IMPLICIT TagPath OPTIONAL,  
1901                     -- the retrieved element is a surrogate for the element given by this path  
1902   surrogateElement    [9]   IMPLICIT TagPath OPTIONAL,
1903                     -- the element given by this path is a surrogate for the retrieved element
1904     other          [99]  IMPLICIT EXTERNAL OPTIONAL}
1905
1906         TagPath ::= SEQUENCE  OF SEQUENCE{
1907           tagType      [1]  IMPLICIT INTEGER OPTIONAL,
1908             tagValue      [2]  StringOrNumeric,
1909             tagOccurrence    [3]  IMPLICIT INTEGER OPTIONAL}
1910
1911
1912
1913 Order ::= SEQUENCE{
1914   ascending    [1] IMPLICIT BOOLEAN,
1915               -- "true" means monotonically increasing (i.e. non-decreasing); 
1916               -- "false" means monotonically decreasing (i.e. non-increasing).
1917   order      [2] IMPLICIT INTEGER
1918               -- Same as defined by 'elementOrdering' in tagSet-M, though this may be
1919               -- overridden by schema.
1920           }
1921
1922
1923
1924 Usage ::= SEQUENCE  {
1925   type        [1] IMPLICIT INTEGER{
1926               redistributable    (1),   -- Element is freely redistributable.
1927               restricted      (2),   -- Restriction contains statement.
1928               licensePointer    (3)   -- Restriction contains license pointer.
1929               },
1930   restriction    [2] IMPLICIT InternationalString OPTIONAL}
1931
1932
1933
1934 HitVector ::= SEQUENCE{ 
1935     -- Each hit vector points to a fragment within the element, via location and/or token.
1936   satisfier            Term OPTIONAL, -- sourceword, etc.
1937   offsetIntoElement    [1] IMPLICIT IntUnit OPTIONAL,
1938   length          [2] IMPLICIT IntUnit OPTIONAL,
1939   hitRank          [3] IMPLICIT INTEGER OPTIONAL,
1940   targetToken        [4] IMPLICIT OCTET STRING OPTIONAL
1941                   -- Origin may use token subsequently within a variantRequest (in
1942                   --  an elementRequest) to retrieve (or to refer to) the fragment.  
1943               }
1944
1945
1946
1947
1948 Variant ::= SEQUENCE{
1949     globalVariantSetId    [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL,
1950                   -- Applies to the triples below, when variantSetId omitted. If
1951                   -- globalVariantSetId omitted, default applies. Default may be provided by
1952                   -- the tagSet-M element defaultVariantSetId.
1953
1954
1955
1956
1957   triples          [2]  IMPLICIT SEQUENCE OF SEQUENCE{
1958                   variantSetId  [0]  IMPLICIT OBJECT IDENTIFIER OPTIONAL,
1959                               -- If omitted, globalVariantSetId (above)
1960                               -- applies, unless that too is omitted, in
1961                                -- which case, default used.
1962                   class      [1]  IMPLICIT INTEGER,
1963                   type      [2]  IMPLICIT INTEGER,
1964                   value      [3]  CHOICE{
1965                                integer INTEGER,
1966                                internationalString InternationalString,
1967                                octetString OCTET STRING,
1968                                objectIdentifier OBJECT IDENTIFIER,
1969                                boolean BOOLEAN,
1970                               null NULL,
1971                           -- Following need context tags:
1972                             unit      [1] IMPLICIT Unit, 
1973                             valueAndUnit  [2] IMPLICIT IntUnit}}}
1974 END
1975
1976
1977
1978 RecordSyntax-ESTaskPackage
1979 {Z39-50-recordSyntax ESTaskPackage (106)} DEFINITIONS ::=
1980 BEGIN 
1981 IMPORTS Permissions, InternationalString, IntUnit, DiagRec FROM Z39-50-APDU-1995;
1982
1983 TaskPackage ::= SEQUENCE{
1984   packageType      [1]   IMPLICIT OBJECT IDENTIFIER,
1985                     -- oid of specific ES definition
1986   packageName      [2]   IMPLICIT InternationalString OPTIONAL,
1987   userId          [3]   IMPLICIT InternationalString OPTIONAL,
1988   retentionTime      [4]   IMPLICIT IntUnit OPTIONAL,
1989   permissions        [5]   IMPLICIT Permissions OPTIONAL,
1990   description        [6]   IMPLICIT InternationalString OPTIONAL,
1991   targetReference      [7]   IMPLICIT OCTET STRING OPTIONAL,
1992   creationDateTime    [8]   IMPLICIT GeneralizedTime OPTIONAL,
1993   taskStatus        [9]   IMPLICIT INTEGER{
1994                       pending    (0),
1995                       active    (1),
1996                       complete  (2),
1997                       aborted    (3)},
1998   packageDiagnostics    [10]  IMPLICIT SEQUENCE OF DiagRec OPTIONAL,
1999   taskSpecificParameters  [11]  IMPLICIT EXTERNAL
2000                     -- Use oid for specific ES definition
2001                     -- (same oid as packageType above)
2002                     -- and select [2] "taskPackage."
2003     } 
2004 END
2005
2006
2007
2008
2009 ResourceReport-Format-Resource-1
2010 {Z39-50-resourceReport resource-1 (1)} DEFINITIONS ::=
2011 BEGIN 
2012 IMPORTS InternationalString FROM Z39-50-APDU-1995;  
2013 --
2014 ResourceReport ::= SEQUENCE{
2015 estimates    [1]   IMPLICIT SEQUENCE OF Estimate,
2016 message      [2]   IMPLICIT InternationalString}
2017 --
2018 Estimate ::= SEQUENCE{
2019 type        [1]   IMPLICIT EstimateType,
2020 value        [2]   IMPLICIT INTEGER,  -- the actual estimate
2021 currency-code  [3]   IMPLICIT INTEGER OPTIONAL
2022                 -- code for representation of currencies defined in ISO 4217-1990.  
2023                 -- Applicable only to monetary estimates.
2024                               }
2025 EstimateType ::= INTEGER{
2026 currentSearchRecords    (1),         -- estimated no. records in current (incomplete) result set for search
2027 finalSearchRecords       (2),        -- estimated no. records that will be in result set if search completes
2028 currentPresentRecords    (3),        -- estimated number of records in current (incomplete) set of
2029                       -- records to be returned on Present
2030 finalPresentRecords      (4),  -- estimated number of records that will be in the set of records
2031                       -- to be returned by Present if Present completes
2032 currentOpTimeProcessing  (5),  -- processing time (in .001 CPU seconds) used by operation so far
2033 finalOpTimeProcessing    (6),                -- estimated total processing time (in .001 CPU seconds) that will
2034                               -- be used by this operation if it completes
2035 currentAssocTime      (7),  -- estimated processing time used by association (in .001 CPU sec.)
2036 currentOperationCost      (8),  -- estimated cost for this operation so far
2037 finalOperationCost      (9),  -- estimated cost for this operation if it completes
2038 currentAssocCost        (10),  -- estimated cost for this association so far
2039 finalOpTimeElapsed            (11),  -- estimated elapsed time for operation if it completes (in .001 sec.) 
2040 percentComplete         (12), -- estimated percent complete
2041 currentSearchAssocCost    (13),  -- estimated search cost for association so far
2042 currentPresentAssocCost  (14),  -- estimated present cost for this association so far
2043 currentConnectAssocCost    (15),  -- estimated connect time cost for association so far
2044 currentOtherAssocCost    (16)  -- estimated other cost (not included in 13-15) for association so far
2045                   }
2046 END
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060 ResourceReport-Format-Resource-2
2061 {Z39-50-resourceReport resource-2 (2)} DEFINITIONS ::=
2062 BEGIN 
2063 IMPORTS InternationalString, StringOrNumeric, IntUnit FROM Z39-50-APDU-1995;  
2064 --
2065 ResourceReport ::= SEQUENCE{
2066 estimates    [1]   IMPLICIT SEQUENCE OF Estimate OPTIONAL,
2067 message      [2]   IMPLICIT InternationalString OPTIONAL}
2068 --
2069 Estimate ::= SEQUENCE{
2070 type      [1]   StringOrNumeric,
2071               -- Numeric values of 1-16 are the same as used in Resource-1.
2072 value      [2]   IMPLICIT IntUnit
2073               -- When expressing currency:
2074               --    unitSystem (of Unit) is 'z3950'  (case insensitive)
2075               --    unitType is 'iso4217-1990'       (case insensitive)
2076               --    unit is currency code from ISO 4217-1990.
2077 }
2078 END
2079
2080
2081
2082
2083
2084 AccessControlFormat-prompt-1
2085 {Z39-50-accessControl prompt-1 (1)} DEFINITIONS ::=
2086 BEGIN
2087 IMPORTS InternationalString, DiagRec FROM Z39-50-APDU-1995;
2088 --
2089 PromptObject ::= CHOICE{
2090   challenge      [1] IMPLICIT Challenge,
2091    response        [2] IMPLICIT Response}
2092
2093   Challenge ::= SEQUENCE OF SEQUENCE {
2094     promptId      [1] PromptId,
2095                     -- Target supplies a number (for an enumerated prompt) or string (for a non
2096                     -- -enumerated prompt), for each prompt, and the origin returns it in response, for
2097                     -- this prompt, so target may correlate the prompt response with the prompt.
2098     defaultResponse  [2] IMPLICIT InternationalString OPTIONAL,
2099      promptInfo      [3] CHOICE{ 
2100                     character  [1] IMPLICIT InternationalString,
2101                     encrypted  [2] IMPLICIT Encryption} OPTIONAL,
2102                     -- Information corresponding to an enumerated prompt. For example if 'type', within
2103                     -- PromptId, is 'copyright', then promptInfo may contain a copyright statement.  
2104     regExpr        [4] IMPLICIT InternationalString OPTIONAL,
2105                               -- A regular expression that promptResponse should match. See IEEE 1003.2
2106                     -- Volume 1, Section 2.8 "Regular Expression Notation." For example if promptId
2107                     -- is "Year of publication," regExpr might be "19[89][0-9]|20[0-9][0-9]".
2108     responseRequired  [5] IMPLICIT NULL OPTIONAL,
2109      allowedValues    [6] IMPLICIT SEQUENCE OF InternationalString OPTIONAL,
2110                         -- e.g. promptId="Desired color"; allowed = 'red', 'blue','Green'.
2111     shouldSave      [7] IMPLICIT NULL OPTIONAL,
2112                         -- Target recommends that origin save the data that it prompts from the
2113                      -- user corresponding to this prompt, because it is likely to be requested again (so
2114                     -- origin might not have to prompt the user next time).
2115         dataType        [8] IMPLICIT INTEGER{
2116                              integer        (1),
2117                           date            (2),
2118                         float           (3),
2119                         alphaNumeric  (4),
2120                         url-urn       (5),
2121                         boolean       (6)} OPTIONAL,
2122                         -- Target telling origin type of data it wants. E.g., if "date" is specified,
2123                         -- presumably the origin will try to prompt something "date-like" from the user.
2124         diagnostic       [9] IMPLICIT EXTERNAL OPTIONAL
2125                           -- Intended for repeat requests when there is an error the origin 
2126                         -- should report to the user from previous attempt.
2127                 }
2128
2129
2130   Response ::= SEQUENCE OF SEQUENCE {
2131       promptId    [1] PromptId,
2132                   -- Corresponds to a prompt in the challenge, or may be unprompted, for
2133                   -- example "newPassword." If unprompted, should be "enumerated." 
2134                   -- If this responds to a non-enumerated prompt, then nonEnumeratedPrompt
2135                    -- should contain the prompt string from the challenge.
2136     promptResponse  [2] CHOICE{
2137                     string      [1] IMPLICIT InternationalString,
2138                     accept      [2] IMPLICIT BOOLEAN,
2139                     acknowledge  [3] IMPLICIT NULL,
2140                     diagnostic    [4] DiagRec,
2141                      encrypted    [5] IMPLICIT Encryption}}
2142
2143
2144  PromptId ::= CHOICE{
2145   enummeratedPrompt    [1] IMPLICIT SEQUENCE{
2146                       type            [1] IMPLICIT INTEGER{
2147                                       groupId    (0),
2148                                       userId     (1),
2149                                       password   (2),
2150                                       newPassword  (3),
2151                                       copyright    (4),
2152                             -- When type on Challenge is 'copyright', promptInfo has text of
2153                             -- copyright message to be displayed verbatim to the user. If
2154                             -- promptResponse indicates 'acceptance', this indicates the user has been
2155                             -- shown, and accepted, the terms of the copyright. This is not intended
2156                             -- to be legally binding, but provides a good-faith attempt on
2157                             -- the part of the target to inform the user of the copyright.
2158                                       sessionId      (5)},
2159                       suggestedString    [2] IMPLICIT InternationalString OPTIONAL},
2160    nonEnumeratedPrompt  [2] IMPLICIT InternationalString}
2161
2162
2163  Encryption ::= SEQUENCE{
2164   cryptType    [1] IMPLICIT OCTET STRING OPTIONAL, 
2165   credential    [2] IMPLICIT OCTET STRING OPTIONAL,
2166                     --random number, SALT, or other factor
2167   data        [3] IMPLICIT OCTET STRING}
2168
2169 END
2170
2171
2172
2173
2174 AccessControlFormat-des-1
2175 {Z39-50-accessControlFormat  des-1 (2)} DEFINITIONS ::=
2176 BEGIN
2177     DES-RN-Object ::= CHOICE {
2178       challenge    [1]    IMPLICIT DRNType,
2179       response      [2]    IMPLICIT DRNType}
2180     DRNType ::= SEQUENCE{
2181           userId        [1]    IMPLICIT OCTET STRING OPTIONAL,
2182           salt          [2]    IMPLICIT OCTET STRING OPTIONAL,
2183           randomNumber  [3]    IMPLICIT OCTET STRING}
2184 END
2185
2186
2187 AccessControlFormat-krb-1
2188 {Z39-50-accessControlFormat  krb-1 (3)} DEFINITIONS ::=
2189 BEGIN
2190 IMPORTS InternationalString FROM Z39-50-APDU-1995;
2191
2192      KRBObject ::= CHOICE {
2193        challenge   [1]    IMPLICIT KRBRequest,
2194        response    [2]    IMPLICIT KRBResponse}
2195      KRBRequest ::= SEQUENCE{
2196            service         [1]   IMPLICIT InternationalString,
2197            instance        [2]   IMPLICIT InternationalString OPTIONAL,
2198            realm          [3]   IMPLICIT InternationalString OPTIONAL}
2199         -- target requests a ticket for the given service, instance, and realm
2200      KRBResponse ::= SEQUENCE{
2201            userid            [1]   IMPLICIT InternationalString OPTIONAL,
2202            ticket           [2]  IMPLICIT OCTET STRING}
2203         -- origin responds with a ticket for the requested service
2204 END
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214 ESFormat-PersistentResultSet
2215 {Z39-50-extendedService PersistentResultSet (1)} DEFINITIONS ::=
2216 BEGIN
2217 IMPORTS InternationalString FROM Z39-50-APDU-1995;
2218 PersistentResultSet ::= CHOICE{
2219     esRequest    [1] IMPLICIT SEQUENCE{
2220         toKeep    [1] IMPLICIT NULL,
2221         notToKeep  [2] OriginPartNotToKeep OPTIONAL},
2222     taskPackage  [2] IMPLICIT SEQUENCE{
2223         originPart  [1] IMPLICIT NULL,
2224         targetPart  [2] TargetPart OPTIONAL}}
2225 OriginPartNotToKeep ::= SEQUENCE{
2226   originSuppliedResultSet  [1] IMPLICIT InternationalString OPTIONAL,
2227           -- name of transient result set, supplied on request, mandatory unless function is 'delete'
2228   replaceOrAppend    [2] IMPLICIT INTEGER{  -- only if function is "modify"
2229           replace    (1),
2230           append    (2)} OPTIONAL}
2231 TargetPart ::= SEQUENCE{
2232   targetSuppliedResultSet  [1] IMPLICIT InternationalString OPTIONAL, 
2233           -- Name of transient result set, supplied by target, representing the persistent result set to which
2234           -- package pertains. Meaningful only when package  is presented. (i.e. not on ES response).
2235   numberOfRecords  [2] IMPLICIT INTEGER OPTIONAL}
2236 END
2237
2238
2239 ESFormat-PersistentQuery
2240 {Z39-50-extendedService PersistentQuery (2)} DEFINITIONS ::=
2241 BEGIN
2242 IMPORTS Query, InternationalString, OtherInformation FROM Z39-50-APDU-1995;
2243 PersistentQuery ::= CHOICE{
2244     esRequest      [1] IMPLICIT SEQUENCE{
2245         toKeep    [1] OriginPartToKeep OPTIONAL,
2246         notToKeep  [2] OriginPartNotToKeep},
2247     taskPackage    [2] IMPLICIT SEQUENCE{
2248         originPart  [1] OriginPartToKeep OPTIONAL,
2249         targetPart  [2] TargetPart}}
2250 OriginPartToKeep ::= SEQUENCE{
2251   dbNames        [2] IMPLICIT SEQUENCE OF InternationalString OPTIONAL,
2252   additionalSearchInfo  [3] OtherInformation OPTIONAL}
2253 OriginPartNotToKeep ::= CHOICE{
2254   package    [1] IMPLICIT InternationalString,
2255   query    [2] Query}
2256 TargetPart ::= Query          
2257 END
2258
2259 ESFormat-PeriodicQuerySchedule
2260 {Z39-50-extendedService PeriodicQuerySchedule (3)} DEFINITIONS ::=
2261 BEGIN
2262 IMPORTS Query, InternationalString, IntUnit FROM Z39-50-APDU-1995 
2263 ExportSpecification, Destination FROM ESFormat-ExportSpecification;
2264
2265 PeriodicQuerySchedule ::= CHOICE{
2266     esRequest    [1] IMPLICIT SEQUENCE{
2267               toKeep    [1] OriginPartToKeep,
2268               notToKeep  [2] OriginPartNotToKeep},
2269     taskPackage    [2] IMPLICIT SEQUENCE{
2270               originPart  [1] OriginPartToKeep,
2271               targetPart  [2] TargetPart}}
2272
2273 OriginPartToKeep ::=SEQUENCE{
2274   activeFlag          [1] IMPLICIT BOOLEAN,
2275   databaseNames        [2] IMPLICIT SEQUENCE OF InternationalString OPTIONAL,
2276   resultSetDisposition      [3] IMPLICIT INTEGER{
2277                     replace    (1),
2278                     append    (2),
2279                     createNew  (3)  -- Only if origin and target have agreement about
2280                             -- naming convention for the resulting package,
2281                              -- and only if no result set is specified.
2282                 } OPTIONAL,   -- Mandatory on 'create' if result set is specified, in
2283                         -- which case it must be 'replace' or 'append.
2284   alertDestination        [4] Destination OPTIONAL,
2285   exportParameters      [5] CHOICE{
2286                     packageName  [1]   IMPLICIT InternationalString,
2287                     exportPackage  [2] ExportSpecification} OPTIONAL}
2288
2289 OriginPartNotToKeep ::= SEQUENCE{
2290   querySpec           [1] CHOICE{
2291                     actualQuery    [1] Query,
2292                     packageName  [2] IMPLICIT InternationalString} OPTIONAL,
2293                   -- mandatory for 'create'
2294   originSuggestedPeriod    [2] Period OPTIONAL,  -- mandatory for 'create'
2295   expiration          [3] IMPLICIT GeneralizedTime OPTIONAL,
2296   resultSetPackage        [4] IMPLICIT InternationalString OPTIONAL}
2297
2298 TargetPart ::= SEQUENCE{
2299   actualQuery        [1] Query,
2300   targetStatedPeriod    [2] Period,
2301                   -- Target supplies the period, which may be same as origin proposed.
2302   expiration        [3] IMPLICIT GeneralizedTime OPTIONAL,
2303                   -- Target supplies value for task package. It may be the same as origin
2304                   -- proposed or different from (and overrides) origin proposal, but if
2305                   -- omitted, there is no expiration.
2306   resultSetPackage      [4] IMPLICIT InternationalString OPTIONAL,
2307                   -- May be omitted only if exportParameters was supplied. Target
2308                   -- supplies same name as origin supplied, if origin did supply a name.
2309   lastQueryTime      [5] IMPLICIT GeneralizedTime,
2310   lastResultNumber    [6] IMPLICIT INTEGER,
2311   numberSinceModify    [7] IMPLICIT INTEGER OPTIONAL}
2312
2313
2314
2315
2316   Period ::= CHOICE{
2317                 unit             [1] IMPLICIT IntUnit,
2318                  businessDaily     [2] IMPLICIT NULL,
2319               continuous       [3] IMPLICIT NULL,
2320               other         [4] IMPLICIT InternationalString}
2321 END
2322
2323
2324 ESFormat-ItemOrder
2325 {Z39-50-extendedService ItemOrder (4)} DEFINITIONS ::=
2326 BEGIN
2327 IMPORTS InternationalString FROM Z39-50-APDU-1995;
2328 ItemOrder ::= CHOICE{
2329     esRequest  [1] IMPLICIT SEQUENCE{
2330               toKeep    [1] OriginPartToKeep OPTIONAL,
2331               notToKeep  [2] OriginPartNotToKeep},
2332     taskPackage  [2] IMPLICIT SEQUENCE{
2333               originPart  [1] OriginPartToKeep OPTIONAL,
2334               targetPart  [2] TargetPart}}
2335 OriginPartToKeep ::= SEQUENCE{
2336   supplDescription    [1] IMPLICIT EXTERNAL OPTIONAL,
2337   contact        [2] IMPLICIT SEQUENCE{
2338                        name  [1]   IMPLICIT InternationalString OPTIONAL,
2339                          phone  [2]   IMPLICIT InternationalString OPTIONAL,
2340                        email  [3]   IMPLICIT InternationalString OPTIONAL} OPTIONAL,
2341   addlBilling      [3] IMPLICIT SEQUENCE{
2342                 paymentMethod    [1]   CHOICE{
2343                                   billInvoice              [0] IMPLICIT NULL,
2344                                     prepay                [1] IMPLICIT NULL,
2345                                     depositAccount        [2] IMPLICIT NULL,
2346                                     creditCard          [3] IMPLICIT CreditCardInfo,
2347                     cardInfoPreviouslySupplied  [4] IMPLICIT NULL,
2348                     privateKnown        [5] IMPLICIT NULL,
2349                     privateNotKnown      [6] IMPLICIT EXTERNAL},
2350                 customerReference  [2] IMPLICIT InternationalString OPTIONAL,
2351                      customerPONumber  [3] IMPLICIT InternationalString OPTIONAL}
2352                                  OPTIONAL}
2353 CreditCardInfo   ::= SEQUENCE{
2354        nameOnCard    [1] IMPLICIT InternationalString,
2355       expirationDate    [2] IMPLICIT InternationalString,
2356     cardNumber      [3] IMPLICIT InternationalString} 
2357
2358 OriginPartNotToKeep ::= SEQUENCE{ -- Corresponds to 'requestedItem' in service definition.
2359       --  Must supply at least one, and may supply both.
2360   resultSetItem    [1]   IMPLICIT SEQUENCE{  
2361                 resultSetId    [1]   IMPLICIT InternationalString,
2362                     item      [2]   IMPLICIT INTEGER} OPTIONAL,
2363   itemRequest      [2] IMPLICIT EXTERNAL OPTIONAL
2364                 -- When itemRequest is an ILL-Request APDU, 
2365                 -- use OID {iso standard 10161 abstract-syntax (2) ill-apdus (1)}
2366               }
2367
2368 TargetPart ::= SEQUENCE{
2369   itemRequest      [1]  IMPLICIT EXTERNAL OPTIONAL,
2370     -- When itemRequest is an ILL-Request APDU, use OID 1.0.10161.2.1 (as above)
2371   statusOrErrorReport  [2] IMPLICIT EXTERNAL OPTIONAL,
2372     -- When statusOrErrorReport is an ILL Status-Or-Error-Report APDU, use OID  1.0.10161.2.1 (as above)
2373   auxiliaryStatus    [3]  IMPLICIT INTEGER{
2374                 notReceived      (1),
2375                 loanQueue      (2),
2376                 forwarded      (3),
2377                 unfilledCopyright  (4),
2378                 filledCopyright    (5)} OPTIONAL}
2379 END
2380
2381
2382
2383
2384 ESFormat-Update0
2385 {Z39-50-extendedService Update (5)} DEFINITIONS ::=
2386 BEGIN
2387 IMPORTS DiagRec, InternationalString FROM Z39-50-APDU-1995; 
2388 Update ::= CHOICE{
2389     esRequest  [1] IMPLICIT SEQUENCE{
2390               toKeep    [1] OriginPartToKeep,
2391               notToKeep  [2] OriginPartNotToKeep},
2392     taskPackage  [2] IMPLICIT SEQUENCE{
2393               originPart  [1] OriginPartToKeep,
2394               targetPart  [2] TargetPart}}
2395
2396
2397 OriginPartToKeep ::= SEQUENCE{
2398   action          [1] IMPLICIT INTEGER{
2399                    recordInsert    (1),
2400                    recordReplace  (2),
2401                   recordDelete  (3),
2402                   elementUpdate  (4)},
2403   databaseName      [2] IMPLICIT InternationalString,
2404   schema          [3] IMPLICIT OBJECT IDENTIFIER OPTIONAL,
2405   elementSetName      [4] IMPLICIT InternationalString OPTIONAL}
2406
2407
2408 OriginPartNotToKeep ::= SuppliedRecords
2409
2410
2411 TargetPart ::= SEQUENCE{
2412   updateStatus    [1] IMPLICIT INTEGER{
2413                   success  (1),
2414                   partial  (2),
2415                   failure  (3)},
2416   globalDiagnostics  [2] IMPLICIT SEQUENCE OF DiagRec OPTIONAL,
2417                 -- These are non-surrogate diagnostics relating to the task, 
2418                 -- not to individual records.
2419   taskPackageRecords  [3] IMPLICIT SEQUENCE OF TaskPackageRecordStructure
2420                 -- There should be a TaskPackageRecordStructure for every record
2421                 -- supplied. The target should create such a structure for every
2422                       -- record immediately upon creating the task package to include
2423                 -- correlation information and status. The record itself would not
2424                 -- be included until processing for that record is complete.
2425             }
2426
2427 -- Auxiliary definitions for Update
2428 SuppliedRecords ::= SEQUENCE OF SEQUENCE{
2429   recordId    [1] CHOICE{
2430               number  [1] IMPLICIT INTEGER,
2431               string  [2] IMPLICIT InternationalString,
2432               opaque  [3]  IMPLICIT OCTET STRING} OPTIONAL,
2433   supplementalId  [2] CHOICE{
2434               timeStamp    [1] IMPLICIT GeneralizedTime,
2435               versionNumber  [2] IMPLICIT InternationalString,
2436               previousVersion  [3] IMPLICIT EXTERNAL} OPTIONAL,
2437   correlationInfo  [3] IMPLICIT CorrelationInfo OPTIONAL,
2438   record      [4] IMPLICIT EXTERNAL}
2439
2440 CorrelationInfo ::= SEQUENCE{
2441           -- origin may supply one or both for any record:
2442   note  [1] IMPLICIT InternationalString OPTIONAL,
2443   id    [2] IMPLICIT INTEGER OPTIONAL}
2444
2445 TaskPackageRecordStructure ::= SEQUENCE{
2446     recordOrSurDiag  [1] CHOICE {
2447                 record    [1] IMPLICIT EXTERNAL,
2448                         -- Choose 'record' if recordStatus is 'success', and
2449                         -- elementSetName was supplied.
2450                 diagnostic  [2] DiagRec
2451                         -- Choose 'diagnostic', if RecordStatus is failure.
2452                                 } OPTIONAL,
2453                 -- The parameter recordOrSurDiag will thus be omitted only if
2454                 -- 'elementSetName' was omitted and recordStatus is
2455                 -- 'success'; or if record status is 'queued' or in 'process'.
2456     correlationInfo    [2] IMPLICIT CorrelationInfo OPTIONAL,
2457                 -- This should be included if it was supplied by the origin.
2458     recordStatus      [3] IMPLICIT INTEGER{
2459                   success    (1),
2460                   queued    (2),
2461                   inProcess  (3),
2462                   failure    (4)}}
2463 END
2464
2465
2466 ESFormat-ExportSpecification
2467 {Z39-50-extendedService ExportSpecification (6)} DEFINITIONS ::=
2468 BEGIN
2469 EXPORTS ExportSpecification, Destination; IMPORTS CompSpec, InternationalString FROM Z39-50-APDU-1995;
2470 ExportSpecification ::= CHOICE{
2471     esRequest    [1] IMPLICIT SEQUENCE{
2472         toKeep    [1] OriginPartToKeep,
2473         notToKeep  [2] IMPLICIT NULL},
2474     taskPackage    [2] IMPLICIT SEQUENCE{
2475         originPart  [1] OriginPartToKeep,
2476         targetPart  [2] IMPLICIT NULL}}
2477 OriginPartToKeep ::= SEQUENCE{
2478   composition        [1] IMPLICIT CompSpec,
2479   exportDestination    [2] Destination}
2480
2481   Destination ::= CHOICE{
2482   phoneNumber    [1]    IMPLICIT InternationalString,
2483   faxNumber      [2]   IMPLICIT InternationalString,
2484   x400address      [3]   IMPLICIT InternationalString,
2485   emailAddress    [4]   IMPLICIT InternationalString,
2486   pagerNumber    [5]   IMPLICIT InternationalString,
2487   ftpAddress      [6]   IMPLICIT InternationalString,
2488   ftamAddress    [7]   IMPLICIT InternationalString,
2489   printerAddress    [8]   IMPLICIT InternationalString,
2490   other        [100]  IMPLICIT SEQUENCE{
2491                   vehicle      [1]  IMPLICIT InternationalString  OPTIONAL,
2492                   destination    [2] IMPLICIT InternationalString}}
2493 END
2494
2495
2496
2497
2498 ESFormat-ExportInvocation
2499 {Z39-50-extendedService ExportInvocation (7)} DEFINITIONS ::=
2500 BEGIN
2501 IMPORTS InternationalString, IntUnit FROM Z39-50-APDU-1995 
2502 ExportSpecification FROM ESFormat-ExportSpecification;
2503 ExportInvocation ::= CHOICE{
2504     esRequest    [1] IMPLICIT SEQUENCE{
2505         toKeep    [1] OriginPartToKeep,
2506         notToKeep  [2] OriginPartNotToKeep},
2507     taskPackage    [2] IMPLICIT SEQUENCE{
2508         originPart  [1] OriginPartToKeep,
2509         targetPart  [2] TargetPart OPTIONAL}}
2510
2511 OriginPartToKeep ::= SEQUENCE{
2512   exportSpec    [1] CHOICE{
2513               packageName    [1] IMPLICIT InternationalString,
2514               packageSpec    [2] ExportSpecification},
2515   numberOfCopies  [2] IMPLICIT INTEGER}
2516
2517
2518
2519
2520
2521 OriginPartNotToKeep  ::= SEQUENCE{
2522   resultSetId      [1] IMPLICIT InternationalString,
2523   records        [2] CHOICE{
2524                 all    [1] IMPLICIT NULL,
2525                 ranges  [2]   IMPLICIT SEQUENCE OF SEQUENCE{
2526                         start  [1] IMPLICIT INTEGER,
2527                         count  [2] IMPLICIT INTEGER OPTIONAL
2528                           -- Count may be omitted only on last range, to indicate
2529                           -- "all remaining records beginning with 'start'."
2530                     }}}
2531
2532 TargetPart   ::= SEQUENCE{
2533     estimatedQuantity    [1] IMPLICIT IntUnit OPTIONAL,
2534     quantitySoFar      [2] IMPLICIT IntUnit OPTIONAL,
2535     estimatedCost      [3] IMPLICIT IntUnit OPTIONAL,
2536     costSoFar        [4] IMPLICIT IntUnit OPTIONAL}
2537 END
2538
2539
2540
2541 UserInfoFormat-searchResult-1
2542 {Z39-50-userInfoFormat searchResult-1 (1)} DEFINITIONS ::=
2543 BEGIN
2544 IMPORTS DatabaseName, Term, Query, IntUnit, InternationalString FROM Z39-50-APDU-1995;
2545 SearchInfoReport ::= SEQUENCE OF SEQUENCE{
2546   subqueryId      [1] IMPLICIT InternationalString OPTIONAL, 
2547                            -- shorthand identifier of subquery
2548   fullQuery        [2] IMPLICIT BOOLEAN,     -- 'true' means this is the full query; 'false',
2549                           -- a sub-query 
2550   subqueryExpression    [3] QueryExpression OPTIONAL,  -- A subquery of the query as
2551                           -- submitted. May be whole query;
2552                           -- if so, "fullQuery" should be 'true'.
2553   subqueryInterpretation  [4] QueryExpression OPTIONAL,  -- how target interpreted subquery
2554   subqueryRecommendation  [5] QueryExpression OPTIONAL,  -- target-recommended alternative
2555   subqueryCount      [6] IMPLICIT INTEGER OPTIONAL,  -- Number of records for this
2556                           -- subQuery, across all of the specified
2557                           -- databases. (If during search, via resource
2558                            -- control, number of records so far).
2559   subqueryWeight     [7] IMPLICIT IntUnit OPTIONAL,  -- relative weight of this subquery
2560   resultsByDB          [8] IMPLICIT ResultsByDB OPTIONAL}
2561
2562 ResultsByDB ::= SEQUENCE OF SEQUENCE{
2563   databases      [1] CHOICE{
2564             all     [1] IMPLICIT NULL,
2565                   -- applies across all of the databases in Search PDU
2566             list    [2]  IMPLICIT SEQUENCE OF DatabaseName
2567                   -- applies across all databases in this list
2568               },
2569   count        [2] IMPLICIT INTEGER OPTIONAL,
2570             -- Number of records for query component (and, as above, if during search,
2571              -- via resource control, number of records so far).
2572   resultSetName    [3] IMPLICIT InternationalString OPTIONAL
2573                         -- Target-assigned result set by which subQuery is available. Should not
2574              -- be provided unless processing for this query component is concluded (i.e.,
2575             -- when this report comes during search, via resource control, as opposed
2576             -- to after search, via additionalSearchInfo).
2577               }
2578
2579 QueryExpression ::=  CHOICE {
2580                 term   [1] IMPLICIT SEQUENCE{
2581               queryTerm  [1]  Term,
2582               termComment            [2] IMPLICIT InternationalString OPTIONAL},
2583            query  [2] Query}
2584 END
2585
2586
2587
2588 ElementSpecificationFormat-eSpec-1
2589 {Z39-50-elementSpec eSpec-1 (1)} DEFINITIONS ::=
2590 BEGIN
2591 IMPORTS Variant FROM RecordSyntax-generic
2592 StringOrNumeric, InternationalString FROM Z39-50-APDU-1995;
2593 --
2594 Espec-1 ::= SEQUENCE{
2595   elementSetNames    [1] IMPLICIT SEQUENCE OF InternationalString OPTIONAL,
2596                   -- Origin may include one or more element set names, each
2597                   -- specifying a set of elements. Each of the elements is to be
2598                   -- treated as an elementRequest in the form of simpleElement,
2599                   -- where occurrence is 1. 
2600   defaultVariantSetId    [2] IMPLICIT OBJECT IDENTIFIER OPTIONAL,
2601                   -- If supplied, applies whenever variantRequest 
2602                   -- does not include variantSetId. 
2603   defaultVariantRequest  [3] IMPLICIT Variant OPTIONAL,
2604                   -- If supplied, then for each simple elementRequest that does not
2605                    -- include a variantRequest, the defaultVariantRequest applies.
2606                   -- (defaultVariantRequest does not apply to a compositeRequest.)
2607   defaultTagType      [4] IMPLICIT INTEGER OPTIONAL,
2608                   -- If supplied, applies whenever 'tagType' (within 'tag' within TagPath) 
2609                   -- is omitted.
2610   elements        [5] IMPLICIT SEQUENCE OF ElementRequest OPTIONAL}
2611 --
2612
2613 ElementRequest::= CHOICE{
2614   simpleElement    [1]   IMPLICIT SimpleElement,
2615   compositeElement  [2] IMPLICIT SEQUENCE{
2616             elementList    [1] CHOICE{
2617                   primitives    [1]   IMPLICIT SEQUENCE OF InternationalString,
2618                               -- Origin may specify one or more element
2619                               -- set names, each identifying a set of elements,
2620                               -- and the composite element is the union.
2621                   specs      [2] IMPLICIT SEQUENCE OF SimpleElement},
2622
2623             deliveryTag    [2] IMPLICIT TagPath,
2624                           -- DeliveryTag tagPath for compositeElement may not
2625                           -- include wildThing or wildPath.
2626             variantRequest  [3] IMPLICIT Variant OPTIONAL}}
2627
2628 SimpleElement ::= SEQUENCE{
2629       path        [1] IMPLICIT TagPath,
2630       variantRequest  [2] IMPLICIT Variant OPTIONAL}
2631   
2632
2633 TagPath ::= SEQUENCE OF CHOICE{  
2634   specificTag  [1] IMPLICIT SEQUENCE{
2635             tagType  [1] IMPLICIT INTEGER OPTIONAL,
2636                       -- If omitted, then 'defaultTagType' (above) applies, if supplied, and
2637                       -- if not supplied, then default listed in schema applies.
2638             tagValue  [2] StringOrNumeric,
2639              occurrence  [3] Occurrences OPTIONAL 
2640                       -- default is "first occurrence"
2641                   },
2642   wildThing  [2] Occurrences,
2643               -- Get Nth "thing" at this level, regardless of tag, for each N specified by
2644             -- "Occurrences" (which may be 'all' meaning match every element at this level).
2645             -- E.g., if "Occurrences" is 3, get third element regardless of its tag or the tag of
2646             -- the first two elements.
2647   wildPath  [3] IMPLICIT NULL
2648               -- Match any tag, at this level or below, that is on a path for which next tag in this 
2649               -- TagPath sequence occurs. WildPath may not be last member of the TagPath
2650             -- sequence.
2651                       }
2652 --
2653
2654 Occurrences ::= CHOICE{
2655   all    [1] IMPLICIT NULL,
2656   last    [2] IMPLICIT NULL,
2657   values  [3] IMPLICIT SEQUENCE{
2658           start    [1] IMPLICIT INTEGER,
2659                   -- if 'start' alone is included, then single occurrence is requested
2660           howMany  [2] IMPLICIT INTEGER OPTIONAL
2661                   -- For example, if 'start' is 5 and 'howMany' is 6, then request is for
2662                   -- "occurrences 5 through 10."
2663                   }}
2664 END
2665