linkml / linkml

Linked Open Data Modeling Language
https://linkml.io/linkml
Other
312 stars 98 forks source link

linkml:Time and xsd:dateTime #1786

Open ddooley opened 9 months ago

ddooley commented 9 months ago

Describe the bug Basically the linkml:Time type is given a URI of xsd:dateTime rather than xsd:time . I understand by the note on the type (below) that this is behaviour by design - but does LinkML really want to engineer this conversion just because of OWL syntax limitations? It doesn't do this conversion for linkml:Date !!!

"time": {
  "name": "time",
  "description": "A time object represents a (local) time of day, independent of any particular day",
  "notes": [
    "URI is dateTime because OWL reasoners do not work with straight date or time"
  ],
  "from_schema": "https://example.com/CanCOGeN_Covid-19",
  "exact_mappings": [
    "schema:Time"
  ],
  "base": "XSDTime",
  "uri": "xsd:dateTime",
  "repr": "str"
},

The problem for the DataHarmonizer app is we have applications where it is appropriate to have a local time input on a field without any date control. Via LinkML API, manipulations having time=dateTime datatype forces the DH calendar to be shown as well as time inputter, and forces validation of dateTime.

A purer solution would be to have clients convert time into datetime only when exporting data to RDF format?

If LinkML:time = xsd:dateTime is ensconsed in LinkML, DH could do a workaround by adding a custom time type, say "local_time", which ensures uri: xsd:time. Let me know if that is the preferred route for the foreseeable future.

Thx,

pkalita-lbl commented 9 months ago

Is is possible that's being generated by an older version of LinkML? In the 1.6.0 metamodel the URI of the time type is xsd:time: https://raw.githubusercontent.com/linkml/linkml-model/v1.6.0/linkml_model/model/schema/types.yaml

cmungall commented 8 months ago

https://github.com/linkml/linkml-model/pull/146