Skip to content

Commit

Permalink
Merge branch 'unstable' into unstable-2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnelson-nist committed Dec 5, 2023
2 parents 254002a + 318f979 commit d93cb99
Show file tree
Hide file tree
Showing 4 changed files with 324 additions and 74 deletions.
159 changes: 140 additions & 19 deletions ontology/owl/owl.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -179,25 +179,13 @@ 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 <https://www.w3.org/TR/2012/REC-owl2-mapping-to-rdf-20121211/#Mapping_from_RDF_Graphs_to_the_Structural_Specification> ;
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:rdf-first-subjects-shape ,
uco-owl:rdf-rest-subjects-shape
;
sh:deactivated "true"^^xsd:boolean ;
.

uco-owl:ObjectProperty-shacl-constraints-shape
Expand Down Expand Up @@ -250,6 +238,63 @@ 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 <https://www.w3.org/TR/2012/REC-owl2-mapping-to-rdf-20121211/#Mapping_from_RDF_Graphs_to_the_Structural_Specification> ;
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-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:disjointUnionOf ;
.

uco-owl:distinctMembers-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:distinctMembers ;
.

uco-owl:hasKey-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:hasKey ;
.

uco-owl:incompatibleWith-direct-import-shape
a sh:PropertyShape ;
rdfs:seeAlso <https://www.w3.org/TR/owl2-syntax/#Imports> ;
Expand Down Expand Up @@ -285,6 +330,30 @@ uco-owl:incompatibleWith-imported-version-iri-shape
sh:targetObjectsOf owl:incompatibleWith ;
.

uco-owl:intersectionOf-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:intersectionOf ;
.

uco-owl:members-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:members ;
.

uco-owl:onProperties-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:onProperties ;
.

uco-owl:oneOf-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:oneOf ;
.

uco-owl:ontologyIRI-versionIRI-prerequisite-shape
a sh:NodeShape ;
rdfs:seeAlso <https://www.w3.org/TR/owl2-syntax/#Ontology_IRI_and_Version_IRI> ;
Expand All @@ -293,6 +362,46 @@ uco-owl:ontologyIRI-versionIRI-prerequisite-shape
sh:targetSubjectsOf owl:versionIRI ;
.

uco-owl:propertyChainAxiom-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf 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:sh-datatype-objects-shape
a sh:NodeShape ;
sh:not [
Expand All @@ -302,6 +411,12 @@ uco-owl:sh-datatype-objects-shape
sh:targetObjectsOf sh:datatype ;
.

uco-owl:unionOf-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:unionOf ;
.

uco-owl:versionIRI-multiversion-shape
a sh:PropertyShape ;
rdfs:seeAlso <https://www.w3.org/TR/owl2-syntax/#Imports> ;
Expand All @@ -319,3 +434,9 @@ uco-owl:versionIRI-nodeKind-shape
sh:targetSubjectsOf owl:versionIRI ;
.

uco-owl:withRestrictions-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:withRestrictions ;
.

114 changes: 113 additions & 1 deletion tests/examples/rdf_list_PASS.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand All @@ -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",
Expand Down Expand Up @@ -50,6 +62,106 @@
}
}
}
},
{
"@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": "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"
}
]
}
Loading

0 comments on commit d93cb99

Please sign in to comment.