From 5cfdb68f6c46581c6c2c8c98ff3a623c52d1c2c9 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 5 Jun 2024 07:35:28 -0400 Subject: [PATCH 1/4] Bump unstable pointers Note this tests the implementation as of UCO PR 603. 607 will be tested in a later patch. A follow-on patch will regenerate Make-managed files. References: * https://github.com/ucoProject/UCO/issues/602 * https://github.com/ucoProject/UCO/pull/603 Signed-off-by: Alex Nelson --- dependencies/CASE-unstable | 2 +- dependencies/CASE-unstable-2.0.0 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies/CASE-unstable b/dependencies/CASE-unstable index 4ca9dfdc..0210da11 160000 --- a/dependencies/CASE-unstable +++ b/dependencies/CASE-unstable @@ -1 +1 @@ -Subproject commit 4ca9dfdcfe05f3e8c3ceaa8a9f3928a48fb0c384 +Subproject commit 0210da11b4c049385b787d0c1f54018fe34a132c diff --git a/dependencies/CASE-unstable-2.0.0 b/dependencies/CASE-unstable-2.0.0 index c87e4572..55751b7c 160000 --- a/dependencies/CASE-unstable-2.0.0 +++ b/dependencies/CASE-unstable-2.0.0 @@ -1 +1 @@ -Subproject commit c87e457263c563c7dcd4811c9e13c6d25418ba62 +Subproject commit 55751b7cedd6bcb67ba819f79e1038f26b2bb9b6 From c8ed517606952e10dac6c0aa1e12d0e2fa45e530 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 5 Jun 2024 07:35:56 -0400 Subject: [PATCH 2/4] Regenerate Make-managed files References: * https://github.com/ucoProject/UCO/issues/602 * https://github.com/ucoProject/UCO/pull/603 Signed-off-by: Alex Nelson --- ontology/CASE-unstable-2.0.0.ttl | 21 +++++++++++++++++++++ ontology/CASE-unstable.ttl | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/ontology/CASE-unstable-2.0.0.ttl b/ontology/CASE-unstable-2.0.0.ttl index c2a0572c..e1abdca9 100644 --- a/ontology/CASE-unstable-2.0.0.ttl +++ b/ontology/CASE-unstable-2.0.0.ttl @@ -18363,6 +18363,27 @@ types:Dictionary rdfs:label "Dictionary"@en ; rdfs:comment "A dictionary is list of (term/key, value) pairs with each term/key existing no more than once."@en ; rdfs:isDefinedBy ; + rdfs:seeAlso [ + a sh:NodeShape ; + rdfs:comment "This anonymous shape is attached to types:Dictionary with rdfs:seeAlso in order to associate a warning-severity SPARQL-based shape, that will only be necessary as an independent shape until UCO 2.0.0."@en ; + sh:severity sh:Warning ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "A key in a dictionary can appear no more than once."@en ; + sh:select """ + PREFIX types: + SELECT $this ?value + WHERE { + $this + types:entry/types:key ?value ; + . + } + GROUP BY ?value + HAVING (COUNT(?value) > 1) + """ ; + ] ; + sh:targetClass types:Dictionary ; + ] ; sh:property [ sh:class types:DictionaryEntry ; sh:minCount "1"^^xsd:integer ; diff --git a/ontology/CASE-unstable.ttl b/ontology/CASE-unstable.ttl index 3afc300e..ca4bff79 100644 --- a/ontology/CASE-unstable.ttl +++ b/ontology/CASE-unstable.ttl @@ -18357,6 +18357,27 @@ types:Dictionary rdfs:label "Dictionary"@en ; rdfs:comment "A dictionary is list of (term/key, value) pairs with each term/key existing no more than once."@en ; rdfs:isDefinedBy ; + rdfs:seeAlso [ + a sh:NodeShape ; + rdfs:comment "This anonymous shape is attached to types:Dictionary with rdfs:seeAlso in order to associate a warning-severity SPARQL-based shape, that will only be necessary as an independent shape until UCO 2.0.0."@en ; + sh:severity sh:Warning ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "A key in a dictionary can appear no more than once."@en ; + sh:select """ + PREFIX types: + SELECT $this ?value + WHERE { + $this + types:entry/types:key ?value ; + . + } + GROUP BY ?value + HAVING (COUNT(?value) > 1) + """ ; + ] ; + sh:targetClass types:Dictionary ; + ] ; sh:property [ sh:class types:DictionaryEntry ; sh:minCount "1"^^xsd:integer ; From 80c75074d76671b29b3a9712137c1efc2fd3b4d9 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 5 Jun 2024 08:22:27 -0400 Subject: [PATCH 3/4] Bump unstable pointers A follow-on patch will regenerate Make-managed files. References: * https://github.com/ucoProject/UCO/issues/602 * https://github.com/ucoProject/UCO/pull/607 Signed-off-by: Alex Nelson --- dependencies/CASE-unstable | 2 +- dependencies/CASE-unstable-2.0.0 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies/CASE-unstable b/dependencies/CASE-unstable index 0210da11..9f0ff051 160000 --- a/dependencies/CASE-unstable +++ b/dependencies/CASE-unstable @@ -1 +1 @@ -Subproject commit 0210da11b4c049385b787d0c1f54018fe34a132c +Subproject commit 9f0ff0513b4da21f316ccb5e56586123871ba4d9 diff --git a/dependencies/CASE-unstable-2.0.0 b/dependencies/CASE-unstable-2.0.0 index 55751b7c..d2861afd 160000 --- a/dependencies/CASE-unstable-2.0.0 +++ b/dependencies/CASE-unstable-2.0.0 @@ -1 +1 @@ -Subproject commit 55751b7cedd6bcb67ba819f79e1038f26b2bb9b6 +Subproject commit d2861afdbd6d5c732eb248215ef2645489b06505 From e4e9fbfd80abe499dc7674f5fed8d5b58e2aeb1e Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 5 Jun 2024 08:23:20 -0400 Subject: [PATCH 4/4] Regenerate Make-managed files References: * https://github.com/ucoProject/UCO/issues/602 * https://github.com/ucoProject/UCO/pull/607 Signed-off-by: Alex Nelson --- ontology/CASE-unstable-2.0.0.ttl | 123 +++++++++++++++++++++++++------ ontology/CASE-unstable.ttl | 123 +++++++++++++++++++++++++------ 2 files changed, 200 insertions(+), 46 deletions(-) diff --git a/ontology/CASE-unstable-2.0.0.ttl b/ontology/CASE-unstable-2.0.0.ttl index e1abdca9..5e57e92c 100644 --- a/ontology/CASE-unstable-2.0.0.ttl +++ b/ontology/CASE-unstable-2.0.0.ttl @@ -18361,38 +18361,48 @@ types:Dictionary ; rdfs:subClassOf core:UcoInherentCharacterizationThing ; rdfs:label "Dictionary"@en ; - rdfs:comment "A dictionary is list of (term/key, value) pairs with each term/key existing no more than once."@en ; + rdfs:comment "A dictionary is list of (term/key, value) pairs with each term/key having an expectation to exist no more than once. types:Dictionary alone does not validate this expectation, but validation is available. For use cases where this expectation must be validated, the subclass types:ProperDictionary should be used instead of types:Dictionary. For instances where this expectation has been found to be violated, the subclass types:ImproperDictionary should be used instead of types:Dictionary."@en ; rdfs:isDefinedBy ; - rdfs:seeAlso [ - a sh:NodeShape ; - rdfs:comment "This anonymous shape is attached to types:Dictionary with rdfs:seeAlso in order to associate a warning-severity SPARQL-based shape, that will only be necessary as an independent shape until UCO 2.0.0."@en ; - sh:severity sh:Warning ; - sh:sparql [ - a sh:SPARQLConstraint ; - sh:message "A key in a dictionary can appear no more than once."@en ; - sh:select """ - PREFIX types: - SELECT $this ?value - WHERE { - $this - types:entry/types:key ?value ; - . - } - GROUP BY ?value - HAVING (COUNT(?value) > 1) - """ ; - ] ; - sh:targetClass types:Dictionary ; - ] ; sh:property [ sh:class types:DictionaryEntry ; - sh:minCount "1"^^xsd:integer ; sh:nodeKind sh:IRI ; sh:path types:entry ; ] ; sh:targetClass types:Dictionary ; . +types:Dictionary-keyUniqueness-shape + a sh:NodeShape ; + sh:description "This shape is separated from the types:Dictionary class-shape in order to associate a warning-severity SPARQL-based shape."@en ; + sh:severity sh:Warning ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "A key in a dictionary should appear no more than once. The value literal does. Please consider using the types:ImproperDictionary class and types:repeatsKey property."@en ; + sh:select """ + PREFIX types: + SELECT $this ?value + WHERE { + $this + types:entry/types:key ?value ; + . + FILTER NOT EXISTS { + $this + a types:ImproperDictionary ; + . + } + FILTER NOT EXISTS { + $this + a types:ProperDictionary ; + . + } + } + GROUP BY ?value + HAVING (COUNT(?value) > 1) + """ ; + ] ; + sh:targetClass types:Dictionary ; + . + types:DictionaryEntry a owl:Class , @@ -18491,11 +18501,64 @@ types:Identifier rdfs:comment "An identifier is a string conformant to the specified UUID-based format for UCO object identifiers."@en ; . +types:ImproperDictionary + a + owl:Class , + sh:NodeShape + ; + rdfs:subClassOf types:Dictionary ; + rdfs:label "ImproperDictionary"@en ; + owl:disjointWith types:ProperDictionary ; + sh:property [ + sh:datatype xsd:string ; + sh:nodeKind sh:Literal ; + sh:path types:repeatsKey ; + ] ; + sh:targetClass types:ImproperDictionary ; + . + +types:ImproperDictionary-disjointWith-ProperDictionary-shape + a sh:NodeShape ; + sh:message "types:ImproperDictionary and types:ProperDictionary are disjoint classes."@en ; + sh:not [ + a sh:NodeShape ; + sh:class types:ProperDictionary ; + ] ; + sh:targetClass types:ImproperDictionary ; + . + types:NativeFormatString a rdfs:Datatype ; rdfs:comment "Specifies data in its native format of some external language. The data may be encoded in Base64 per [RFC4648]. Data encoded in Base64 must be denoted as such using the encoded property."@en ; . +types:ProperDictionary + a + owl:Class , + sh:NodeShape + ; + rdfs:subClassOf types:Dictionary ; + rdfs:label "ProperDictionary"@en ; + rdfs:comment "A proper dictionary is list of (term/key, value) pairs with each term/key existing no more than once."@en ; + owl:disjointWith types:ImproperDictionary ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "A key in a proper dictionary can appear no more than once."@en ; + sh:select """ + PREFIX types: + SELECT $this ?value + WHERE { + $this + types:entry/types:key ?value ; + . + } + GROUP BY ?value + HAVING (COUNT(?value) > 1) + """ ; + ] ; + sh:targetClass types:ProperDictionary ; + . + types:StructuredText a rdfs:Datatype ; rdfs:comment "Expresses string-based data in some information structuring format (e.g., HTML5)."@en ; @@ -18591,6 +18654,20 @@ types:key rdfs:range xsd:string ; . +types:repeatsKey + a owl:DatatypeProperty ; + rdfs:label "repeatsKey"@en ; + rdfs:comment "A key found to be repeated in multiple dictionary entries within one dictionary."@en ; + rdfs:domain types:ImproperDictionary ; + rdfs:range xsd:string ; + . + +types:repeatsKey-subjects-shape + a sh:NodeShape ; + sh:class types:ImproperDictionary ; + sh:targetSubjectsOf types:repeatsKey ; + . + types:threadNextItem a owl:ObjectProperty ; rdfs:subPropertyOf types:threadSuccessor ; diff --git a/ontology/CASE-unstable.ttl b/ontology/CASE-unstable.ttl index ca4bff79..5e3bc29a 100644 --- a/ontology/CASE-unstable.ttl +++ b/ontology/CASE-unstable.ttl @@ -18355,38 +18355,48 @@ types:Dictionary ; rdfs:subClassOf core:UcoInherentCharacterizationThing ; rdfs:label "Dictionary"@en ; - rdfs:comment "A dictionary is list of (term/key, value) pairs with each term/key existing no more than once."@en ; + rdfs:comment "A dictionary is list of (term/key, value) pairs with each term/key having an expectation to exist no more than once. types:Dictionary alone does not validate this expectation, but validation is available. For use cases where this expectation must be validated, the subclass types:ProperDictionary should be used instead of types:Dictionary. For instances where this expectation has been found to be violated, the subclass types:ImproperDictionary should be used instead of types:Dictionary."@en ; rdfs:isDefinedBy ; - rdfs:seeAlso [ - a sh:NodeShape ; - rdfs:comment "This anonymous shape is attached to types:Dictionary with rdfs:seeAlso in order to associate a warning-severity SPARQL-based shape, that will only be necessary as an independent shape until UCO 2.0.0."@en ; - sh:severity sh:Warning ; - sh:sparql [ - a sh:SPARQLConstraint ; - sh:message "A key in a dictionary can appear no more than once."@en ; - sh:select """ - PREFIX types: - SELECT $this ?value - WHERE { - $this - types:entry/types:key ?value ; - . - } - GROUP BY ?value - HAVING (COUNT(?value) > 1) - """ ; - ] ; - sh:targetClass types:Dictionary ; - ] ; sh:property [ sh:class types:DictionaryEntry ; - sh:minCount "1"^^xsd:integer ; sh:nodeKind sh:IRI ; sh:path types:entry ; ] ; sh:targetClass types:Dictionary ; . +types:Dictionary-keyUniqueness-shape + a sh:NodeShape ; + sh:description "This shape is separated from the types:Dictionary class-shape in order to associate a warning-severity SPARQL-based shape."@en ; + sh:severity sh:Warning ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "A key in a dictionary should appear no more than once. The value literal does. Please consider using the types:ImproperDictionary class and types:repeatsKey property."@en ; + sh:select """ + PREFIX types: + SELECT $this ?value + WHERE { + $this + types:entry/types:key ?value ; + . + FILTER NOT EXISTS { + $this + a types:ImproperDictionary ; + . + } + FILTER NOT EXISTS { + $this + a types:ProperDictionary ; + . + } + } + GROUP BY ?value + HAVING (COUNT(?value) > 1) + """ ; + ] ; + sh:targetClass types:Dictionary ; + . + types:DictionaryEntry a owl:Class , @@ -18485,11 +18495,64 @@ types:Identifier rdfs:comment "An identifier is a string conformant to the specified UUID-based format for UCO object identifiers."@en ; . +types:ImproperDictionary + a + owl:Class , + sh:NodeShape + ; + rdfs:subClassOf types:Dictionary ; + rdfs:label "ImproperDictionary"@en ; + owl:disjointWith types:ProperDictionary ; + sh:property [ + sh:datatype xsd:string ; + sh:nodeKind sh:Literal ; + sh:path types:repeatsKey ; + ] ; + sh:targetClass types:ImproperDictionary ; + . + +types:ImproperDictionary-disjointWith-ProperDictionary-shape + a sh:NodeShape ; + sh:message "types:ImproperDictionary and types:ProperDictionary are disjoint classes."@en ; + sh:not [ + a sh:NodeShape ; + sh:class types:ProperDictionary ; + ] ; + sh:targetClass types:ImproperDictionary ; + . + types:NativeFormatString a rdfs:Datatype ; rdfs:comment "Specifies data in its native format of some external language. The data may be encoded in Base64 per [RFC4648]. Data encoded in Base64 must be denoted as such using the encoded property."@en ; . +types:ProperDictionary + a + owl:Class , + sh:NodeShape + ; + rdfs:subClassOf types:Dictionary ; + rdfs:label "ProperDictionary"@en ; + rdfs:comment "A proper dictionary is list of (term/key, value) pairs with each term/key existing no more than once."@en ; + owl:disjointWith types:ImproperDictionary ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "A key in a proper dictionary can appear no more than once."@en ; + sh:select """ + PREFIX types: + SELECT $this ?value + WHERE { + $this + types:entry/types:key ?value ; + . + } + GROUP BY ?value + HAVING (COUNT(?value) > 1) + """ ; + ] ; + sh:targetClass types:ProperDictionary ; + . + types:StructuredText a rdfs:Datatype ; rdfs:comment "Expresses string-based data in some information structuring format (e.g., HTML5)."@en ; @@ -18587,6 +18650,20 @@ types:key rdfs:range xsd:string ; . +types:repeatsKey + a owl:DatatypeProperty ; + rdfs:label "repeatsKey"@en ; + rdfs:comment "A key found to be repeated in multiple dictionary entries within one dictionary."@en ; + rdfs:domain types:ImproperDictionary ; + rdfs:range xsd:string ; + . + +types:repeatsKey-subjects-shape + a sh:NodeShape ; + sh:class types:ImproperDictionary ; + sh:targetSubjectsOf types:repeatsKey ; + . + types:threadNextItem a owl:ObjectProperty ; rdfs:subPropertyOf types:threadSuccessor ;