Skip to content

Instantly share code, notes, and snippets.

@bdarcus
Last active July 6, 2020 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdarcus/62ca8d92bfe5b410b2f9b808e541ce9b to your computer and use it in GitHub Desktop.
Save bdarcus/62ca8d92bfe5b410b2f9b808e541ce9b to your computer and use it in GitHub Desktop.
An Object Representation of an EDTF Date
{
"title": "CSL EDTF Date Definitions",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "CSL supports EDTF levels 0 and 1.",
"definitions": {
"date-object": {
"title": "Date Object",
"description": "An EDTF date represented as an object.",
"date-parts": {
"type": "array",
"items": [
{
"type": "integer",
"description": "year",
"pattern": "[0-9]{4}"
},
{
"type": "integer",
"description": "month or season FIX",
"pattern": "[1,2]{1,2}"
},
{
"type": "integer",
"description": "day",
"pattern": "([1-9]|[12][0-9]|3[01])"
}
],
"minItems": 1,
"maxItems": 3
},
"literal": {
"title": "Literal date",
"description": "A date that should be passed through to the processor as is; for dates that cannot be represented in EDTF.",
"examples": ["Han Dynasty"],
"type": "string"
},
"approximate": {
"title": "Approximate",
"description": "Indicates an approximate or circa date, which may be presented as `circa May 23, 1972`.",
"type": "boolean"
},
"uncertain": {
"title": "Uncertain",
"description": "Indicates uncertainty about a date representation, which may be presented as `May 23, 1972?`",
"type": "boolean"
}
},
"required": ["date-parts"]
},
"date-range": {
"title": "Date Range",
"description": "An open end or begin of the range can be represented with a null.",
"type": "array",
"items": {
"$ref": "#definitions/date-object"
},
"minItems": 2,
"maxItems": 2
},
"edtf-string": {
"title": "EDTF string",
"description": "Dates represented as an EDTF string.",
"examples": ["2014-21/2014-22","1936-03-25~"],
"type": "string",
"pattern": "^[0-9-%~X?.\/]{4,}$"
},
}
@bdarcus
Copy link
Author

bdarcus commented Jul 5, 2020

TODO:

  1. Open ends needs to be settled
  2. regex patterns on the values
  3. literal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment