From d344226f8d29302d945ce68a9aba3f795ad8b796 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 10 May 2024 10:23:24 -0400 Subject: [PATCH 1/2] Change AlternateDataStream parent class to FileSystemObject A follow-on patch will regenerate Make-managed files. References: * https://github.com/ucoProject/UCO/issues/590 Signed-off-by: Alex Nelson --- ontology/uco/observable/observable.ttl | 10 +--------- tests/examples/alternate_data_stream_PASS.json | 11 +++-------- tests/examples/test_validation.py | 5 +---- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/ontology/uco/observable/observable.ttl b/ontology/uco/observable/observable.ttl index 19fbfaf1..e29bc164 100644 --- a/ontology/uco/observable/observable.ttl +++ b/ontology/uco/observable/observable.ttl @@ -237,17 +237,9 @@ observable:AlternateDataStream owl:Class , sh:NodeShape ; - rdfs:subClassOf observable:ObservableObject ; + rdfs:subClassOf observable:FileSystemObject ; rdfs:label "AlternateDataStream"@en ; rdfs:comment "An alternate data stream is data content stored within an NTFS file that is independent of the standard content stream of the file and is hidden from access by default NTFS file viewing mechanisms."@en ; - rdfs:seeAlso [ - a sh:NodeShape ; - rdfs:comment "This anonymous shape is attached with rdfs:seeAlso in order to associate a warning-severity class constraint, that will only be necessary as an independent shape until UCO 2.0.0."@en ; - sh:class observable:FileSystemObject ; - sh:message "In UCO 2.0.0, uco-observable:AlternateDataStream will be a subclass of uco-observable:FileSystemObject. In preparation for UCO 2.0.0, the additional type uco-observable:FileSystemObject should be assigned to this node."@en ; - sh:severity sh:Warning ; - sh:targetClass observable:AlternateDataStream ; - ] ; sh:targetClass observable:AlternateDataStream ; . diff --git a/tests/examples/alternate_data_stream_PASS.json b/tests/examples/alternate_data_stream_PASS.json index e6abd5bb..deb471ed 100644 --- a/tests/examples/alternate_data_stream_PASS.json +++ b/tests/examples/alternate_data_stream_PASS.json @@ -1,21 +1,16 @@ { "@context": { "kb": "http://example.org/kb/", - "observable": "https://ontology.unifiedcyberontology.org/uco/observable/", - "rdfs": "http://www.w3.org/2000/01/rdf-schema#" + "observable": "https://ontology.unifiedcyberontology.org/uco/observable/" }, "@graph": [ { "@id": "kb:AlternateDataStream-07b3c41a-080c-4916-8375-c18148763e13", - "@type": "observable:AlternateDataStream", - "rdfs:comment": "This node should trigger a sh:Warning from not being a observable:FileSystemObject" + "@type": "observable:AlternateDataStream" }, { "@id": "kb:AlternateDataStream-b2d4968b-4490-4b44-a56b-832058834454", - "@type": [ - "observable:AlternateDataStream", - "observable:FileSystemObject" - ] + "@type": "observable:AlternateDataStream" } ] } diff --git a/tests/examples/test_validation.py b/tests/examples/test_validation.py index 57a55501..977b4db5 100644 --- a/tests/examples/test_validation.py +++ b/tests/examples/test_validation.py @@ -180,10 +180,7 @@ def test_action_result_PASS_validation() -> None: def test_alternate_data_stream_PASS_validation() -> None: confirm_validation_results( "alternate_data_stream_PASS_validation.ttl", - True, - expected_focus_node_severities={ - ("http://example.org/kb/AlternateDataStream-07b3c41a-080c-4916-8375-c18148763e13", str(NS_SH.Warning)), - } + True ) def test_configuration_setting_PASS_validation() -> None: From ec626488efdc3b093314145fd6a146c99a3bf676 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 10 May 2024 10:23:38 -0400 Subject: [PATCH 2/2] Regenerate Make-managed files References: * https://github.com/ucoProject/UCO/issues/590 Signed-off-by: Alex Nelson --- .../alternate_data_stream_PASS_validation.ttl | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tests/examples/alternate_data_stream_PASS_validation.ttl b/tests/examples/alternate_data_stream_PASS_validation.ttl index d13a07eb..33496ff0 100644 --- a/tests/examples/alternate_data_stream_PASS_validation.ttl +++ b/tests/examples/alternate_data_stream_PASS_validation.ttl @@ -1,4 +1,3 @@ -@prefix observable: . @prefix owl: . @prefix rdf: . @prefix rdfs: . @@ -8,21 +7,5 @@ [] a sh:ValidationReport ; sh:conforms "true"^^xsd:boolean ; - sh:result [ - a sh:ValidationResult ; - sh:focusNode ; - sh:resultMessage "In UCO 2.0.0, uco-observable:AlternateDataStream will be a subclass of uco-observable:FileSystemObject. In preparation for UCO 2.0.0, the additional type uco-observable:FileSystemObject should be assigned to this node."@en ; - sh:resultSeverity sh:Warning ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape [ - a sh:NodeShape ; - rdfs:comment "This anonymous shape is attached with rdfs:seeAlso in order to associate a warning-severity class constraint, that will only be necessary as an independent shape until UCO 2.0.0."@en ; - sh:class observable:FileSystemObject ; - sh:message "In UCO 2.0.0, uco-observable:AlternateDataStream will be a subclass of uco-observable:FileSystemObject. In preparation for UCO 2.0.0, the additional type uco-observable:FileSystemObject should be assigned to this node."@en ; - sh:severity sh:Warning ; - sh:targetClass observable:AlternateDataStream ; - ] ; - sh:value ; - ] ; .