diff --git a/.github/ISSUE_TEMPLATE/change-request.md b/.github/ISSUE_TEMPLATE/change-request.md index 2ca6a15a..e7121302 100644 --- a/.github/ISSUE_TEMPLATE/change-request.md +++ b/.github/ISSUE_TEMPLATE/change-request.md @@ -96,4 +96,6 @@ Some requirements are narrow enough they could be considered "Self-documenting." > Requirement 1 also fully describes the solution, implemented in [PR X](https://github.com/ucoProject/UCO/pull/X). If there is an accompanying pull request, please do link it under the "Development" box on the right of the Issues page. + +If example snippets of instance data are provided, please note if you provide permission for the examples to be transcribed to one of the tested example repositories (such as CASE-Examples). This is a significant aid in confirming examples represent the semantics that the submitter intended. "I am fine with my examples being transcribed and credited" should be sufficient. --> diff --git a/ontology/co/co.ttl b/ontology/co/co.ttl index 97b18776..e8bff8dc 100644 --- a/ontology/co/co.ttl +++ b/ontology/co/co.ttl @@ -12,10 +12,10 @@ a owl:Ontology ; rdfs:label "uco-co"@en ; rdfs:comment "This ontology defines SHACL shapes to supplement the OWL 2 DL definitions in the Collections Ontology."@en ; - owl:backwardCompatibleWith uco-co:1.1.0 ; + owl:backwardCompatibleWith uco-co:1.2.0 ; owl:imports ; - owl:priorVersion uco-co:1.1.0 ; - owl:versionIRI uco-co:1.2.0 ; + owl:priorVersion uco-co:1.2.0 ; + owl:versionIRI uco-co:1.3.0 ; . co:ListItem diff --git a/ontology/owl/owl.ttl b/ontology/owl/owl.ttl index dd464601..ced847dd 100644 --- a/ontology/owl/owl.ttl +++ b/ontology/owl/owl.ttl @@ -10,9 +10,9 @@ rdfs:label "uco-owl"@en ; rdfs:comment "This ontology defines SHACL shapes to perform conformance testing of OWL 2 DL. Some of these shapes follow rules specified from the canonical, subtractive parsing process of Section 3 of the OWL 2 mapping to RDF. From the last line of that document's Section 3, 'At the end of this process, the graph G MUST be empty,' anything not strictly matching patterns specified in that section cause the input graph to be non-conformant with OWL 2 DL."@en ; rdfs:seeAlso ; - owl:backwardCompatibleWith uco-owl:1.1.0 ; - owl:priorVersion uco-owl:1.1.0 ; - owl:versionIRI uco-owl:1.2.0 ; + owl:backwardCompatibleWith uco-owl:1.2.0 ; + owl:priorVersion uco-owl:1.2.0 ; + owl:versionIRI uco-owl:1.3.0 ; . uco-owl:Axiom-shape @@ -179,25 +179,14 @@ uco-owl:Disjointedness-DP-OP-shape . uco-owl:List-shape - a sh:NodeShape ; - sh:property [ - a sh:PropertyShape ; - sh:maxCount "1"^^xsd:integer ; - sh:path rdf:first ; - ] ; - sh:sparql [ - a sh:SPARQLConstraint ; - rdfs:comment "This requirement is determined from review of the canonical parsing process in Section 3 of the OWL 2 mapping to RDF. Table 5 removes any triple matching the pattern 'x a rdf:List`. All other references throughout Section 3 to rdf:first are identified as blank nodes. Therefore, any non-blank node that is an rdf:List will not be mapped and consumed by the mapping process, making the graph non-conformant with OWL 2 DL."@en ; - rdfs:seeAlso ; - sh:message "The subject of a triple with rdf:first as predicate must be a blank node."@en ; - sh:select """ - SELECT $this - WHERE { - FILTER isIRI($this) - } - """ ; - ] ; - sh:targetSubjectsOf rdf:first ; + 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 + ; + sh:deactivated "true"^^xsd:boolean ; . uco-owl:ObjectProperty-shacl-constraints-shape @@ -250,6 +239,75 @@ uco-owl:ObjectProperty-shacl-constraints-shape sh:targetClass owl:ObjectProperty ; . +uco-owl:Sequence-shape + a sh:NodeShape ; + rdfs:comment "This shape intentionally has no target declaration. It is instead intended to be incorporated using 'sh:node'."@en ; + rdfs:seeAlso ; + sh:description "This shape is determined from review of the canonical parsing process in Section 3 of the OWL 2 mapping to RDF, particularly Tables 3 and 5. Table 5 removes any triple matching the pattern 'x a rdf:List`. All other references throughout Section 3 to rdf:first are in the context of mapping a Sequence in OWL structure translation, and are denoted as blank nodes, starting with Table 3. A non-blank node that is an rdf:List and used with a sequence-valued property IRI in the OWL namespace will not be mapped and consumed by the mapping process, making the graph non-conformant with OWL 2 DL. But a non-blank node that is an rdf:List can be used if not directly attached to a sequence-valued property IRI in the OWL namespace."@en ; + sh:xone ( + [ + a sh:NodeShape ; + sh:hasValue rdf:nil ; + ] + [ + a sh:NodeShape ; + sh:nodeKind sh:BlankNode ; + sh:property [ + a sh:PropertyShape ; + sh:path [ + sh:oneOrMorePath rdf:rest ; + ] ; + sh:xone ( + [ + a sh:NodeShape ; + sh:hasValue rdf:nil ; + ] + [ + a sh:NodeShape ; + sh:nodeKind sh:BlankNode ; + sh:property [ + a sh:PropertyShape ; + sh:maxCount "1"^^xsd:integer ; + sh:minCount "1"^^xsd:integer ; + sh:path rdf:first ; + ] ; + ] + ) ; + ] ; + ] + ) ; + . + +uco-owl:disjointUnionOf-subjects-shape + a sh:NodeShape ; + sh:property [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:disjointUnionOf ; + ] ; + sh:targetSubjectsOf owl:disjointUnionOf ; + . + +uco-owl:distinctMembers-subjects-shape + a sh:NodeShape ; + sh:property [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:distinctMembers ; + ] ; + sh:targetSubjectsOf owl:distinctMembers ; + . + +uco-owl:hasKey-subjects-shape + a sh:NodeShape ; + 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 a sh:PropertyShape ; rdfs:seeAlso ; @@ -285,6 +343,46 @@ uco-owl:incompatibleWith-imported-version-iri-shape sh:targetObjectsOf owl:incompatibleWith ; . +uco-owl:intersectionOf-subjects-shape + a sh:NodeShape ; + sh:property [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:intersectionOf ; + ] ; + sh:targetSubjectsOf owl:intersectionOf ; + . + +uco-owl:members-subjects-shape + a sh:NodeShape ; + sh:property [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:members ; + ] ; + sh:targetSubjectsOf owl:members ; + . + +uco-owl:onProperties-subjects-shape + a sh:NodeShape ; + sh:property [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:onProperties ; + ] ; + sh:targetSubjectsOf owl:onProperties ; + . + +uco-owl:oneOf-subjects-shape + a sh:NodeShape ; + 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 a sh:NodeShape ; rdfs:seeAlso ; @@ -293,6 +391,60 @@ uco-owl:ontologyIRI-versionIRI-prerequisite-shape sh:targetSubjectsOf owl:versionIRI ; . +uco-owl:propertyChainAxiom-subjects-shape + a sh:NodeShape ; + 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 + a sh:NodeShape ; + sh:property + [ + a sh:PropertyShape ; + sh:maxCount "1"^^xsd:integer ; + sh:path rdf:first ; + ] , + [ + a sh:PropertyShape ; + sh:minCount "1"^^xsd:integer ; + sh:path rdf:rest ; + ] + ; + sh:targetSubjectsOf rdf:first ; + . + +uco-owl:rdf-rest-subjects-shape + a sh:NodeShape ; + sh:property + [ + a sh:PropertyShape ; + sh:maxCount "1"^^xsd:integer ; + sh:path rdf:rest ; + ] , + [ + a sh:PropertyShape ; + sh:minCount "1"^^xsd:integer ; + sh:path rdf:first ; + ] + ; + sh:targetSubjectsOf rdf:rest ; + . + +uco-owl:unionOf-subjects-shape + a sh:NodeShape ; + sh:property [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:unionOf ; + ] ; + sh:targetSubjectsOf owl:unionOf ; + . + uco-owl:versionIRI-multiversion-shape a sh:PropertyShape ; rdfs:seeAlso ; @@ -310,3 +462,13 @@ uco-owl:versionIRI-nodeKind-shape sh:targetSubjectsOf owl:versionIRI ; . +uco-owl:withRestrictions-subjects-shape + a sh:NodeShape ; + sh:property [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:withRestrictions ; + ] ; + sh:targetSubjectsOf owl:withRestrictions ; + . + diff --git a/ontology/uco/action/action.ttl b/ontology/uco/action/action.ttl index d5a5bf26..17698eec 100644 --- a/ontology/uco/action/action.ttl +++ b/ontology/uco/action/action.ttl @@ -1,8 +1,8 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/location/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/pattern/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/types/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/vocabulary/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/location/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/pattern/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/types/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/vocabulary/1.3.0 @prefix action: . @prefix core: . @@ -20,16 +20,16 @@ a owl:Ontology ; rdfs:label "uco-action"@en ; rdfs:comment "This ontology defines classes and properties for characterizing actions."@en-US ; - owl:backwardCompatibleWith action:1.1.0 ; + owl:backwardCompatibleWith action:1.2.0 ; owl:imports - core:1.2.0 , - location:1.2.0 , - pattern:1.2.0 , - types:1.2.0 , - vocabulary:1.2.0 + core:1.3.0 , + location:1.3.0 , + pattern:1.3.0 , + types:1.3.0 , + vocabulary:1.3.0 ; - owl:priorVersion action:1.1.0 ; - owl:versionIRI action:1.2.0 ; + owl:priorVersion action:1.2.0 ; + owl:versionIRI action:1.3.0 ; . action:Action @@ -40,6 +40,7 @@ action:Action rdfs:subClassOf core:UcoObject ; rdfs:label "Action"@en ; rdfs:comment "An action is something that may be done or performed."@en ; + owl:disjointWith core:Event ; sh:property [ sh:class action:Action ; @@ -150,6 +151,16 @@ action:Action sh:targetClass action:Action ; . +action:Action-disjointWith-Event-shape + a sh:NodeShape ; + sh:message "action:Action and core:Event are disjoint classes."@en ; + sh:not [ + a sh:NodeShape ; + sh:class core:Event ; + ] ; + sh:targetClass action:Action ; + . + action:ActionArgumentFacet a owl:Class , diff --git a/ontology/uco/action/catalog-v001.xml b/ontology/uco/action/catalog-v001.xml index 3b59aa65..b2d6684c 100644 --- a/ontology/uco/action/catalog-v001.xml +++ b/ontology/uco/action/catalog-v001.xml @@ -2,11 +2,11 @@ - - - - - - + + + + + + diff --git a/ontology/uco/analysis/analysis.ttl b/ontology/uco/analysis/analysis.ttl index 11cd5623..2d978663 100644 --- a/ontology/uco/analysis/analysis.ttl +++ b/ontology/uco/analysis/analysis.ttl @@ -1,4 +1,4 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/action/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/action/1.3.0 @prefix action: . @prefix analysis: . @@ -14,10 +14,10 @@ rdfs:label "uco-analysis"@en ; rdfs:comment "This ontology defines classes and properties for characterizing analytic actions and results."@en-US ; rdfs:seeAlso ; - owl:backwardCompatibleWith analysis:1.1.0 ; - owl:imports action:1.2.0 ; - owl:priorVersion analysis:1.1.0 ; - owl:versionIRI analysis:1.2.0 ; + owl:backwardCompatibleWith analysis:1.2.0 ; + owl:imports action:1.3.0 ; + owl:priorVersion analysis:1.2.0 ; + owl:versionIRI analysis:1.3.0 ; . analysis:Analysis diff --git a/ontology/uco/analysis/catalog-v001.xml b/ontology/uco/analysis/catalog-v001.xml index 2487f222..2bbe3a6d 100644 --- a/ontology/uco/analysis/catalog-v001.xml +++ b/ontology/uco/analysis/catalog-v001.xml @@ -2,12 +2,12 @@ - - - - - - - + + + + + + + diff --git a/ontology/uco/configuration/catalog-v001.xml b/ontology/uco/configuration/catalog-v001.xml index 813a8921..7efa2af0 100644 --- a/ontology/uco/configuration/catalog-v001.xml +++ b/ontology/uco/configuration/catalog-v001.xml @@ -1,5 +1,5 @@ - + diff --git a/ontology/uco/configuration/configuration.ttl b/ontology/uco/configuration/configuration.ttl index 6b845e49..91d24a74 100644 --- a/ontology/uco/configuration/configuration.ttl +++ b/ontology/uco/configuration/configuration.ttl @@ -1,4 +1,4 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 @prefix configuration: . @prefix core: . @@ -13,10 +13,10 @@ rdfs:label "uco-configuration"@en ; rdfs:comment "This ontology defines classes and properties for characterizing configurations."@en-US ; rdfs:seeAlso ; - owl:backwardCompatibleWith configuration:1.1.0 ; - owl:imports core:1.2.0 ; - owl:priorVersion configuration:1.1.0 ; - owl:versionIRI configuration:1.2.0 ; + owl:backwardCompatibleWith configuration:1.2.0 ; + owl:imports core:1.3.0 ; + owl:priorVersion configuration:1.2.0 ; + owl:versionIRI configuration:1.3.0 ; . configuration:Configuration diff --git a/ontology/uco/core/core.ttl b/ontology/uco/core/core.ttl index aaa52614..e061bd54 100644 --- a/ontology/uco/core/core.ttl +++ b/ontology/uco/core/core.ttl @@ -1,3 +1,4 @@ +@prefix action: . @prefix core: . @prefix owl: . @prefix rdf: . @@ -10,9 +11,14 @@ a owl:Ontology ; rdfs:label "uco-core"@en ; rdfs:comment "This ontology defines classes and properties that are shared across the various UCO ontologies. At a high-level, the UCO core ontology provides base classes, relationship-oriented classes, content-aggregation classes, and shared classes."@en ; - owl:backwardCompatibleWith core:1.1.0 ; - owl:priorVersion core:1.1.0 ; - owl:versionIRI core:1.2.0 ; + owl:backwardCompatibleWith core:1.2.0 ; + owl:priorVersion core:1.2.0 ; + owl:versionIRI core:1.3.0 ; + . + +action:Action + a owl:Class ; + rdfs:isDefinedBy ; . core:Annotation @@ -171,6 +177,45 @@ core:EnclosingCompilation sh:targetClass core:EnclosingCompilation ; . +core:Event + a + owl:Class , + sh:NodeShape + ; + rdfs:subClassOf core:UcoObject ; + rdfs:label "Event"@en ; + rdfs:comment "An Event is a noteworthy occurrence (something that happens or might happen)."@en ; + owl:disjointWith action:Action ; + sh:property + [ + sh:class core:UcoObject ; + sh:nodeKind sh:IRI ; + sh:path core:eventContext ; + ] , + [ + sh:class types:Dictionary ; + sh:nodeKind sh:IRI ; + sh:path core:eventAttribute ; + ] , + [ + sh:datatype xsd:dateTime ; + sh:nodeKind sh:Literal ; + sh:path core:endTime ; + ] , + [ + sh:datatype xsd:dateTime ; + sh:nodeKind sh:Literal ; + sh:path core:startTime ; + ] , + [ + sh:datatype xsd:string ; + sh:nodeKind sh:Literal ; + sh:path core:eventType ; + ] + ; + sh:targetClass core:Event ; + . + core:ExternalReference a owl:Class , @@ -518,6 +563,27 @@ core:endTime rdfs:range xsd:dateTime ; . +core:eventAttribute + a owl:ObjectProperty ; + rdfs:label "Event Attribute"@en ; + rdfs:comment "An event attribute specifies an ad-hoc attribute/value for an event."@en ; + rdfs:range types:Dictionary ; + . + +core:eventContext + a owl:ObjectProperty ; + rdfs:label "Event Context"@en ; + rdfs:comment "An event context describes the association of actions and objects relating to an event."@en ; + rdfs:range core:UcoObject ; + . + +core:eventType + a owl:DatatypeProperty ; + rdfs:label "Event Type"@en ; + rdfs:comment "An event type specifies a classification type for the event."@en ; + rdfs:range xsd:string ; + . + core:externalIdentifier a owl:DatatypeProperty ; rdfs:label "externalIdentifier"@en ; @@ -677,6 +743,11 @@ core:value rdfs:range xsd:string ; . +types:Dictionary + a owl:Class ; + rdfs:isDefinedBy ; + . + [] a owl:AllDisjointClasses ; owl:members ( diff --git a/ontology/uco/identity/catalog-v001.xml b/ontology/uco/identity/catalog-v001.xml index 666f2eac..54b2425d 100644 --- a/ontology/uco/identity/catalog-v001.xml +++ b/ontology/uco/identity/catalog-v001.xml @@ -1,6 +1,6 @@ - - + + diff --git a/ontology/uco/identity/identity.ttl b/ontology/uco/identity/identity.ttl index bde0bf28..93c20b6f 100644 --- a/ontology/uco/identity/identity.ttl +++ b/ontology/uco/identity/identity.ttl @@ -1,5 +1,5 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/location/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/location/1.3.0 @prefix core: . @prefix identity: . @@ -13,13 +13,13 @@ a owl:Ontology ; rdfs:label "uco-identity"@en ; - owl:backwardCompatibleWith identity:1.1.0 ; + owl:backwardCompatibleWith identity:1.2.0 ; owl:imports - core:1.2.0 , - location:1.2.0 + core:1.3.0 , + location:1.3.0 ; - owl:priorVersion identity:1.1.0 ; - owl:versionIRI identity:1.2.0 ; + owl:priorVersion identity:1.2.0 ; + owl:versionIRI identity:1.3.0 ; . identity:AddressFacet diff --git a/ontology/uco/location/catalog-v001.xml b/ontology/uco/location/catalog-v001.xml index 11b8939e..61bbbed2 100644 --- a/ontology/uco/location/catalog-v001.xml +++ b/ontology/uco/location/catalog-v001.xml @@ -1,5 +1,5 @@ - + diff --git a/ontology/uco/location/location.ttl b/ontology/uco/location/location.ttl index c713430c..a7ce761b 100644 --- a/ontology/uco/location/location.ttl +++ b/ontology/uco/location/location.ttl @@ -1,4 +1,4 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 @prefix core: . @prefix location: . @@ -11,10 +11,10 @@ a owl:Ontology ; rdfs:label "uco-location"@en ; - owl:backwardCompatibleWith location:1.1.0 ; - owl:imports core:1.2.0 ; - owl:priorVersion location:1.1.0 ; - owl:versionIRI location:1.2.0 ; + owl:backwardCompatibleWith location:1.2.0 ; + owl:imports core:1.3.0 ; + owl:priorVersion location:1.2.0 ; + owl:versionIRI location:1.3.0 ; . location:GPSCoordinatesFacet diff --git a/ontology/uco/marking/catalog-v001.xml b/ontology/uco/marking/catalog-v001.xml index a1bc2aa1..fa166323 100644 --- a/ontology/uco/marking/catalog-v001.xml +++ b/ontology/uco/marking/catalog-v001.xml @@ -1,5 +1,5 @@ - + diff --git a/ontology/uco/marking/marking.ttl b/ontology/uco/marking/marking.ttl index ea1d6327..b4b880fd 100644 --- a/ontology/uco/marking/marking.ttl +++ b/ontology/uco/marking/marking.ttl @@ -1,4 +1,4 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 @prefix core: . @prefix marking: . @@ -12,10 +12,10 @@ a owl:Ontology ; rdfs:label "uco-marking"@en ; rdfs:comment "Data markings represent restrictions, permissions, and other guidance for how data can be used and shared."@en ; - owl:backwardCompatibleWith marking:1.1.0 ; - owl:imports core:1.2.0 ; - owl:priorVersion marking:1.1.0 ; - owl:versionIRI marking:1.2.0 ; + owl:backwardCompatibleWith marking:1.2.0 ; + owl:imports core:1.3.0 ; + owl:priorVersion marking:1.2.0 ; + owl:versionIRI marking:1.3.0 ; . marking:GranularMarking diff --git a/ontology/uco/master/catalog-v001.xml b/ontology/uco/master/catalog-v001.xml index 5145a6db..839b6401 100644 --- a/ontology/uco/master/catalog-v001.xml +++ b/ontology/uco/master/catalog-v001.xml @@ -2,22 +2,22 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/ontology/uco/master/uco.ttl b/ontology/uco/master/uco.ttl index 2b2ca471..61346b1b 100644 --- a/ontology/uco/master/uco.ttl +++ b/ontology/uco/master/uco.ttl @@ -1,20 +1,20 @@ -# imports: https://ontology.unifiedcyberontology.org/co/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/owl/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/action/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/analysis/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/configuration/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/identity/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/location/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/marking/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/observable/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/pattern/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/role/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/time/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/tool/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/types/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/victim/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/vocabulary/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/co/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/owl/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/action/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/analysis/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/configuration/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/identity/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/location/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/marking/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/observable/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/pattern/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/role/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/time/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/tool/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/types/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/victim/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/vocabulary/1.3.0 @prefix owl: . @prefix rdf: . @@ -25,28 +25,28 @@ a owl:Ontology ; rdfs:label "uco-master"@en ; - owl:backwardCompatibleWith ; + owl:backwardCompatibleWith ; owl:imports - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; - owl:priorVersion ; - owl:versionIRI ; - owl:versionInfo "1.2.0" ; + owl:priorVersion ; + owl:versionIRI ; + owl:versionInfo "1.3.0" ; . diff --git a/ontology/uco/observable/catalog-v001.xml b/ontology/uco/observable/catalog-v001.xml index bc82826c..fb5f3d2b 100644 --- a/ontology/uco/observable/catalog-v001.xml +++ b/ontology/uco/observable/catalog-v001.xml @@ -2,14 +2,14 @@ - - - - - - - - - + + + + + + + + + diff --git a/ontology/uco/observable/observable.ttl b/ontology/uco/observable/observable.ttl index eac9609a..9583efbb 100644 --- a/ontology/uco/observable/observable.ttl +++ b/ontology/uco/observable/observable.ttl @@ -1,10 +1,10 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/action/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/configuration/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/identity/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/location/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/types/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/vocabulary/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/action/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/configuration/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/identity/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/location/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/types/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/vocabulary/1.3.0 @prefix action: . @prefix co: . @@ -24,18 +24,18 @@ a owl:Ontology ; rdfs:label "uco-observable"@en ; - owl:backwardCompatibleWith observable:1.1.0 ; + owl:backwardCompatibleWith observable:1.2.0 ; owl:imports - action:1.2.0 , - configuration:1.2.0 , - core:1.2.0 , - identity:1.2.0 , - location:1.2.0 , - types:1.2.0 , - vocabulary:1.2.0 + action:1.3.0 , + configuration:1.3.0 , + core:1.3.0 , + identity:1.3.0 , + location:1.3.0 , + types:1.3.0 , + vocabulary:1.3.0 ; - owl:priorVersion observable:1.1.0 ; - owl:versionIRI observable:1.2.0 ; + owl:priorVersion observable:1.2.0 ; + owl:versionIRI observable:1.3.0 ; . observable:API @@ -3197,6 +3197,18 @@ observable:File rdfs:subClassOf observable:FileSystemObject ; rdfs:label "File"@en ; rdfs:comment "A file is a computer resource for recording data discretely on a computer storage device."@en ; + owl:disjointWith observable:URL ; + sh:targetClass observable:File ; + . + +observable:File-disjointWith-URL-shape + a sh:NodeShape ; + sh:message "observable:File and observable:URL are disjoint classes. Assigning both types to a single node will be an error in UCO 2.0.0."@en ; + sh:not [ + a sh:NodeShape ; + sh:class observable:URL ; + ] ; + sh:severity sh:Warning ; sh:targetClass observable:File ; . diff --git a/ontology/uco/pattern/catalog-v001.xml b/ontology/uco/pattern/catalog-v001.xml index ec640714..1e3db776 100644 --- a/ontology/uco/pattern/catalog-v001.xml +++ b/ontology/uco/pattern/catalog-v001.xml @@ -1,5 +1,5 @@ - + diff --git a/ontology/uco/pattern/pattern.ttl b/ontology/uco/pattern/pattern.ttl index de7163c8..02173140 100644 --- a/ontology/uco/pattern/pattern.ttl +++ b/ontology/uco/pattern/pattern.ttl @@ -1,4 +1,4 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 @prefix core: . @prefix owl: . @@ -11,10 +11,10 @@ a owl:Ontology ; rdfs:label "uco-pattern"@en ; - owl:backwardCompatibleWith pattern:1.1.0 ; - owl:imports core:1.2.0 ; - owl:priorVersion pattern:1.1.0 ; - owl:versionIRI pattern:1.2.0 ; + owl:backwardCompatibleWith pattern:1.2.0 ; + owl:imports core:1.3.0 ; + owl:priorVersion pattern:1.2.0 ; + owl:versionIRI pattern:1.3.0 ; . pattern:LogicalPattern diff --git a/ontology/uco/role/catalog-v001.xml b/ontology/uco/role/catalog-v001.xml index 2580b041..3d657139 100644 --- a/ontology/uco/role/catalog-v001.xml +++ b/ontology/uco/role/catalog-v001.xml @@ -1,5 +1,5 @@ - + diff --git a/ontology/uco/role/role.ttl b/ontology/uco/role/role.ttl index 4537d315..907c3b4a 100644 --- a/ontology/uco/role/role.ttl +++ b/ontology/uco/role/role.ttl @@ -1,4 +1,4 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 @prefix core: . @prefix owl: . @@ -11,10 +11,10 @@ a owl:Ontology ; rdfs:label "uco-role"@en ; - owl:backwardCompatibleWith role:1.1.0 ; - owl:imports core:1.2.0 ; - owl:priorVersion role:1.1.0 ; - owl:versionIRI role:1.2.0 ; + owl:backwardCompatibleWith role:1.2.0 ; + owl:imports core:1.3.0 ; + owl:priorVersion role:1.2.0 ; + owl:versionIRI role:1.3.0 ; . role:BenevolentRole diff --git a/ontology/uco/time/catalog-v001.xml b/ontology/uco/time/catalog-v001.xml index 08318a2f..900b7d33 100644 --- a/ontology/uco/time/catalog-v001.xml +++ b/ontology/uco/time/catalog-v001.xml @@ -1,5 +1,5 @@ - + diff --git a/ontology/uco/time/time.ttl b/ontology/uco/time/time.ttl index ef6adc72..c78c605f 100644 --- a/ontology/uco/time/time.ttl +++ b/ontology/uco/time/time.ttl @@ -1,4 +1,4 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 @prefix core: . @prefix owl: . @@ -10,10 +10,10 @@ a owl:Ontology ; rdfs:label "uco-time"@en ; - owl:backwardCompatibleWith time:1.1.0 ; - owl:imports core:1.2.0 ; - owl:priorVersion time:1.1.0 ; - owl:versionIRI time:1.2.0 ; + owl:backwardCompatibleWith time:1.2.0 ; + owl:imports core:1.3.0 ; + owl:priorVersion time:1.2.0 ; + owl:versionIRI time:1.3.0 ; . time:Time diff --git a/ontology/uco/tool/catalog-v001.xml b/ontology/uco/tool/catalog-v001.xml index 906c7cad..33084fb7 100644 --- a/ontology/uco/tool/catalog-v001.xml +++ b/ontology/uco/tool/catalog-v001.xml @@ -1,8 +1,8 @@ - - - - + + + + diff --git a/ontology/uco/tool/tool.ttl b/ontology/uco/tool/tool.ttl index 4439e439..c690fdc8 100644 --- a/ontology/uco/tool/tool.ttl +++ b/ontology/uco/tool/tool.ttl @@ -1,5 +1,5 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/configuration/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/identity/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/configuration/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/identity/1.3.0 @prefix configuration: . @prefix core: . @@ -14,13 +14,13 @@ a owl:Ontology ; rdfs:label "uco-tool"@en ; - owl:backwardCompatibleWith tool:1.1.0 ; + owl:backwardCompatibleWith tool:1.2.0 ; owl:imports - configuration:1.2.0 , - identity:1.2.0 + configuration:1.3.0 , + identity:1.3.0 ; - owl:priorVersion tool:1.1.0 ; - owl:versionIRI tool:1.2.0 ; + owl:priorVersion tool:1.2.0 ; + owl:versionIRI tool:1.3.0 ; . tool:AnalyticTool diff --git a/ontology/uco/types/catalog-v001.xml b/ontology/uco/types/catalog-v001.xml index 95833c1a..fafb8699 100644 --- a/ontology/uco/types/catalog-v001.xml +++ b/ontology/uco/types/catalog-v001.xml @@ -2,8 +2,8 @@ - - - + + + diff --git a/ontology/uco/types/types.ttl b/ontology/uco/types/types.ttl index 8dc0e9a1..ad91bedb 100644 --- a/ontology/uco/types/types.ttl +++ b/ontology/uco/types/types.ttl @@ -1,6 +1,6 @@ -# imports: https://ontology.unifiedcyberontology.org/co/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/core/1.2.0 -# imports: https://ontology.unifiedcyberontology.org/uco/vocabulary/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/co/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/core/1.3.0 +# imports: https://ontology.unifiedcyberontology.org/uco/vocabulary/1.3.0 @prefix co: . @prefix core: . @@ -16,14 +16,14 @@ a owl:Ontology ; rdfs:label "uco-types"@en ; - owl:backwardCompatibleWith types:1.1.0 ; + owl:backwardCompatibleWith types:1.2.0 ; owl:imports - uco-co:1.2.0 , - core:1.2.0 , - vocabulary:1.2.0 + uco-co:1.3.0 , + core:1.3.0 , + vocabulary:1.3.0 ; - owl:priorVersion types:1.1.0 ; - owl:versionIRI types:1.2.0 ; + owl:priorVersion types:1.2.0 ; + owl:versionIRI types:1.3.0 ; . types:ControlledDictionary diff --git a/ontology/uco/victim/catalog-v001.xml b/ontology/uco/victim/catalog-v001.xml index cdc6d411..70228d09 100644 --- a/ontology/uco/victim/catalog-v001.xml +++ b/ontology/uco/victim/catalog-v001.xml @@ -1,6 +1,6 @@ - - + + diff --git a/ontology/uco/victim/victim.ttl b/ontology/uco/victim/victim.ttl index 1e6586f9..5766391e 100644 --- a/ontology/uco/victim/victim.ttl +++ b/ontology/uco/victim/victim.ttl @@ -1,4 +1,4 @@ -# imports: https://ontology.unifiedcyberontology.org/uco/role/1.2.0 +# imports: https://ontology.unifiedcyberontology.org/uco/role/1.3.0 @prefix owl: . @prefix rdf: . @@ -11,10 +11,10 @@ a owl:Ontology ; rdfs:label "uco-victim"@en ; - owl:backwardCompatibleWith victim:1.1.0 ; - owl:imports role:1.2.0 ; - owl:priorVersion victim:1.1.0 ; - owl:versionIRI victim:1.2.0 ; + owl:backwardCompatibleWith victim:1.2.0 ; + owl:imports role:1.3.0 ; + owl:priorVersion victim:1.2.0 ; + owl:versionIRI victim:1.3.0 ; . victim:Victim diff --git a/ontology/uco/vocabulary/vocabulary.ttl b/ontology/uco/vocabulary/vocabulary.ttl index a376011b..d13c89e7 100644 --- a/ontology/uco/vocabulary/vocabulary.ttl +++ b/ontology/uco/vocabulary/vocabulary.ttl @@ -7,9 +7,9 @@ a owl:Ontology ; rdfs:label "uco-vocabularies"@en ; - owl:backwardCompatibleWith vocabulary:1.1.0 ; - owl:priorVersion vocabulary:1.1.0 ; - owl:versionIRI vocabulary:1.2.0 ; + owl:backwardCompatibleWith vocabulary:1.2.0 ; + owl:priorVersion vocabulary:1.2.0 ; + owl:versionIRI vocabulary:1.3.0 ; . vocabulary:AccountTypeVocab diff --git a/tests/examples/Makefile b/tests/examples/Makefile index 81c5dfad..80f59e04 100644 --- a/tests/examples/Makefile +++ b/tests/examples/Makefile @@ -27,6 +27,8 @@ all: \ configuration_setting_XFAIL_validation.ttl \ database_records_PASS_validation.ttl \ database_records_XFAIL_validation.ttl \ + event_XFAIL_validation.ttl \ + file_url_PASS_validation.ttl \ has_facet_inverse_functional_PASS_validation.ttl \ has_facet_inverse_functional_XFAIL_validation.ttl \ hash_PASS_validation.ttl \ @@ -96,6 +98,8 @@ check: \ configuration_setting_XFAIL_validation.ttl \ database_records_PASS_validation.ttl \ database_records_XFAIL_validation.ttl \ + event_XFAIL_validation.ttl \ + file_url_PASS_validation.ttl \ has_facet_inverse_functional_PASS_validation.ttl \ has_facet_inverse_functional_XFAIL_validation.ttl \ hash_PASS_validation.ttl \ diff --git a/tests/examples/event_XFAIL.json b/tests/examples/event_XFAIL.json new file mode 100644 index 00000000..9f2a59d9 --- /dev/null +++ b/tests/examples/event_XFAIL.json @@ -0,0 +1,28 @@ +{ + "@context": { + "kb": "http://example.org/kb/", + "action": "https://ontology.unifiedcyberontology.org/uco/action/", + "core": "https://ontology.unifiedcyberontology.org/uco/core/", + "xsd": "http://www.w3.org/2001/XMLSchema#" + }, + "@graph": [ + { + "@id": "kb:Action-0-03ee1fe6-12cf-4a35-b7dd-06d4e69369b5", + "@type": [ + "action:Action", + "core:Event" + ], + "rdfs:comment": "This node will trigger an XFAIL for designating itself an Action and Event, which are disjoint classes." + }, + { + "@id": "kb:Action-1-763c1ff2-d18d-427b-aa82-30d90701a644", + "@type": "action:Action", + "rdfs:comment": "This node should pass validation." + }, + { + "@id": "kb:Event-1-ee9450b6-3535-473d-984d-17a91408a54f", + "@type": "event:Event", + "rdfs:comment": "This node should pass validation." + } + ] +} diff --git a/tests/examples/event_XFAIL_validation.ttl b/tests/examples/event_XFAIL_validation.ttl new file mode 100644 index 00000000..be6dbd96 --- /dev/null +++ b/tests/examples/event_XFAIL_validation.ttl @@ -0,0 +1,21 @@ +@prefix action: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +[] + a sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + a sh:ValidationResult ; + sh:focusNode ; + sh:resultMessage "action:Action and core:Event are disjoint classes."@en ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NotConstraintComponent ; + sh:sourceShape action:Action-disjointWith-Event-shape ; + sh:value ; + ] ; + . + diff --git a/tests/examples/file_url_PASS.json b/tests/examples/file_url_PASS.json new file mode 100644 index 00000000..58d2abb3 --- /dev/null +++ b/tests/examples/file_url_PASS.json @@ -0,0 +1,17 @@ +{ + "@context": { + "kb": "http://example.org/kb/", + "observable": "https://ontology.unifiedcyberontology.org/uco/observable/", + "xsd": "http://www.w3.org/2001/XMLSchema#" + }, + "@graph": [ + { + "@id": "kb:Thing-23a38d67-3432-458b-9651-955b418c2a77", + "@type": [ + "observable:File", + "observable:URL" + ], + "rdfs:comment": "Should trigger sh:Warning from simultaneously being a member of two disjoint classes; will trigger sh:Violation in UCO 2.0.0." + } + ] +} diff --git a/tests/examples/file_url_PASS_validation.ttl b/tests/examples/file_url_PASS_validation.ttl new file mode 100644 index 00000000..2a4b22ec --- /dev/null +++ b/tests/examples/file_url_PASS_validation.ttl @@ -0,0 +1,21 @@ +@prefix observable: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +[] + a sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ; + sh:result [ + a sh:ValidationResult ; + sh:focusNode ; + sh:resultMessage "observable:File and observable:URL are disjoint classes. Assigning both types to a single node will be an error in UCO 2.0.0."@en ; + sh:resultSeverity sh:Warning ; + sh:sourceConstraintComponent sh:NotConstraintComponent ; + sh:sourceShape observable:File-disjointWith-URL-shape ; + sh:value ; + ] ; + . + diff --git a/tests/examples/rdf_list_PASS.json b/tests/examples/rdf_list_PASS.json index febdaa31..7462e256 100644 --- a/tests/examples/rdf_list_PASS.json +++ b/tests/examples/rdf_list_PASS.json @@ -1,10 +1,14 @@ { "@context": { + "dash": "http://datashapes.org/dash#", + "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#", "rdfs": "http://www.w3.org/2000/01/rdf-schema#", - "skos": "http://www.w3.org/2004/02/skos/core#" + "sh": "http://www.w3.org/ns/shacl#", + "skos": "http://www.w3.org/2004/02/skos/core#", + "xsd": "http://www.w3.org/2001/XMLSchema#" }, "@graph": [ { @@ -15,6 +19,14 @@ "@id": "kb:concept-2", "@type": "skos:Concept" }, + { + "@id": "kb:concept-3", + "@type": "skos:Concept" + }, + { + "@id": "kb:concept-4", + "@type": "skos:Concept" + }, { "@id": "kb:ordered-collection-1", "@type": "skos:OrderedCollection", @@ -50,6 +62,130 @@ } } } + }, + { + "@id": "kb:ordered-collection-3", + "@type": "skos:OrderedCollection", + "skos:memberList": { + "@id": "kb:list-1", + "@type": "rdf:List", + "rdf:first": { + "@id": "kb:concept-3" + }, + "rdf:rest": { + "@type": "rdf:List", + "rdf:first": { + "@id": "kb:concept-4" + }, + "rdf:rest": { + "@id": "rdf:nil" + } + } + } + }, + { + "@id": "kb:ordered-collection-4", + "@type": "skos:OrderedCollection", + "skos:memberList": { + "rdf:first": { + "@id": "kb:concept-3" + }, + "rdf:rest": { + "@id": "kb:list-2", + "rdf:first": { + "@id": "kb:concept-4" + }, + "rdf:rest": { + "@id": "rdf:nil" + } + } + } + }, + { + "@type": "owl:AllDifferent", + "owl:distinctMembers": { + "@type": "rdf:List", + "rdf:first": { + "@id": "kb:ordered-collection-1" + }, + "rdf:rest": { + "@type": "rdf:List", + "rdf:first": { + "@id": "kb:ordered-collection-2" + }, + "rdf:rest": { + "@id": "rdf:nil" + } + } + } + }, + { + "@id": "ex:hasGrandparent", + "@type": "owl:ObjectProperty", + "rdfs:isDefinedBy": { + "@id": "https://www.w3.org/TR/2012/REC-owl2-primer-20121211/#Property_Chains" + }, + "owl:propertyChainAxiom": { + "rdf:first": { + "@id": "ex:hasParent" + }, + "rdf:rest": { + "rdf:first": { + "@id": "ex:hasParent" + }, + "rdf:rest": { + "@id": "rdf:nil" + } + } + } + }, + { + "@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", + "rdf:first": { + "sh:datatype": "xsd:date" + }, + "rdf:rest": { + "rdf:first": { + "sh:datatype": "xsd:dateTime" + }, + "rdf:rest": { + "@id": "rdf:nil" + } + }, + "rdfs:comment": "An rdf:List that can be used in property constraints as value for sh:or to indicate that all values of a property must be either xsd:date or xsd:dateTime.", + "rdfs:isDefinedBy": { + "@id": "http://datashapes.org/dash" + }, + "rdfs:label": "Date or date time" } ] } diff --git a/tests/examples/rdf_list_XFAIL.json b/tests/examples/rdf_list_XFAIL.json index da81471a..9e188cfe 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#", @@ -8,52 +9,75 @@ }, "@graph": [ { - "@id": "kb:concept-3", + "@id": "kb:concept-5", "@type": "skos:Concept" }, { - "@id": "kb:concept-4", + "@id": "kb:concept-6", "@type": "skos:Concept" }, { - "@id": "kb:ordered-collection-3", - "@type": "skos:OrderedCollection", - "skos:memberList": { - "@id": "kb:list-1", + "@id": "kb:concept-7", + "@type": "skos:Concept" + }, + { + "@id": "kb:concept-8", + "@type": "skos:Concept" + }, + { + "@id": "kb:list-1", + "@type": "rdf:List", + "rdfs:comment": "This will trigger a violation error. An OWL Sequence must be a blank node.", + "rdf:first": { + "@id": "kb:concept-5" + }, + "rdf:rest": { "@type": "rdf:List", - "rdf:comment": "This will trigger a violation error. An rdf:first's subject must be a blank node.", "rdf:first": { - "@id": "kb:concept-3" + "@id": "kb:concept-6" }, "rdf:rest": { - "@type": "rdf:List", - "rdf:first": { - "@id": "kb:concept-4" - }, - "rdf:rest": { - "@id": "rdf:nil" - } + "@id": "rdf:nil" } } }, { - "@id": "kb:ordered-collection-4", - "@type": "skos:OrderedCollection", - "skos:memberList": { + "@type": "owl:AllDifferent", + "owl:distinctMembers": { + "@id": "kb:list-1" + } + }, + { + "@type": "owl:AllDifferent", + "owl:distinctMembers": { + "@type": "rdf:List", "rdf:first": { - "@id": "kb:concept-3" + "@id": "kb:concept-7" }, "rdf:rest": { - "@id": "kb:list-2", - "rdf:comment": "This will trigger a violation error. An rdf:first's subject must be a blank node.", + "@id": "kb:list-4", + "rdfs:comment": "This will trigger a violation error. An OWL Sequence must be a blank node.", + "@type": "rdf:List", "rdf:first": { - "@id": "kb:concept-4" + "@id": "kb:concept-8" }, "rdf:rest": { "@id": "rdf:nil" } } } + }, + { + "@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 7784b385..65ab509a 100644 --- a/tests/examples/rdf_list_XFAIL_validation.ttl +++ b/tests/examples/rdf_list_XFAIL_validation.ttl @@ -11,45 +11,90 @@ sh:result [ a sh:ValidationResult ; - sh:focusNode ; - sh:resultMessage "The subject of a triple with rdf:first as predicate must be a blank node." ; + sh:detail [ + a sh:ValidationResult ; + sh:focusNode ; + sh:resultMessage 'Node kb:list-1 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 [ + 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:sourceConstraint [ - a sh:SPARQLConstraint ; - rdfs:comment "This requirement is determined from review of the canonical parsing process in Section 3 of the OWL 2 mapping to RDF. Table 5 removes any triple matching the pattern 'x a rdf:List`. All other references throughout Section 3 to rdf:first are identified as blank nodes. Therefore, any non-blank node that is an rdf:List will not be mapped and consumed by the mapping process, making the graph non-conformant with OWL 2 DL."@en ; - rdfs:seeAlso ; - sh:message "The subject of a triple with rdf:first as predicate must be a blank node."@en ; - sh:select """ - SELECT $this - WHERE { - FILTER isIRI($this) - } - """ ; - ] ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape uco-owl:List-shape ; + sh:sourceConstraintComponent sh:NodeConstraintComponent ; + sh:sourceShape [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:distinctMembers ; + ] ; sh:value ; ] , [ a sh:ValidationResult ; - sh:focusNode ; - sh:resultMessage "The subject of a triple with rdf:first as predicate must be a blank node." ; + 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 [ + a sh:ValidationResult ; + sh:focusNode ( + + + ) ; + sh:resultMessage 'Node ( kb:concept-7 kb:concept-8 ) 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 [ + 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:sourceConstraint [ - a sh:SPARQLConstraint ; - rdfs:comment "This requirement is determined from review of the canonical parsing process in Section 3 of the OWL 2 mapping to RDF. Table 5 removes any triple matching the pattern 'x a rdf:List`. All other references throughout Section 3 to rdf:first are identified as blank nodes. Therefore, any non-blank node that is an rdf:List will not be mapped and consumed by the mapping process, making the graph non-conformant with OWL 2 DL."@en ; - rdfs:seeAlso ; - sh:message "The subject of a triple with rdf:first as predicate must be a blank node."@en ; - sh:select """ - SELECT $this - WHERE { - FILTER isIRI($this) - } - """ ; - ] ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape uco-owl:List-shape ; - sh:value ; + sh:sourceConstraintComponent sh:NodeConstraintComponent ; + sh:sourceShape [ + a sh:PropertyShape ; + sh:node uco-owl:Sequence-shape ; + sh:path owl:distinctMembers ; + ] ; + sh:value ( + + + ) ; ] ; . diff --git a/tests/examples/test_validation.py b/tests/examples/test_validation.py index d0129801..c714d0c3 100644 --- a/tests/examples/test_validation.py +++ b/tests/examples/test_validation.py @@ -207,6 +207,24 @@ def test_database_records_XFAIL() -> None: } ) +def test_event_XFAIL() -> None: + confirm_validation_results( + "event_XFAIL_validation.ttl", + False, + expected_focus_node_severities = { + ("http://example.org/kb/Action-0-03ee1fe6-12cf-4a35-b7dd-06d4e69369b5", str(NS_SH.Violation)), + } + ) + +def test_file_url_PASS_validation() -> None: + confirm_validation_results( + "file_url_PASS_validation.ttl", + True, + expected_focus_node_severities={ + ("http://example.org/kb/Thing-23a38d67-3432-458b-9651-955b418c2a77", str(NS_SH.Warning)), + } + ) + def test_has_facet_inverse_functional_PASS() -> None: confirm_validation_results( "has_facet_inverse_functional_PASS_validation.ttl",