Skip to content

Commit

Permalink
Revise sequence-application shapes to target predicates' subjects
Browse files Browse the repository at this point in the history
This causes `ValidationResult`s to yield sufficient information to find
the whole triple that should have used a sequence.  With the prior
spelling, only the object of the triple would have been directly
identified; the predicate could be manually deduced from the shape name;
and the subject was completely absent from the validation result.

The noted comment on PR 572 illustrates the difference in results when
testing CASE-Corpora.  The issue is replicated as new PASS and XFAIL
test members.

A follow-on patch will regenerate Make-managed files.

References:
* #571
* #572 (comment)

Signed-off-by: Alex Nelson <[email protected]>
  • Loading branch information
ajnelson-nist committed Dec 5, 2023
1 parent 8aa83e6 commit fc27342
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 30 deletions.
100 changes: 70 additions & 30 deletions ontology/owl/owl.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,34 @@ uco-owl:Sequence-shape
) ;
.

uco-owl:disjointUnionOf-objects-shape
uco-owl:disjointUnionOf-subjects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:disjointUnionOf ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:disjointUnionOf ;
] ;
sh:targetSubjectsOf owl:disjointUnionOf ;
.

uco-owl:distinctMembers-objects-shape
uco-owl:distinctMembers-subjects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:distinctMembers ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:distinctMembers ;
] ;
sh:targetSubjectsOf owl:distinctMembers ;
.

uco-owl:hasKey-objects-shape
uco-owl:hasKey-subjects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:hasKey ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:hasKey ;
] ;
sh:targetSubjectsOf owl:hasKey ;
.

uco-owl:incompatibleWith-direct-import-shape
Expand Down Expand Up @@ -331,28 +343,44 @@ uco-owl:incompatibleWith-imported-version-iri-shape
sh:targetObjectsOf owl:incompatibleWith ;
.

uco-owl:intersectionOf-objects-shape
uco-owl:intersectionOf-subjects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:intersectionOf ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:intersectionOf ;
] ;
sh:targetSubjectsOf owl:intersectionOf ;
.

uco-owl:members-objects-shape
uco-owl:members-subjects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:members ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:members ;
] ;
sh:targetSubjectsOf owl:members ;
.

uco-owl:onProperties-objects-shape
uco-owl:onProperties-subjects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:onProperties ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:onProperties ;
] ;
sh:targetSubjectsOf owl:onProperties ;
.

uco-owl:oneOf-objects-shape
uco-owl:oneOf-subjects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:oneOf ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:oneOf ;
] ;
sh:targetSubjectsOf owl:oneOf ;
.

uco-owl:ontologyIRI-versionIRI-prerequisite-shape
Expand All @@ -363,10 +391,14 @@ uco-owl:ontologyIRI-versionIRI-prerequisite-shape
sh:targetSubjectsOf owl:versionIRI ;
.

uco-owl:propertyChainAxiom-objects-shape
uco-owl:propertyChainAxiom-subjects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:propertyChainAxiom ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:propertyChainAxiom ;
] ;
sh:targetSubjectsOf owl:propertyChainAxiom ;
.

uco-owl:rdf-first-subjects-shape
Expand Down Expand Up @@ -403,10 +435,14 @@ uco-owl:rdf-rest-subjects-shape
sh:targetSubjectsOf rdf:rest ;
.

uco-owl:unionOf-objects-shape
uco-owl:unionOf-subjects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:unionOf ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:unionOf ;
] ;
sh:targetSubjectsOf owl:unionOf ;
.

uco-owl:versionIRI-multiversion-shape
Expand All @@ -426,9 +462,13 @@ uco-owl:versionIRI-nodeKind-shape
sh:targetSubjectsOf owl:versionIRI ;
.

uco-owl:withRestrictions-objects-shape
uco-owl:withRestrictions-subjects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:withRestrictions ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:withRestrictions ;
] ;
sh:targetSubjectsOf owl:withRestrictions ;
.

24 changes: 24 additions & 0 deletions tests/examples/rdf_list_PASS.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,30 @@
"@id": "ex:hasParent",
"@type": "owl:ObjectProperty"
},
{
"@id": "ex:Person",
"@type": "owl:Class",
"rdfs:comment": "NOTE: This example is excerpted from the OWL 2 Primer only for syntactic reference.",
"rdfs:isDefinedBy": {
"@id": "https://www.w3.org/TR/2012/REC-owl2-primer-20121211/#Keys"
},
"owl:hasKey": {
"rdf:first": {
"@id": "ex:hasSSN"
},
"rdf:rest": {
"@id": "rdf:nil"
}
}
},
{
"@id": "ex:hasSSN",
"@type": "owl:DatatypeProperty",
"rdfs:comment": "NOTE: This example is excerpted from the OWL 2 Primer only for syntactic reference.",
"rdfs:isDefinedBy": {
"@id": "https://www.w3.org/TR/2012/REC-owl2-primer-20121211/#Keys"
}
},
{
"@id": "dash:DateOrDateTime",
"@type": "rdf:List",
Expand Down
13 changes: 13 additions & 0 deletions tests/examples/rdf_list_XFAIL.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"@context": {
"ex": "http://example.org/ontology/",
"kb": "http://example.org/kb/",
"owl": "http://www.w3.org/2002/07/owl#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
Expand Down Expand Up @@ -65,6 +66,18 @@
}
}
}
},
{
"@id": "ex:someDatatypeProperty",
"@type": "owl:DatatypeProperty"
},
{
"@id": "ex:IncorrectlyKeyedThing",
"@type": "owl:Class",
"rdfs:comment": "This will trigger a violation error. owl:hasKey has OWL Sequences as its range.",
"owl:hasKey": {
"@id": "ex:someDatatypeProperty"
}
}
]
}

0 comments on commit fc27342

Please sign in to comment.