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