DCAT-AP icon indicating copy to clipboard operation
DCAT-AP copied to clipboard

Proposal to use IRI nodes for properties in SHACL shapes instead of blank nodes

Open EmidioStani opened this issue 7 years ago • 7 comments

With the purpose to reuse the SHACL shapes, it would nice the properties restrictions are written as IRI instead of blank nodes, so then reusers might disable certain shapes in case they don't fit in their application profile.

E.g. dcat:Distribution rdf:type sh:NodeShape ; sh:property dcat:accessURLShape ;

dcat:accessURLShape rdf:type sh:PropertyShape ; sh:path dcat:accessURL ; sh:class rdfs:Resource ; sh:minCount 1 ; sh:severity sh:Violation .

such shape requires that the access url should be explicitly indicated a rdfs:Resource whereas most of the time just a URL would be enough.

Using it as IRI could deactivate the shape for their need:

dcat:accessURLShape sh:deactivated true .

EmidioStani avatar Oct 24 '18 09:10 EmidioStani

Thank you for the suggestion. Proposal to discuss this in the next major release cycle.

addragan avatar Nov 08 '18 10:11 addragan

Proposed resolution: Replace properties restriction written as blank nodes with IRI.

addragan avatar Jul 23 '19 12:07 addragan

resolution: will be for the future to see what is the best organisation of the SHACL file. To be considered in the chosen approach is the creation of local variants reusing part of the SHACL templates. Currently reuse at the level of class is possible. And the usage of controlled vocabularies is in a separated file.

bertvannuffelen avatar Nov 15 '19 01:11 bertvannuffelen

I created a pull request which does the requested change for the shacl_shapes.ttl file: https://github.com/SEMICeu/DCAT-AP/pull/224#issue-1188137491

init-dcat-ap-de avatar Mar 31 '22 14:03 init-dcat-ap-de

Current validation message: grafik

Validation message with named property shape: grafik This message already helps more, because the user can identify shape that is throwing the error. The shape name includes the type of class that was the target for the shape.

In this example I added

:Agent_Property_foaf_name
    sh:message "Ein foaf:Agent MUSS über einen foaf:name verfügen!" @de .

in an additional file: grafik

init-dcat-ap-de avatar Mar 31 '22 14:03 init-dcat-ap-de

An additional wish we have would be to split the shapes further into atomar tests, so

:Agent_Property_foaf_name
    sh:minCount 1 ;
    sh:nodeKind sh:Literal ;
    sh:path foaf:name ;
    sh:severity sh:Violation .

becomes:

:Agent_Property_exists_foaf_name
    sh:minCount 1 ;
    sh:path foaf:name ;
    sh:severity sh:Violation .

:Agent_Property_literal_foaf_name
    sh:nodeKind sh:Literal ;
    sh:path foaf:name ;
    sh:severity sh:Violation .

This would allow us to give more specific error messages an reuse the shapes even moren.

init-dcat-ap-de avatar Apr 21 '22 12:04 init-dcat-ap-de

Add a reference to a complete list of generated shacl rules: https://semiceu.github.io/uri.semic.eu-generated/DCAT-AP/releases/3.0.0/#validation-of-dcat-ap.

bertvannuffelen avatar Feb 05 '24 13:02 bertvannuffelen