From 120d73d27142e749d5637a6ece7c79cf9235ecd4 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 21 Oct 2022 09:40:58 -0400 Subject: [PATCH 01/14] Bump UCO to remove owl:ontologyIRI concept review No effects were observed on Make-managed files. This patch is done separately from removal of owl:ontologyIRI to show that the tests have no negative impact when the (nonexistent) concept is used in CASE. References: * https://github.com/ucoProject/UCO/issues/491 Signed-off-by: Alex Nelson --- dependencies/UCO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/UCO b/dependencies/UCO index 1ffc719..83f35af 160000 --- a/dependencies/UCO +++ b/dependencies/UCO @@ -1 +1 @@ -Subproject commit 1ffc719e06b81a5d521366f11bd247d390fcad6f +Subproject commit 83f35af75c5d1ac5e9656ecb0ebd4818b6d0eb9a From 48e9d5882f520a37007649a143dccd1b620e3838 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 26 Oct 2022 14:33:39 -0400 Subject: [PATCH 02/14] Trigger CI on all branches starting with "develop" and "unstable" References: * https://github.com/ucoProject/UCO/issues/493 Signed-off-by: Alex Nelson --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86d0c2d..7160391 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,9 +16,9 @@ name: Continuous Integration on: push: - branches: [ master, develop ] + branches: [ master, develop*, unstable* ] pull_request: - branches: [ master, develop ] + branches: [ master, develop*, unstable* ] jobs: build: From 0b99da2d75bc5652cd1027ed8caeb184c3a5b459 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 26 Oct 2022 15:07:22 -0400 Subject: [PATCH 03/14] Remove errant concept owl:ontologyIRI No effects were observed on Make-managed files. References: * https://github.com/ucoProject/UCO/issues/491 Signed-off-by: Alex Nelson --- ontology/investigation/investigation.ttl | 1 - ontology/master/case.ttl | 1 - ontology/vocabulary/vocabulary.ttl | 1 - 3 files changed, 3 deletions(-) diff --git a/ontology/investigation/investigation.ttl b/ontology/investigation/investigation.ttl index 4ea2d26..abdf2b3 100644 --- a/ontology/investigation/investigation.ttl +++ b/ontology/investigation/investigation.ttl @@ -23,7 +23,6 @@ uco-role:1.0.0 ; owl:incompatibleWith investigation:0.7.1 ; - owl:ontologyIRI ; owl:priorVersion investigation:0.7.1 ; owl:versionIRI investigation:1.0.0 ; . diff --git a/ontology/master/case.ttl b/ontology/master/case.ttl index b44dbb5..8748b20 100644 --- a/ontology/master/case.ttl +++ b/ontology/master/case.ttl @@ -22,7 +22,6 @@ ; owl:incompatibleWith ; - owl:ontologyIRI ; owl:priorVersion ; owl:versionIRI ; owl:versionInfo "1.0.0" ; diff --git a/ontology/vocabulary/vocabulary.ttl b/ontology/vocabulary/vocabulary.ttl index 9a6a19a..34a6459 100644 --- a/ontology/vocabulary/vocabulary.ttl +++ b/ontology/vocabulary/vocabulary.ttl @@ -8,7 +8,6 @@ a owl:Ontology ; rdfs:label "vocabularies"@en ; owl:incompatibleWith vocab:0.7.1 ; - owl:ontologyIRI ; owl:priorVersion vocab:0.7.1 ; owl:versionIRI vocab:1.0.0 ; . From 0bfdf2cac2424a9a0f02f9fca20cde7648b5ff05 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 26 Oct 2022 18:11:56 -0400 Subject: [PATCH 04/14] Copy and call test for concept-membership of used design vocabularies References: * https://github.com/casework/CASE/issues/119 Signed-off-by: Alex Nelson --- dependencies/UCO | 2 +- tests/Makefile | 4 ++ tests/test_case_monolithic.py | 95 +++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 tests/test_case_monolithic.py diff --git a/dependencies/UCO b/dependencies/UCO index 83f35af..f8fc784 160000 --- a/dependencies/UCO +++ b/dependencies/UCO @@ -1 +1 @@ -Subproject commit 83f35af75c5d1ac5e9656ecb0ebd4818b6d0eb9a +Subproject commit f8fc784993f8a0185e9a6a7ec26b382fd051c320 diff --git a/tests/Makefile b/tests/Makefile index e7d0760..347005b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -124,6 +124,10 @@ case_monolithic.ttl: \ check: \ inheritance_review.ttl \ case_monolithic.ttl + source venv/bin/activate \ + && pytest \ + --ignore examples \ + --log-level=DEBUG $(MAKE) \ --directory examples \ check diff --git a/tests/test_case_monolithic.py b/tests/test_case_monolithic.py new file mode 100644 index 0000000..83eb869 --- /dev/null +++ b/tests/test_case_monolithic.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 + +# This software was developed at the National Institute of Standards +# and Technology by employees of the Federal Government in the course +# of their official duties. Pursuant to title 17 Section 105 of the +# United States Code this software is not subject to copyright +# protection and is in the public domain. NIST assumes no +# responsibility whatsoever for its use by other parties, and makes +# no guarantees, expressed or implied, about its quality, +# reliability, or any other characteristic. +# +# We would appreciate acknowledgement if the software is used. + +import os +from typing import Generator, Optional, Set + +import pytest +from rdflib import Graph, Namespace, OWL, RDF, RDFS, SH, URIRef + + +@pytest.fixture(scope="module") +def graph() -> Generator[Graph, None, None]: + graph = Graph() + graph.parse(os.path.join(os.path.dirname(__file__), "case_monolithic.ttl")) + assert len(graph) > 0, "Failed to load case_monolithic.ttl." + yield graph + + +def test_rdf_design_vocabularies_defined(graph: Graph) -> None: + """ + (This test is copied verbatim from UCO. Alternative methods of + importing the review from UCO are welcome.) + + This test performs a typo review of RDF-, RDFS-, and OWL-namespaced concepts. + + The mechanism used is rdflib's ClosedNamespace. The imported + objects RDF, RDFS, and OWL are instances of this Python class. + """ + + expected: Set[URIRef] = set() # This set is intentionally empty. + computed: Set[URIRef] = set() + + concepts_used: Set[URIRef] = set() + for triple in graph.triples((None, None, None)): + for triple_member in triple: + if not isinstance(triple_member, URIRef): + continue + concepts_used.add(triple_member) + + OWL_str = str(OWL) + RDF_str = str(RDF) + RDFS_str = str(RDFS) + SH_str = str(SH) + + def _concept_in_design_vocabulary(concept: URIRef) -> Optional[bool]: + """ + Return True -> Concept is defined in some design vocabulary. + Return False -> Concept is not defined in design vocabulary. + Return None -> N/A. + """ + design_vocabulary: Namespace + if concept.startswith(OWL_str): + concept_fragment = concept.replace(OWL_str, "") + design_vocabulary = OWL + elif concept.startswith(RDF_str): + concept_fragment = concept.replace(RDF_str, "") + design_vocabulary = RDF + elif concept.startswith(RDFS_str): + concept_fragment = concept.replace(RDFS_str, "") + design_vocabulary = RDFS + elif concept.startswith(SH_str): + concept_fragment = concept.replace(SH_str, "") + design_vocabulary = SH + else: + return None + + try: + _ = design_vocabulary[concept_fragment] + except AttributeError: + return False + + assert ( + _concept_in_design_vocabulary( + URIRef( + "http://www.w3.org/2002/07/owl#NonExistentConcept-f287fb8b-433b-45a2-82b8-9b53bfa35c64" + ) + ) + is False + ), "ClosedNamespace functionality used in this test did not detect a known-erroneous value. This test needs revising." + + for concept_used in concepts_used: + if _concept_in_design_vocabulary(concept_used) is False: + computed.add(concept_used) + + assert expected == computed From 249c03b8249a03ac3a0fbe6fab5600de48da1aa0 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Thu, 3 Nov 2022 17:07:59 -0400 Subject: [PATCH 05/14] Bump UCO to current state of develop Signed-off-by: Alex Nelson --- dependencies/UCO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/UCO b/dependencies/UCO index 1ffc719..f163c26 160000 --- a/dependencies/UCO +++ b/dependencies/UCO @@ -1 +1 @@ -Subproject commit 1ffc719e06b81a5d521366f11bd247d390fcad6f +Subproject commit f163c2648517d37ca2f4302a514fce7125fcbb2b From 34340aca55bfc005081b04cdf96fe2888913df3d Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 8 Nov 2022 22:09:57 -0500 Subject: [PATCH 06/14] Test monolithic build with SHACL-SHACL No effects were observed on Make-managed files. References: * https://github.com/ucoProject/UCO/issues/504 Signed-off-by: Alex Nelson --- dependencies/UCO | 2 +- tests/Makefile | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dependencies/UCO b/dependencies/UCO index f163c26..85c01d5 160000 --- a/dependencies/UCO +++ b/dependencies/UCO @@ -1 +1 @@ -Subproject commit f163c2648517d37ca2f4302a514fce7125fcbb2b +Subproject commit 85c01d58b842b9e96654a88aa011ca3353070e78 diff --git a/tests/Makefile b/tests/Makefile index e7d0760..462f0b3 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -60,6 +60,7 @@ all: case_monolithic.ttl: \ $(top_srcdir)/.lib.done.log \ + $(top_srcdir)/dependencies/UCO/tests/thing.ttl \ $(case_turtle_files) \ $(uco_turtle_files) \ .shapes.done.log @@ -83,7 +84,17 @@ case_monolithic.ttl: \ --shacl $(top_srcdir)/dependencies/UCO/tests/shapes/uco-closure-qc.ttl \ --shacl-file-format turtle \ ___$@ - # Test has passed; remove closure file. + # Review CASE closure with SHACL-SHACL. + source venv/bin/activate \ + && pyshacl \ + --data-file-format turtle \ + --format turtle \ + --inference none \ + --metashacl \ + --shacl ___$@ \ + --shacl-file-format turtle \ + $(top_srcdir)/dependencies/UCO/tests/thing.ttl + # Closure tests have passed; remove closure file. rm ___$@ # Review CASE for practice conformance. source venv/bin/activate \ From 1b360a7629cd60f1919417cf2b64a98df450017f Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 9 Nov 2022 09:03:39 -0500 Subject: [PATCH 07/14] Bump UCO to current state of develop No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- dependencies/UCO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/UCO b/dependencies/UCO index f163c26..80164ee 160000 --- a/dependencies/UCO +++ b/dependencies/UCO @@ -1 +1 @@ -Subproject commit f163c2648517d37ca2f4302a514fce7125fcbb2b +Subproject commit 80164ee52b16f5d80fc47ce6064802386bcceb42 From 98f146a0d01365807882c296f1a7b590a8492917 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 18 Nov 2022 15:30:44 -0500 Subject: [PATCH 08/14] Bump UCO pointer to incorporate Issue 491 merge References: * https://github.com/ucoProject/UCO/issues/491 Signed-off-by: Alex Nelson --- dependencies/UCO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/UCO b/dependencies/UCO index 83f35af..492edf2 160000 --- a/dependencies/UCO +++ b/dependencies/UCO @@ -1 +1 @@ -Subproject commit 83f35af75c5d1ac5e9656ecb0ebd4818b6d0eb9a +Subproject commit 492edf20a8a09c127239e6aaacba178196e066b6 From 69a76f0813e9cca7787089b5ba9af0bc6f721578 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 18 Nov 2022 15:54:09 -0500 Subject: [PATCH 09/14] Bump UCO pointer to incorporate Issue 488 merge References: * https://github.com/casework/CASE/issues/119 * https://github.com/ucoProject/UCO/issues/488 Signed-off-by: Alex Nelson --- dependencies/UCO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/UCO b/dependencies/UCO index f8fc784..adcfd79 160000 --- a/dependencies/UCO +++ b/dependencies/UCO @@ -1 +1 @@ -Subproject commit f8fc784993f8a0185e9a6a7ec26b382fd051c320 +Subproject commit adcfd799ab1172cad49eb406ec5fd0e22cb9ae2d From c2e484d836ed9297360c8d79dcdb7e4eeb169e5c Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Mon, 21 Nov 2022 13:32:10 -0500 Subject: [PATCH 10/14] Bump UCO to current state of develop No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- dependencies/UCO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/UCO b/dependencies/UCO index adcfd79..d23d435 160000 --- a/dependencies/UCO +++ b/dependencies/UCO @@ -1 +1 @@ -Subproject commit adcfd799ab1172cad49eb406ec5fd0e22cb9ae2d +Subproject commit d23d4353b66399d2a4867fb65ed4ab6362d3614f From 260bdad27d86d4083eb8e477f1b99b4f25ea69f9 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 22 Nov 2022 11:55:33 -0500 Subject: [PATCH 11/14] Bump UCO pointer to 1.1.0 pre-release Signed-off-by: Alex Nelson --- dependencies/UCO | 2 +- ontology/investigation/investigation.ttl | 8 ++++---- ontology/master/case.ttl | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dependencies/UCO b/dependencies/UCO index d23d435..2feca34 160000 --- a/dependencies/UCO +++ b/dependencies/UCO @@ -1 +1 @@ -Subproject commit d23d4353b66399d2a4867fb65ed4ab6362d3614f +Subproject commit 2feca34bb15ec2431746b9ced1f657d29e10f290 diff --git a/ontology/investigation/investigation.ttl b/ontology/investigation/investigation.ttl index abdf2b3..897d43d 100644 --- a/ontology/investigation/investigation.ttl +++ b/ontology/investigation/investigation.ttl @@ -1,6 +1,6 @@ # imports: https://ontology.caseontology.org/case/vocabulary/1.0.0 -# imports: https://ontology.unifiedcyberontology.org/uco/action/1.0.0 -# imports: https://ontology.unifiedcyberontology.org/uco/role/1.0.0 +# imports: https://ontology.unifiedcyberontology.org/uco/action/1.1.0 +# imports: https://ontology.unifiedcyberontology.org/uco/role/1.1.0 @prefix investigation: . @prefix owl: . @@ -19,8 +19,8 @@ rdfs:comment "This ontology defines key concepts, and their associated properties and relationships, for characterizing cyber-investigations in the broadest range of contexts, including security incidents, criminal investigations, civil and regulatory matters, intelligence operations, international disputes, accident inquiries, policy violations, and others." ; owl:imports vocabulary:1.0.0 , - uco-action:1.0.0 , - uco-role:1.0.0 + uco-action:1.1.0 , + uco-role:1.1.0 ; owl:incompatibleWith investigation:0.7.1 ; owl:priorVersion investigation:0.7.1 ; diff --git a/ontology/master/case.ttl b/ontology/master/case.ttl index 8748b20..a6bd32c 100644 --- a/ontology/master/case.ttl +++ b/ontology/master/case.ttl @@ -1,6 +1,6 @@ # imports: https://ontology.caseontology.org/case/investigation/1.0.0 # imports: https://ontology.caseontology.org/case/vocabulary/1.0.0 -# imports: https://ontology.unifiedcyberontology.org/uco/uco/1.0.0 +# imports: https://ontology.unifiedcyberontology.org/uco/uco/1.1.0 @prefix dct: . @prefix owl: . @@ -19,7 +19,7 @@ owl:imports , , - + ; owl:incompatibleWith ; owl:priorVersion ; From 0a8b41d63b6f36a8d3507d6718aed8abde406b18 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 22 Nov 2022 11:58:53 -0500 Subject: [PATCH 12/14] Bump version Signed-off-by: Alex Nelson --- ontology/investigation/investigation.ttl | 10 +++++----- ontology/master/case.ttl | 16 ++++++++-------- ontology/vocabulary/vocabulary.ttl | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ontology/investigation/investigation.ttl b/ontology/investigation/investigation.ttl index 897d43d..4dfcdea 100644 --- a/ontology/investigation/investigation.ttl +++ b/ontology/investigation/investigation.ttl @@ -1,4 +1,4 @@ -# imports: https://ontology.caseontology.org/case/vocabulary/1.0.0 +# imports: https://ontology.caseontology.org/case/vocabulary/1.1.0 # imports: https://ontology.unifiedcyberontology.org/uco/action/1.1.0 # imports: https://ontology.unifiedcyberontology.org/uco/role/1.1.0 @@ -17,14 +17,14 @@ a owl:Ontology ; rdfs:label "investigation"@en ; rdfs:comment "This ontology defines key concepts, and their associated properties and relationships, for characterizing cyber-investigations in the broadest range of contexts, including security incidents, criminal investigations, civil and regulatory matters, intelligence operations, international disputes, accident inquiries, policy violations, and others." ; + owl:backwardCompatibleWith investigation:1.0.0 ; owl:imports - vocabulary:1.0.0 , + vocabulary:1.1.0 , uco-action:1.1.0 , uco-role:1.1.0 ; - owl:incompatibleWith investigation:0.7.1 ; - owl:priorVersion investigation:0.7.1 ; - owl:versionIRI investigation:1.0.0 ; + owl:priorVersion investigation:1.0.0 ; + owl:versionIRI investigation:1.1.0 ; . investigation:Attorney diff --git a/ontology/master/case.ttl b/ontology/master/case.ttl index a6bd32c..2fd7d48 100644 --- a/ontology/master/case.ttl +++ b/ontology/master/case.ttl @@ -1,5 +1,5 @@ -# imports: https://ontology.caseontology.org/case/investigation/1.0.0 -# imports: https://ontology.caseontology.org/case/vocabulary/1.0.0 +# imports: https://ontology.caseontology.org/case/investigation/1.1.0 +# imports: https://ontology.caseontology.org/case/vocabulary/1.1.0 # imports: https://ontology.unifiedcyberontology.org/uco/uco/1.1.0 @prefix dct: . @@ -16,14 +16,14 @@ rdfs:label "case-master"@en ; rdfs:comment "The Cyber-investigation Analysis Standard Expression (CASE) ontology is a community-developed standard that defines concepts used in a broad range of cyber-investigation domains, including digital forensic science, incident response, counter-terrorism, criminal justice, forensic intelligence, and situational awareness. CASE includes all aspects of the digital forensic process, from evidence-gathering and chain of custody, to generating a final report. The goal is to increase sharing and interoperability of cyber-investigation information among organizations and between forensic analytic tools. CASE aligns with and extends the Unified Cyber Ontology (UCO). The preferred namespace abbreviation for this ontology is: case-master."@en ; dct:title "Cyber-investigation Analysis Standard Expression (CASE)"@en ; + owl:backwardCompatibleWith ; owl:imports - , - , + , + , ; - owl:incompatibleWith ; - owl:priorVersion ; - owl:versionIRI ; - owl:versionInfo "1.0.0" ; + owl:priorVersion ; + owl:versionIRI ; + owl:versionInfo "1.1.0" ; . diff --git a/ontology/vocabulary/vocabulary.ttl b/ontology/vocabulary/vocabulary.ttl index 34a6459..9861210 100644 --- a/ontology/vocabulary/vocabulary.ttl +++ b/ontology/vocabulary/vocabulary.ttl @@ -7,9 +7,9 @@ a owl:Ontology ; rdfs:label "vocabularies"@en ; - owl:incompatibleWith vocab:0.7.1 ; - owl:priorVersion vocab:0.7.1 ; - owl:versionIRI vocab:1.0.0 ; + owl:backwardCompatibleWith vocab:1.0.0 ; + owl:priorVersion vocab:1.0.0 ; + owl:versionIRI vocab:1.1.0 ; . vocab:InvestigationFormVocab From 4266be475828a48948c54ee5059fd27d50c27150 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 22 Nov 2022 12:10:21 -0500 Subject: [PATCH 13/14] Log changes Signed-off-by: Alex Nelson --- ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 43c39c3..80ff924 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2022-11-22 + * ONT-491: Release CASE 1.1.0, with release notes at https://caseontology.org/releases/1.1.0/ + +2022-11-18 + * (9922288) Issue 119: Test for concept-membership of used design vocabularies + * (137fff8) UCO Issue 491: Bump UCO to remove owl:ontologyIRI concept review + * (48e9d58) UCO Issue 493: Trigger CI on all branches starting with "develop" and "unstable" + * (ae27b42) UCO Issue 504: Test monolithic build with SHACL-SHACL + 2022-08-31 * ONT-295: Release CASE 1.0.0, with release notes at https://caseontology.org/releases/1.0.0/ * (761b058): Adopt UCO 1.0.0 From 10a7fccbc935445aa36de8c73268364440b9fb1f Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 22 Nov 2022 15:42:35 -0500 Subject: [PATCH 14/14] Bump UCO pointer to 1.1.0 release No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- dependencies/UCO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/UCO b/dependencies/UCO index 2feca34..5f77eb9 160000 --- a/dependencies/UCO +++ b/dependencies/UCO @@ -1 +1 @@ -Subproject commit 2feca34bb15ec2431746b9ced1f657d29e10f290 +Subproject commit 5f77eb9e77204488945151773cf6ab66b918a51e