Closed cristianvasquez closed 4 weeks ago
To avoid these one can tweak occurrences of PlainLiteral in the SHACL like this:
core-shape:org-Organization-epo-hasLegalFormType a sh:PropertyShape ;
rdfs:isDefinedBy core-shape:core-shape ;
#sh:datatype rdf:PlainLiteral ;
sh:description "The classification of an Organisation according to legislation. Additional Information: Generally, this is defined for Tenderers who want to submit as an Organisation Group. Note that the codelist provided at national level should be used." ;
sh:maxCount 1 ;
sh:name "Has legal form type" ;
sh:path :hasLegalFormType .
To
core-shape:org-Organization-epo-hasLegalFormType a sh:PropertyShape ;
rdfs:isDefinedBy core-shape:core-shape ;
sh:description "The classification of an Organisation according to legislation. Additional Information: Generally, this is defined for Tenderers who want to submit as an Organisation Group. Note that the codelist provided at national level should be used." ;
sh:maxCount 1 ;
sh:name "Has legal form type" ;
sh:path :hasLegalFormType ;
sh:or (
[ sh:datatype xsd:string ]
[ sh:datatype rdf:langString ]
) .
To avoid these one can tweak occurrences of PlainLiteral in the SHACL like this:
core-shape:org-Organization-epo-hasLegalFormType a sh:PropertyShape ; rdfs:isDefinedBy core-shape:core-shape ; #sh:datatype rdf:PlainLiteral ; sh:description "The classification of an Organisation according to legislation. Additional Information: Generally, this is defined for Tenderers who want to submit as an Organisation Group. Note that the codelist provided at national level should be used." ; sh:maxCount 1 ; sh:name "Has legal form type" ; sh:path :hasLegalFormType .
To
core-shape:org-Organization-epo-hasLegalFormType a sh:PropertyShape ; rdfs:isDefinedBy core-shape:core-shape ; sh:description "The classification of an Organisation according to legislation. Additional Information: Generally, this is defined for Tenderers who want to submit as an Organisation Group. Note that the codelist provided at national level should be used." ; sh:maxCount 1 ; sh:name "Has legal form type" ; sh:path :hasLegalFormType ; sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) .
@cristianvasquez thanks for this suggestion! The original topic of this ticket, though, is a separate issue (it is indeed a wrong datatype mapping). I understand that the way the SHACL is modified now (no datatype restriction), this issue is not captured by SHACL, and that's indeed a problem.
Do you have an automated version of your suggestion? This is because, while this is nice and there are also alternatives to deal with validating both plain and language-tagged strings, we cannot manually apply many changes like this as these shapes are produced by model2owl. We should also file a ticket upstream about such inconveniences.
Hi @schivmeister I don't have a script, but it should be easy to implement with search and replace using grep, in the shell.
Model 4.0.0 declares integer
found at sample
Note the difference between:
One is string and the other is a number