Open tobiasschweizer opened 2 years ago
Looking at https://www.w3.org/TR/xmlschema-2/#date, I think an xsd:date
should be a single date with day precision. Otherwise, gYear
or gYearMonth
could be used.
Since you're using schema.org, you can use schema:temporalCoverage to represent date ranges.
From the schema:temporalCoverage docs:
The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012").
You can save it as a string instead of xsd:date
to avoid RDFLib performing any conversions. Saving schema:temporalCoverage values as strings is valid, according to the docs.
@edmondchuc Thanks a lot for your reply.
We're actually also using schema:temporalCoverage
on schema:CreativeWork
but I think it has a different meaning than schema:dateCreated
. If you take the example of a radio broadcast, schema:dateCreated
refers to the date when the broadcast itself was created etc. but there could still be a schema:temporalCoverage
indicating the time of the broadcast's contents, e.g., a radio show about ancient history.
However, in terms of RDF I just want to make sure that my understanding is correct that an xsd:date
is a single date with day precision. That would also explain the implementation of STRDT
in rdflib
.
@tobiasschweizer I totally agree with you that schema:temporalCoverage
and schema:dateCreated
are different.
I just never imagined the value for schema:dateCreated
would be a range. Why is it a range? Was it initially created in 1964 and then later updated in 1966? If so, the updated date should captured with schema:dateModified
, but I'm just making assumptions.
In any case, I think we've gone off topic from the original issue, sorry about that.
Looking at https://www.w3.org/TR/xmlschema-2/#date, I think an xsd:date should be a single date with day precision.
I think this is the case, yes.
Hi there
I am using rdflib to convert RDF data from one ontology to another using SPAQRL CONSTRUCT queries. In general, it works well :-)
I encountered a problem with dates that are encoded as strings in the source data.
source data data.json (RiCO: https://www.ica.org/standards/RiC/RiC-O_v0-2.html):
conversion:
result (schema.org)
The date range string "1964/1966" (https://www.ica.org/standards/RiC/RiC-O_v0-2.html#normalizedDateValue) is converted to an
xsd:date
"1964-01-01".I had a look at STRDT and if I got it right,
isoformat
is used and performs some conversion.Looking at
isoformat
(datetime.py) two sources are mentioned:https://www.w3.org/TR/NOTE-datetime says:
Whereas ISO 8601 supports time intervals, the note says that only a part of ISO 8601 is actually supported.
Would it be correct to a have an
xsd:date
"1964/1966" in RDF? And if so, should rdflib's STRDT rather not convert "1964/1966" to "1964-01-01"?