FAIRDataTeam / FAIRDataPoint

https://www.fairdatapoint.org
MIT License
59 stars 37 forks source link

DASH DatePickerEditor: sh:datatype should be xsd:date, but in FDP only sh:dateTime is accepted #504

Open 66Noah2018 opened 7 months ago

66Noah2018 commented 7 months ago

What components are related to the issue?

Metadata Schemas

Which FDP are you using?

My local instance

Version

Server
Version v1.16.1~a1adf7b
Built at    16. 1. 2023, 19:56
Client
Version v1.16.2~0fffee6
Built at    16. 1. 2023, 21:41

What happened?

When using the DASH DatePickerEditor, the sh:datatype should be xsd:date (see https://datashapes.org/forms.html#DatePickerEditor). But if this is specified as such in a metadata schema, you will get a datatype constraint error when adding a new record based on this schema. This is resolved by using sh:dateTime instead, but this is not correct according to DASH. In code:

:ClinicalTrialShape a sh:NodeShape;
    sh:targetClass :ClinicalTrial;
    sh:property [
        sh:path :startDate;
        sh:name "Study Start Date";
        sh:order 10;
        sh:minCount 1;
        sh:maxCount 1;
        sh:datatype xsd:dateTime;
        dash:editor dash:DatePickerEditor;
        dash:viewer dash:LiteralViewer;
    ]

It works but is invalid according to DASH

It should be:

:ClinicalTrialShape a sh:NodeShape;
    sh:targetClass :ClinicalTrial;
    sh:property [
        sh:path :startDate;
        sh:name "Study Start Date";
        sh:order 10;
        sh:minCount 1;
        sh:maxCount 1;
        sh:datatype xsd:date;
        dash:editor dash:DatePickerEditor;
        dash:viewer dash:LiteralViewer;
    ]

valid, but throws the aforementioned error

Relevant log output

No response

dennisvang commented 1 month ago

Not sure if this is directly related, but #355 also describes a problem with sh:dateTime.