Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 590: Change AlternateDataStream parent class to FileSystemObject #605

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions ontology/uco/observable/observable.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
.

Expand Down
11 changes: 3 additions & 8 deletions tests/examples/alternate_data_stream_PASS.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
17 changes: 0 additions & 17 deletions tests/examples/alternate_data_stream_PASS_validation.ttl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@prefix observable: <https://ontology.unifiedcyberontology.org/uco/observable/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
Expand All @@ -8,21 +7,5 @@
[]
a sh:ValidationReport ;
sh:conforms "true"^^xsd:boolean ;
sh:result [
a sh:ValidationResult ;
sh:focusNode <http://example.org/kb/AlternateDataStream-07b3c41a-080c-4916-8375-c18148763e13> ;
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 <http://example.org/kb/AlternateDataStream-07b3c41a-080c-4916-8375-c18148763e13> ;
] ;
.

5 changes: 1 addition & 4 deletions tests/examples/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading