Skip to content

Commit 0425f2a

Browse files
committed
introduce starttime and endtime
1 parent a31350e commit 0425f2a

File tree

1 file changed

+90
-51
lines changed

1 file changed

+90
-51
lines changed

paia.md

Lines changed: 90 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ For instance the following response could result from a request with malformed U
327327
~~~~
328328

329329

330-
## Data types
330+
## Simple data types
331331

332332
The following data types are used to define request and response format:
333333

@@ -340,13 +340,26 @@ boolean
340340
default but unknown!
341341
date
342342
: A date value in `YYYY-MM-DD` format.
343+
datetime
344+
: A date value with mandatory timezone and optional time. The format is
345+
`YYYY-MM-DD`, optionally followed by `hh:mm:ss`, mandatorily followed by
346+
either `Z` for UTC or `+hh:mm` or `-hh:mm` for another timezone, where:
347+
348+
* YYYY indicates a year
349+
* MM indicates a month
350+
* DD indicates a day
351+
* hh indicates an hour
352+
* mm indicates a minute
353+
* ss indicates a second
354+
343355
money
344356
: A monetary value with currency (format `[0-9]+\.[0-9][0-9] [A-Z][A-Z][A-Z]`),
345357
for instance `0.80 USD`.
346358
email
347359
: A syntactically correct email address.
348360
URI
349361
: A syntactically correct URI.
362+
350363
account state
351364
: A nonnegative integer representing the current state of a patron account.
352365
Possible values are:
@@ -359,6 +372,7 @@ account state
359372

360373
A PAIA server MAY define additional states which can be mapped to `1` by PAIA
361374
clients. In JSON account states MUST be encoded as numbers instead of strings.
375+
362376
service status
363377
: A nonnegative integer representing the current status in fulfillment of a
364378
service. In most cases the service is related to a document, so the service
@@ -367,60 +381,78 @@ service status
367381

368382
0. no relation (this applies to most combinations of document and patron, and
369383
it can be expected if no other state is given)
370-
1. reserved (the document is not accessible for the user yet, but it will be)
371-
2. ordered (the document is being made accessible for the user)
384+
1. reserved (the document is not accessible for the patron yet, but it will be)
385+
2. ordered (the document is being made accessible for the patron)
372386
3. held (the document is on loan by the patron)
373387
4. provided (the document is ready to be used by the patron)
374388
5. rejected
375389

376390
A PAIA server MUST NOT define any other service status. In JSON service status
377391
MUST be encoded as numbers instead of strings.
378392

379-
document
380-
: A key-value structure with the following fields
381-
382-
name occ data type description
383-
----------- ------ --------------------- ----------------------------------------------------------
384-
status 1..1 service status status (0, 1, 2, 3, 4, or 5)
385-
item 0..1 URI URI of a particular copy
386-
edition 0..1 URI URI of a the document (no particular copy)
387-
requested 0..1 URI URI that was originally requested
388-
about 0..1 string textual description of the document
389-
label 0..1 string call number, shelf mark or similar item label
390-
queue 0..1 nonnegative integer number of waiting requests for the document or item
391-
renewals 0..1 nonnegative integer number of times the document has been renewed
392-
reminder 0..1 nonnegative integer number of times the patron has been reminded
393-
duedate 0..1 date date of expiry of the service status (most times loan)
394-
cancancel 0..1 boolean whether an ordered or provided document can be canceled
395-
canrenew 0..1 boolean whether a document can be renewed
396-
error 0..1 string error message, for instance if a request was rejected
397-
storage 0..1 string location of the document
398-
storageid 0..1 URI location URI
399-
----------- ------ --------------------- ----------------------------------------------------------
400-
401-
402-
For each document at least an item URI or an edition URI MUST be given.
403-
Together, item and edition URI MUST uniquely identify a document within
404-
the set of documents related to a patron.
405-
406-
The response fields `label`, `storage`, `storageid`, and `queue`
407-
correspond to properties in DAIA.
408-
409-
An example of a document (with status 5=rejected) serialized in JSON is
410-
given below. In this case an arbitrary copy of a selected document was
411-
requested and mapped to a particular copy that turned out to be not accessible:
393+
## Document data type
394+
395+
A **document** is a key-value structure with the following fields
396+
397+
name occ data type description
398+
----------- ------ --------------------- ----------------------------------------------------------
399+
status 1..1 service status status (0, 1, 2, 3, 4, or 5)
400+
item 0..1 URI URI of a particular copy
401+
edition 0..1 URI URI of a the document (no particular copy)
402+
requested 0..1 URI URI that was originally requested
403+
about 0..1 string textual description of the document
404+
label 0..1 string call number, shelf mark or similar item label
405+
queue 0..1 nonnegative integer number of waiting requests for the document or item
406+
renewals 0..1 nonnegative integer number of times the document has been renewed
407+
reminder 0..1 nonnegative integer number of times the patron has been reminded
408+
starttime 0..1 datetime date and time when the status began
409+
endtime 0..1 datetime date and time when the status will expire
410+
duedate 0..1 date date when the current status will expire (*deprecated*)
411+
cancancel 0..1 boolean whether an ordered or provided document can be canceled
412+
canrenew 0..1 boolean whether a document can be renewed
413+
error 0..1 string error message, for instance if a request was rejected
414+
storage 0..1 string location of the document
415+
storageid 0..1 URI location URI
416+
----------- ------ --------------------- ----------------------------------------------------------
417+
418+
419+
For each document at least an item URI or an edition URI MUST be given.
420+
Together, item and edition URI MUST uniquely identify a document within
421+
the set of documents related to a patron.
422+
423+
The fields `starttime` and `endtime` MUST be interpreted as following:
424+
425+
status starttime endtime
426+
-------- -------------------------------- --------------------------------------------------------
427+
0 - -
428+
1 when the document was reserved when the reserved document is expected to be available
429+
2 when the document was ordered when the ordered document is expected to be available
430+
3 when the document was lend when the loan period ends or ended (due)
431+
4 when the document is provided when the provision will expire
432+
5 when the request was rejected -
433+
434+
Note that timezone information is mandatory in these fields. The field
435+
`duedate` is deprecated. Clients SHOULD only use it as `endtime` if no
436+
`endtime` was given.
437+
438+
The response fields `label`, `storage`, `storageid`, and `queue`
439+
correspond to properties in DAIA.
440+
441+
An example of a document (with status 5=rejected) serialized in JSON is
442+
given below. In this case an arbitrary copy of a selected document was
443+
requested and mapped to a particular copy that turned out to be not accessible:
412444

