Skip to content

Commit

Permalink
Confirm an InvestigativeAction results in at least one ProvenanceRecord
Browse files Browse the repository at this point in the history
This new shape stemmed from discussion on CASE Issue 136.

As a matter of preserving backwards compatibility, this patch introduces
the shape requiring `ProvenanceRecord`s with a `sh:Warning`-level
severity.  In CASE 2.0.0, this requirement will be strengthened into a
`sh:Violation`.

A separate proposal will be filed with UCO to test the minimum qualified
cardinality OWL structure.  A draft of that syntax review system was
used to test this patch.

This patch adds a version floor for pySHACL to ensure an update in
qualified value shape handling is included, which is necessary for the
new property shape to function when using pySHACL.

Disclaimer:

References:
* RDFLib/pySHACL#213
* #136
* #146

Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
  • Loading branch information
ajnelson-nist committed Jan 23, 2024
1 parent caf5bd3 commit a4802b5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ all: \
.git_submodule_init.done.log \
dependencies/UCO/dependencies/CASE-Utility-SHACL-Inheritance-Reviewer/case_shacl_inheritance_reviewer/__init__.py \
dependencies/UCO/dependencies/CASE-Utility-SHACL-Inheritance-Reviewer/setup.cfg \
dependencies/UCO/requirements.txt
dependencies/UCO/requirements.txt \
requirements.txt
rm -rf venv
$(PYTHON3) -m venv \
venv
Expand All @@ -62,6 +63,9 @@ all: \
source venv/bin/activate \
&& pip install \
--requirement dependencies/UCO/requirements.txt
source venv/bin/activate \
&& pip install \
--requirement requirements.txt
touch $@

check: \
Expand Down
32 changes: 26 additions & 6 deletions ontology/investigation/investigation.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,34 @@ investigation:InvestigativeAction
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf uco-action:Action ;
rdfs:subClassOf
uco-action:Action ,
[
a owl:Restriction ;
owl:onProperty uco-action:result ;
owl:onClass investigation:ProvenanceRecord ;
owl:minQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
]
;
rdfs:label "InvestigativeAction"@en ;
rdfs:comment "An investigative action is something that may be done or performed within the context of an investigation, typically to examine or analyze evidence or other data."@en ;
sh:property [
sh:class investigation:InvestigativeAction ;
sh:nodeKind sh:BlankNodeOrIRI ;
sh:path investigation:wasInformedBy ;
] ;
sh:property
[
sh:class investigation:InvestigativeAction ;
sh:nodeKind sh:BlankNodeOrIRI ;
sh:path investigation:wasInformedBy ;
] ,
[
sh:message "An InvestigativeAction should have a ProvenanceRecord among its results. This will be a requirement in CASE 2.0.0."@en ;
sh:path uco-action:result ;
sh:qualifiedMinCount "1"^^xsd:integer ;
sh:qualifiedValueShape [
a sh:NodeShape ;
sh:class investigation:ProvenanceRecord ;
] ;
sh:severity sh:Warning ;
]
;
sh:targetClass investigation:InvestigativeAction ;
.

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyshacl >= 0.24.0

0 comments on commit a4802b5

Please sign in to comment.