OP-TED / ted-rdf-mapping-eforms

European Union Public License 1.2
2 stars 0 forks source link

hasMinimumNumberOfCandidates value should be integer #14

Closed cristianvasquez closed 4 weeks ago

cristianvasquez commented 1 month ago

Model 4.0.0 declares integer

found at sample

Note the difference between:

  epo:hasMaximumNumberOfCandidates 3;
  epo:hasMinimumNumberOfCandidates "3";

One is string and the other is a number

cristianvasquez commented 1 month 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 ]
    ) .
schivmeister commented 1 month 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 ]
    ) .

@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.

cristianvasquez commented 1 month ago

Hi @schivmeister I don't have a script, but it should be easy to implement with search and replace using grep, in the shell.