OP-TED / ted-rdf-mapping-eforms

TED-RDF Mapping Suites for eForms Notices
European Union Public License 1.2
1 stars 0 forks source link

Allow capturing of datatype violations in modified SHACL that suppresses them #20

Closed schivmeister closed 5 months ago

schivmeister commented 5 months 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 ]
    ) .

Originally posted by @cristianvasquez in https://github.com/OP-TED/ted-rdf-mapping-eforms/issues/14#issuecomment-2141782782

cristianvasquez commented 5 months ago

To enhance reuse and shrink the graph given to the engine, one can define a custom Node, for example:

a4g_shape:PlainLiteral a sh:NodeShape ;
    sh:or (
        [ sh:datatype xsd:string ]
        [ sh:datatype rdf:langString ]
    ) .

Then, a given property can then reference it through:

sh:node a4g_shape:PlainLiteral
schivmeister commented 5 months ago

We implemented a one-line version of the original proposal and as seen in the official SHACL shapes for the SHACL specs.