View Source


- Susana data includes dates in these forms: yyyy, yyyy-mm, yyyy-mm-dd.
- [xsd:date 3.2.9.1 Lexical representation|http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#date] says xsd:date must be{code} '-'? yyyy '-' mm '-' dd {code}
meaning an optional minus sign (for dates BC), and mandatory yyyy-mm-dd.
- So when dd or mm-dd are missing, we have to use xsd:gYearMonth vs xsd:gYear. Examples:
{code} "1686-12-10"^^xsd:date, "1686-12"^^xsd:gYearMonth, "1686"^^xsd:gYear {code}
- SPARQL 1.1 extended the built-in functions and operators according to XPath/XQuery. Although these include Date comparisons and other operators over gYear and gYearMonth, SPARQL still only includes DateTime comparisons.
- OWLIM only supports the SPARQL requirements (and specific DateTime indexing is on-going work), so OWLIM cannot compare mixed (complete vs incomplete) dates
- (RS3.2) We must add "fake" mm&dd to incomplete dates and write xsd:date. Applies to properties:
{code}crm:P82_at_some_time_within, crm:P82a_begin_of_the_begin, crm:P82b_end_of_the_end{code}
-- if xsd:gYear: complete P82 to mid-year (06-30); P82a to beg-year (01-01); P82b to end-year (12-31).
-- if xsd:gYearMonth: complete P82 to mid-month (15); P82a to beg-month (01); P82b to end-month (28 so as not to bite the dust with Feb).
- Saving the "fake completions" in the above fields is a bad idea, since we DONT want to print the fake dates.
If we printed "Susanna was created on 1686-*06-15*": we'd be laughed upon and asked *how* did we know.
- So we need to save the fake completions in extra "indexing fields":
{code}crm:P82_as_date, crm:P82a_as_date, crm:P82b_as_date{code}
-- or if we want to be perverse, we can use multiple values in the same field, and filter by datatype
- Complications:
-- Need to do it not only on migration, but also on saving new/edited dates
-- If a Time-Span could have several properties P82_at_some_time_within (can't think how, but when people start annotating...), then we need to correlate each specific value with the corresponding derived value P82a_as_date

See:
- {jira:RS-78}
- {jira:OWLIM-680}