From eb0fa2e315f655382007067df698622b0634c4b5 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 19 Aug 2022 17:40:17 -0400 Subject: [PATCH] Apply semi-open vocabulary patterns This is a downstream application of two proposals: * UCO CP-100 implemented the suggested-value enforcement pattern for semi-open vocabularies. This was a part of UCO 0.8.0. * UCO Issue 406 adjusted the implementation pattern from UCO CP-100 to account for an OWL requirement on `rdf:List` usage. This has been approved for UCO 1.0.0. A third proposal adjusting the CASE vocabulary namespace, UCO Issue 435, would also apply, but has not had an approval vote yet. Due to vote and other Git logistics, that will be handled separately. References: * [UCO OC-12] (CP-100) UCO's idea of "Open vocabulary" does not agree with its implementation with owl:oneOf * https://github.com/ucoProject/UCO/issues/406 * https://github.com/ucoProject/UCO/issues/435 Signed-off-by: Alex Nelson --- ontology/investigation/investigation.ttl | 38 +++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/ontology/investigation/investigation.ttl b/ontology/investigation/investigation.ttl index 6e2d233..beee31f 100644 --- a/ontology/investigation/investigation.ttl +++ b/ontology/investigation/investigation.ttl @@ -140,9 +140,39 @@ investigation:Investigation ] , [ sh:datatype vocabulary:InvestigationFormVocab ; + sh:message "Value is outside the default vocabulary InvestigationFormVocab." ; + sh:path investigation:investigationForm ; + sh:severity sh:Info ; + ] , + [ sh:maxCount "1"^^xsd:integer ; sh:minCount "1"^^xsd:integer ; sh:nodeKind sh:Literal ; + sh:or ( + [ + sh:datatype vocabulary:InvestigationFormVocab ; + ] + [ + sh:datatype xsd:string ; + ] + ) ; + sh:path investigation:investigationForm ; + ] , + [ + sh:message "Value is not member of the vocabulary InvestigationFormVocab." ; + sh:or ( + [ + sh:datatype vocabulary:InvestigationFormVocab ; + sh:in ( + "case"^^vocabulary:InvestigationFormVocab + "incident"^^vocabulary:InvestigationFormVocab + "suspicious-activity"^^vocabulary:InvestigationFormVocab + ) ; + ] + [ + sh:datatype xsd:string ; + ] + ) ; sh:path investigation:investigationForm ; ] ; @@ -266,7 +296,13 @@ investigation:investigationForm a owl:DatatypeProperty ; rdfs:label "investigationForm"@en ; rdfs:comment "A label categorizing a type of investigation (case, incident, suspicious-activity, etc.)"@en ; - rdfs:range vocabulary:InvestigationFormVocab ; + rdfs:range [ + a rdfs:Datatype ; + owl:unionOf ( + vocabulary:InvestigationFormVocab + xsd:string + ) ; + ] ; . investigation:investigationStatus