Open KateSerafimova opened 8 months ago
To discuss:
@rcelebi could you explore if partially defined date and full date can be compared in the datetime format, thanks
After a bit of investigation, I figured out that this Date structure might not be needed. I could write the SHACL rule below with xsd:dateTime format. Even though the dates are partially defined (e.g. only year), we can compare between these dates. Also, the xsd:dateTime format allows dates to be defined differently and partially, such as YYYY, YYYY-MM, YYYY-MM-DD or YYYY-MM-DDThh:mm:ss+zz:zz.
SHACL for the constraint "If the patient has an admit date, this should be after date of birth."
@prefix sp: <http://spinrdf.org/sp#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix ex: <http://example.com/> .
@prefix sphn: <https://biomedit.ch/rdf/sphn-ontology/sphn#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
ex:AdministrativeCaseShape
a sh:NodeShape ;
sh:targetClass sphn:AdministrativeCase ;
sh:property [
sh:path ( [ sh:inversePath sphn:hasAdministrativeCase ] sphn:hasBirtDate );
sh:lessThan sphn:hasDischargeDateTime;
];
sh:property [
sh:path sphn:hasDischargeDateTime;
sh:datatype xsd:dateTime ;
]
.
Example RDF:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sphn: <https://biomedit.ch/rdf/sphn-ontology/sphn#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix snomedct: <http://purl.bioontology.org/ontology/SNOMEDCT/> .
@prefix ex: <http://example.com/> .
ex:patient1 a sphn:Patient ;
sphn:hasIdentifier "1"^^xsd:string ;
sphn:hasBirtDate "2018-02"^^xsd:dateTime;
sphn:hasAdministrativeCase <ex:aministrativecase/1> .
<ex:aministrativecase/1> a sphn:AdministrativeCase ;
sphn:hasDischargeDateTime "2017-02-01"^^xsd:dateTime .
In the SPHN schema there are many properties for DateTime, such as:
However, many times in the data the DateTime is not available and there is just the date, or even just part of the date, like the year.
The suggestion is to add a concepts aidava:Date and have it relate to all the concepts, that have a date component with the property aidava:hasDate. The class aidava:Date will be the domain of the following properties:
Also, sphn:BirthDate will be deprecated and replaced with the aidava:Date.