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