RE: Profiling of SHACL ontologies

Hi!

SHACL currently allows a data graph to link to respective shapes graphs via sh:shapesGraph https://www.w3.org/TR/shacl/#sh-shapes-graph:

3.3 Linking to shapes graphs (sh:shapesGraph)
A data graph<https://www.w3.org/TR/shacl/#dfn-data-graph> can include triples used to suggest one or more graphs to a SHACL processor with the predicate sh:shapesGraph. Every value<https://www.w3.org/TR/shacl/#dfn-value> of sh:shapesGraph is an IRI<https://www.w3.org/TR/shacl/#dfn-iri> representing a graph that SHOULD be included into the shapes graph<https://www.w3.org/TR/shacl/#dfn-shapes-graph> used to validate the data graph<https://www.w3.org/TR/shacl/#dfn-data-graph>.
In the following example, a SHACL processor SHOULD use the union of ex:graph-shapes1 and ex:graph-shapes2 graphs (and their owl:imports) as the shapes graph<https://www.w3.org/TR/shacl/#dfn-shapes-graph> when validating the given graph.
<http://example.com/myDataGraph>
       sh:shapesGraph ex:graph-shapes1 ;
       sh:shapesGraph ex:graph-shapes2 .

AFAIK, there is currently no way to reference individual SHACL shapes directly.

Alternatively, one could import Collection A into Collection B in its entirety, but then deactivate e.g. Shape 3 using sh:deactivated true https://www.w3.org/TR/shacl/#deactivated:

                2.1.6 Deactivating a Shape
Shapes can have at most one value for the property sh:deactivated. The value of sh:deactivated in a shape must be either true or false.
A shape that has the value<https://www.w3.org/TR/shacl/#dfn-value> true for the property sh:deactivated is called deactivated. All RDF terms conform<https://www.w3.org/TR/shacl/#dfn-conforms> to a deactivated shape.



Cheers, simon

From: Nicholas Car <nick@kurrawong.ai>
Sent: Tuesday, 19 November 2024 03:03
To: Public Shacl W3C <public-shacl@w3.org>
Subject: Profiling of SHACL ontologies

Dear SHACL CG,

One of the deliverables of the proposed "Data Shapes WG" [1] is a "SHACL 1.2 Profiling" specification. The intention is to "define methods for using SHACL to create formal profiles of (RDF) standards" and, by extension, define how bundles of SHACL Shapes can import / depend on / reuse other SHACL Shapes.

Even before this WG starts, if it does, I need to create SHACL Shape collections that pick and choose Shapes from other collections. I would like community input here to both get my job done and to start working up towards an implementation of this deliverable.

You can see wholescale importation in the ABIS specification [2] but not selective importation.

What methods / modelling patterns have you used to import Shapes 1, 2 and 4, but not 3 from Shapes Collection A into Collection B?

If this area is of really great interest to you, please consider joining the WG too.

Thanks, Nick


[1] https://w3c.github.io/shacl/charter-1.2/shacl-wg.html#deliverables
[2] https://github.com/AusBIGG/abis/blob/master/validators/abis.ttl#L26-L55

Received on Tuesday, 19 November 2024 05:30:02 UTC