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