413-
~~~~ {.json}
414-
{
415-
"status": 5,
416-
"item": "http://example.org/items/barcode1234567",
417-
"edition": "http://example.org/documents/9876543",
418-
"requested": "http://example.org/documents/9876543",
419-
"error": "sorry, we found out that our copy is lost!"
420-
}
421-
~~~~
445+
~~~~ {.json}
446+
{
447+
"status": 5,
448+
"item": "http://example.org/items/barcode1234567",
449+
"edition": "http://example.org/documents/9876543",
450+
"requested": "http://example.org/documents/9876543",
451+
"error": "sorry, we found out that our copy is lost!"
452+
}
453+
~~~~
422454

423-
See [documents in RDF] for a mapping in RDF.
455+
See [documents in RDF] for a mapping in RDF.
424456

425457
# PAIA core
426458

@@ -912,11 +944,11 @@ paia:OutstandingFees a rdfs:Resource ;
912944

913945
[documents in RDF]: #documents-in-rdf
914946

915-
Lists of documents, as returned by the PAIA core methods [items], [request],
916-
[renew], and [cancel], are represented as sets of events. Each event is an
917-
instance of **[ssso:ServiceEvent]** from the [Simple Service Status Ontology]
918-
(SSSO) and an instance of of a specific document service class defined in the
919-
[Document Service Ontology] (DSO).
947+
Lists of [documents](#document-data-type), as returned by the PAIA core methods
948+
[items], [request], [renew], and [cancel], are represented as sets of events.
949+
Each event is an instance of **[ssso:ServiceEvent]** from the [Simple Service
950+
Status Ontology] (SSSO) and an instance of of a specific document service class
951+
defined in the [Document Service Ontology] (DSO).
920952

921953
The current [service status](#data-types) of a document service event is given
922954
by an instance-relationship (rdf:type) with one of the following classes:
@@ -956,6 +988,13 @@ The service event is connected to a patron as [service:ServiceConsumer]
956988
(with property [service:consumedBy]) and to a document
957989
(*with a property yet to be defined*).
958990

991+
The `starttime` end `endtime` can be mapped to any of the following properties,
992+
among others:
993+
994+
starttime
995+
: schema:startDate, prov:prov:startedAtTime, prov:qualifiedStart
996+
endtime
997+
: schema:endDate, prov:endedAtTime, prov:qualifiedEnd
959998

960999
[ssso:ServiceEvent]: http://purl.org/ontology/ssso#ServiceEvent
9611000
[dso:Loan]: http://purl.org/ontology/dso#Loan

0 commit comments

Comments
 (0)