From ba77dea513a3b8aae7390795d6324b22480b35c6 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Mon, 20 Nov 2023 17:18:38 -0500 Subject: [PATCH 1/5] Add test that sh:datatype does not reference an OWL Class This test is spelled as a "Negative" constraint to avoid attempting to hard-code a list of the recognized OWL "built-in" datatypes alongside custom RDFS datatypes (such as UCO's vocabulary namespace members). The anonymous node shape design pattern is documented in PR 564, commit 77cd47d. This patch is known to fail CI at the moment because it catches the error described in 562, but does not resolve that situation. This patch is provided now to prevent this implementation error pattern from arising in the future. References: * https://github.com/ucoProject/UCO/issues/562 * https://github.com/ucoProject/UCO/pull/564/commits/77cd47d3e13bce2a6278b8416152b08f5a5d0c32 Signed-off-by: Alex Nelson --- ontology/owl/owl.ttl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ontology/owl/owl.ttl b/ontology/owl/owl.ttl index dd464601..be0f59e2 100644 --- a/ontology/owl/owl.ttl +++ b/ontology/owl/owl.ttl @@ -293,6 +293,18 @@ uco-owl:ontologyIRI-versionIRI-prerequisite-shape sh:targetSubjectsOf owl:versionIRI ; . +uco-owl:sh-datatype-objects-shape + a sh:NodeShape ; + sh:node [ + a sh:NodeShape ; + sh:not [ + a sh:NodeShape ; + sh:class owl:Class ; + ] ; + ] ; + sh:targetObjectsOf sh:datatype ; + . + uco-owl:versionIRI-multiversion-shape a sh:PropertyShape ; rdfs:seeAlso ; From 177ab81e143b3609025688d089e80aef9247a2ef Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Mon, 20 Nov 2023 18:15:14 -0500 Subject: [PATCH 2/5] Revise pattern:patternExpression to be object property This patch is implemented based on the early draft-state of Issue 550, to correct the issue reported in Issue 562. No effects were observed on Make-managed files. References: * https://github.com/ucoProject/UCO/issues/550 * https://github.com/ucoProject/UCO/issues/562 Signed-off-by: Alex Nelson --- ontology/uco/pattern/pattern.ttl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ontology/uco/pattern/pattern.ttl b/ontology/uco/pattern/pattern.ttl index de7163c8..1eeef8ac 100644 --- a/ontology/uco/pattern/pattern.ttl +++ b/ontology/uco/pattern/pattern.ttl @@ -26,9 +26,9 @@ pattern:LogicalPattern rdfs:label "LogicalPattern"@en ; rdfs:comment "A logical pattern is a grouping of characteristics unique to an informational pattern expressed via a structured pattern expression following the rules of logic."@en ; sh:property [ - sh:datatype pattern:PatternExpression ; + sh:class pattern:PatternExpression ; sh:maxCount "1"^^xsd:integer ; - sh:nodeKind sh:Literal ; + sh:nodeKind sh:IRI ; sh:path pattern:patternExpression ; ] ; sh:targetClass pattern:LogicalPattern ; @@ -57,7 +57,7 @@ pattern:PatternExpression . pattern:patternExpression - a owl:DatatypeProperty ; + a owl:ObjectProperty ; rdfs:label "patternExpression"@en ; rdfs:comment "An explicit logical pattern expression."@en ; rdfs:range pattern:PatternExpression ; From 5e193ae5d955b8a0de0890c058890ec88eda3afc Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 22 Nov 2023 15:46:21 -0500 Subject: [PATCH 3/5] Revise sh:not structure in new sh:datatype test Commit ba77dea used a design pattern that I now believe is not applicable. This patch revises the new shape to the corrected from now in PR 564. No effects were observed on Make-managed files. References: * https://github.com/ucoProject/UCO/issues/562 * https://github.com/ucoProject/UCO/pull/564/commits/6669aabdd5de5c7100eb7d0264b9639de10eae1f Signed-off-by: Alex Nelson --- ontology/owl/owl.ttl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ontology/owl/owl.ttl b/ontology/owl/owl.ttl index be0f59e2..c39b8596 100644 --- a/ontology/owl/owl.ttl +++ b/ontology/owl/owl.ttl @@ -295,12 +295,9 @@ uco-owl:ontologyIRI-versionIRI-prerequisite-shape uco-owl:sh-datatype-objects-shape a sh:NodeShape ; - sh:node [ + sh:not [ a sh:NodeShape ; - sh:not [ - a sh:NodeShape ; - sh:class owl:Class ; - ] ; + sh:class owl:Class ; ] ; sh:targetObjectsOf sh:datatype ; . From 9978efb4165d9e2ee2919cfca944478d8072b577 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 30 Apr 2024 15:40:33 -0400 Subject: [PATCH 4/5] Replace PatternExpression with xsd:string No effects were observed on Make-managed files. References: * https://github.com/ucoProject/UCO/issues/562 Signed-off-by: Alex Nelson --- ontology/uco/pattern/pattern.ttl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ontology/uco/pattern/pattern.ttl b/ontology/uco/pattern/pattern.ttl index 9c7fe8ff..adfa771d 100644 --- a/ontology/uco/pattern/pattern.ttl +++ b/ontology/uco/pattern/pattern.ttl @@ -26,9 +26,9 @@ pattern:LogicalPattern rdfs:label "LogicalPattern"@en ; rdfs:comment "A logical pattern is a grouping of characteristics unique to an informational pattern expressed via a structured pattern expression following the rules of logic."@en ; sh:property [ - sh:class pattern:PatternExpression ; + sh:datatype xsd:string ; sh:maxCount "1"^^xsd:integer ; - sh:nodeKind sh:IRI ; + sh:nodeKind sh:Literal ; sh:path pattern:patternExpression ; ] ; sh:targetClass pattern:LogicalPattern ; @@ -48,18 +48,24 @@ pattern:Pattern pattern:PatternExpression a owl:Class , + owl:DeprecatedClass , sh:NodeShape ; rdfs:subClassOf core:UcoInherentCharacterizationThing ; rdfs:label "PatternExpression"@en ; rdfs:comment "A pattern expression is a grouping of characteristics unique to an explicit logical expression defining a pattern (e.g., regular expression, SQL Select expression, etc.)."@en ; + sh:message "pattern:PatternExpression is deprecated, and an error to use as of UCO 2.0.0. xsd:string should be used instead." ; + sh:not [ + a sh:NodeShape ; + sh:class pattern:PatternExpression ; + ] ; sh:targetClass pattern:PatternExpression ; . pattern:patternExpression - a owl:ObjectProperty ; + a owl:DatatypeProperty ; rdfs:label "patternExpression"@en ; rdfs:comment "An explicit logical pattern expression."@en ; - rdfs:range pattern:PatternExpression ; + rdfs:range xsd:string ; . From 3c301b352f3855e58fd9826d73fc2e84d4b62f00 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 3 May 2024 10:05:43 -0400 Subject: [PATCH 5/5] Add shape description No effects were observed on Make-managed files. References: * https://github.com/ucoProject/UCO/issues/562 Acked-by: Paul Brandt Signed-off-by: Alex Nelson --- ontology/owl/owl.ttl | 1 + 1 file changed, 1 insertion(+) diff --git a/ontology/owl/owl.ttl b/ontology/owl/owl.ttl index f5c59b99..ffb96ea2 100644 --- a/ontology/owl/owl.ttl +++ b/ontology/owl/owl.ttl @@ -437,6 +437,7 @@ uco-owl:rdf-rest-subjects-shape uco-owl:sh-datatype-objects-shape a sh:NodeShape ; + sh:description "This shape enforces that the sh:datatype constraining predicate does not bind an OWL class for a literal-valued constraint."@en ; sh:not [ a sh:NodeShape ; sh:class owl:Class ;