#169: Introduce classes sh:ShapesGraph and sh:DataGraph#814
#169: Introduce classes sh:ShapesGraph and sh:DataGraph#814HolgerKnublauch wants to merge 6 commits intogh-pagesfrom
Conversation
There was a problem hiding this comment.
Just slight wording changes to make the class definitions read as per their semantics - specialised forms of ontology. The real work is done by the definitions in the written spec of "data graph" and "shapes graph".
I've also edited the definition of "shapes graph" so that it's not conditional on it being passed into a validation process - "may be" not "is" - as we will potentially see shapes graphs defined that are not (only) used for validation, e.g. UI generation.
Co-authored-by: Nicholas Car <[email protected]>
Co-authored-by: Nicholas Car <[email protected]>
I think the typically is important, because a ShapesGraph may also serve as data graph against shacl-shacl etc, but people wouldn't change their triples just to do that.
There was a problem hiding this comment.
A few remarks on trying to subclass owl:Ontology:
OWL 2 DL does not permit encoding x rdfs:subClassOf owl:Ontology .. I don't understand the full motivation from back then, but the precise statement fiatting "no" is in OWL 2 Syntax, Section 5.1:
IRIs from the reserved vocabulary other than owl:Thing and owl:Nothing MUST NOT be used to identify classes in an OWL 2 DL ontology.
owl:Ontology is in the reserved vocabulary - see Table 3 in Section 2.4.
(CORRECTION, found by @mgberg below - owl:Ontology is not in that table, but my understanding is it does have reservations that prevent it from being subclassed.)
So, from the OWL perspective, if SHACL Core's graph included the axiom sh:ShapesGraph rdfs:subClassOf owl:Ontology ., then SHACL Core's graph would bump any OWL ontology importing it into OWL Full. I haven't checked lately, but so far I don't think SHACL Core has issues that outright violate OWL 2 DL rules (an aside: rdfs:domain and rdfs:range can reference owl:Ontology), so this risks being the first statement that prevents SHACL Core from being imported into a big graph that tries to maintain OWL 2 DL conformance.
I think the above is unlikely to cause concern for those who use both OWL and SHACL together, since SHACL's definition graph is likely to be treated like OWL's definition graph. I forget where this is recorded, but I've seen in the OWL docs that OWL's definition graph can't be imported into an OWL ontology without bumping the ontology to OWL Full.
We could maintain the spirit of sh:DataGraph and sh:ShapesGraph being sibling classe of OWL Ontology by encoding in SHACL-SHACL rules like this, IRI(s) TBD:
shsh:OntologySpecializationShape
a sh:NodeShape ;
sh:class owl:Ontology .
sh:targetClass sh:DataGraph , sh:ShapesGraph ;
.Then, the range of sh:shapesGraph and the like could read:
sh:entailment
rdfs:domain owl:Ontology, sh:ShapesGraph ;
.
sh:shapesGraph
rdfs:range owl:Ontology, sh:ShapesGraph ;
.
sh:suggestedShapesGraph
rdfs:range owl:Ontology, sh:ShapesGraph ;
.
I don't see |
Thank you for catching that. I had seen an OWL 2 validator flag each of these as outside OWL 2 DL: owl:Ontology
a owl:Class ;
.
ex:O
rdfs:subClassOf owl:Ontology ;
.
ex:OP-1
a owl:ObjectProperty ; # AnnotationProperty is fine.
rdfs:domain owl:Ontology ;
rdfs:range owl:Ontology ;
.Unfortunately, that validator does not link to specific parts of the OWL specification describing why. (I think my institution's rules would frown on me naming the tool in this instance - apologies for those who wish to reproduce for themselves.) I had known them before, but cannot recall them at the moment, and I'm about to be in meetings for a good chunk of the day. So, my references above are not correct, for which I apologize. I do believe the end effect is true, though, in that subclassing |
|
@ajnelson-nist I don't think shsh:OntologySpecializationShape implements what you would want. It basically says that any instance of sh:ShapesGraph MUST also be an instance of owl:Ontology. So it acts as a constraint check, while rdfs:subClassOf would act as an inference. Enforcing this constraint would either require all ShapesGraph instances to be double-typed with owl:Ontology, or the system ontology imported that adds the subClassOf triple. In general, I am highly doubtful that many SHACL graphs fall under OWL DL anyway. I have lost track if OWL DL is even still relevant. My impression is that the majority of OWL implementations are just OWL RL, which ignores any triples on which an OWL DL engine would block. |
That actually IS what I intended. I'd written my above remarks concerned with subclassing The OWL-RDF mapping document, Section 3.1.1, prescribes specifically how to interpret Hence, this might be a problematic statement for users following this sequence:
# ExampleDataGraph-37.ttl
<http://example.org/ExampleDataGraph-37>
a owl:Ontology ;
owl:imports <http://example.org/ExampleOntologyGraph> .
.
sh:DataGraph
rdfs:subClassOf owl:Ontology ;
.
# ExampleDataGraph-37.ttl
<http://example.org/ExampleDataGraph-37>
a sh:DataGraph ;
owl:imports <http://example.org/ExampleOntologyGraph> .
.
I should note, I don't know how common this behavior would be. But, by any strict implementation of the OWL-RDF parsing algorithm, this would be an unexpected failure from the user's perspective. This is why I suggested that shape-form above. I agree that I do realize an implementation issue with the way I spelled the shape. It should do a direct interrogation for an
Oh, is ignoring the behavior you're seeing? My understanding was OWL RL being more restrictive than DL would mean engines would be suggested to halt more often; but, I haven't experienced a wide variety of RL implementations. (This is an aside, we don't need to dig into it here.) |
|
@ajnelson-nist with apologies in advance but I am not an expert of the details of OWL DL parsing algorithms. Nor am I up to date on how many OWL RL tools will reject graphs that use features that go beyond OWL RL. If this whole topic is causing such complications, I'd rather not touch it and maybe someone else can take ownership of this ticket. |
Closes #169