diff --git a/ontology/owl/owl.ttl b/ontology/owl/owl.ttl index 1d25a71..4b4a042 100644 --- a/ontology/owl/owl.ttl +++ b/ontology/owl/owl.ttl @@ -182,6 +182,7 @@ uco-owl:List-shape a sh:Shape ; rdfs:comment "This shape's functionality has been exported"@en ; rdfs:seeAlso + uco-owl:Sequence-shape , uco-owl:rdf-first-subjects-shape , uco-owl:rdf-rest-subjects-shape ; @@ -277,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 @@ -330,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 @@ -362,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 @@ -402,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 @@ -425,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 ; . diff --git a/tests/examples/rdf_list_PASS.json b/tests/examples/rdf_list_PASS.json index fbc7d69..7462e25 100644 --- a/tests/examples/rdf_list_PASS.json +++ b/tests/examples/rdf_list_PASS.json @@ -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", diff --git a/tests/examples/rdf_list_XFAIL.json b/tests/examples/rdf_list_XFAIL.json index 4a17bbc..9e188cf 100644 --- a/tests/examples/rdf_list_XFAIL.json +++ b/tests/examples/rdf_list_XFAIL.json @@ -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#", @@ -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" + } } ] } diff --git a/tests/examples/rdf_list_XFAIL_validation.ttl b/tests/examples/rdf_list_XFAIL_validation.ttl index 7730bd9..65ab509 100644 --- a/tests/examples/rdf_list_XFAIL_validation.ttl +++ b/tests/examples/rdf_list_XFAIL_validation.ttl @@ -20,13 +20,44 @@ sh:sourceShape uco-owl:Sequence-shape ; sh:value ; ] ; - sh:focusNode ; + sh:focusNode [ + a owl:AllDifferent ; + owl:distinctMembers ; + ] ; sh:resultMessage "Value does not conform to Shape uco-owl:Sequence-shape. See details for more information." ; + sh:resultPath owl:distinctMembers ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:NodeConstraintComponent ; - sh:sourceShape uco-owl:distinctMembers-objects-shape ; + sh:sourceShape [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:distinctMembers ; + ] ; sh:value ; ] , + [ + a sh:ValidationResult ; + sh:detail [ + a sh:ValidationResult ; + sh:focusNode ; + sh:resultMessage 'Node ex:someDatatypeProperty does not conform to exactly one shape in [ rdf:type sh:NodeShape ; sh:hasValue rdf:nil ] , [ rdf:type sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:property [ rdf:type sh:PropertyShape ; sh:path [ sh:oneOrMorePath rdf:rest ] ; sh:xone ( [ rdf:type sh:NodeShape ; sh:hasValue rdf:nil ] [ rdf:type sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:property [ rdf:type sh:PropertyShape ; sh:maxCount Literal("1", datatype=xsd:integer) ; sh:minCount Literal("1", datatype=xsd:integer) ; sh:path rdf:first ] ] ) ] ]' ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:XoneConstraintComponent ; + sh:sourceShape uco-owl:Sequence-shape ; + sh:value ; + ] ; + sh:focusNode ; + sh:resultMessage "Value does not conform to Shape uco-owl:Sequence-shape. See details for more information." ; + sh:resultPath owl:hasKey ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeConstraintComponent ; + sh:sourceShape [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:hasKey ; + ] ; + sh:value ; + ] , [ a sh:ValidationResult ; sh:detail [ @@ -44,14 +75,22 @@ ) ; ] ; - sh:focusNode ( - - - ) ; + sh:focusNode [ + a owl:AllDifferent ; + owl:distinctMembers ( + + + ) ; + ] ; sh:resultMessage "Value does not conform to Shape uco-owl:Sequence-shape. See details for more information." ; + sh:resultPath owl:distinctMembers ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:NodeConstraintComponent ; - sh:sourceShape uco-owl:distinctMembers-objects-shape ; + sh:sourceShape [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:distinctMembers ; + ] ; sh:value (