Skip to content

Commit

Permalink
Merge branch 'develop-2.0.0' into Feature-Issue-563-2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnelson-nist committed Dec 1, 2023
2 parents 429cfa7 + 0c2240c commit 9f97b45
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 145 deletions.
18 changes: 7 additions & 11 deletions ontology/uco/observable/observable.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@prefix location: <https://ontology.unifiedcyberontology.org/uco/location/> .
@prefix observable: <https://ontology.unifiedcyberontology.org/uco/observable/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pattern: <https://ontology.unifiedcyberontology.org/uco/pattern/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
Expand Down Expand Up @@ -3203,12 +3204,11 @@ observable:File

observable:File-disjointWith-URL-shape
a sh:NodeShape ;
sh:message "observable:File and observable:URL are disjoint classes. Assigning both types to a single node will be an error in UCO 2.0.0."@en ;
sh:message "observable:File and observable:URL are disjoint classes."@en ;
sh:not [
a sh:NodeShape ;
sh:class observable:URL ;
] ;
sh:severity sh:Warning ;
sh:targetClass observable:File ;
.

Expand Down Expand Up @@ -5039,7 +5039,10 @@ observable:ObservablePattern
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf observable:Observable ;
rdfs:subClassOf
observable:Observable ,
pattern:Pattern
;
rdfs:label "ObservablePattern"@en ;
rdfs:comment "An observable pattern is a grouping of characteristics unique to a logical pattern composed of observable object and observable action properties."@en ;
sh:targetClass observable:ObservablePattern ;
Expand Down Expand Up @@ -8887,12 +8890,6 @@ observable:WindowsThreadFacet
rdfs:label "WindowsThreadFacet"@en ;
rdfs:comment "A Windows thread facet is a grouping os characteristics unique to a single thread of execution within a Windows process."@en ;
sh:property
[
sh:datatype xsd:dateTime ;
sh:maxCount "1"^^xsd:integer ;
sh:nodeKind sh:Literal ;
sh:path observable:creationTime ;
] ,
[
sh:datatype xsd:dateTime ;
sh:maxCount "1"^^xsd:integer ;
Expand Down Expand Up @@ -10238,9 +10235,8 @@ observable:creationTime-deprecation-shape
sh:property [
a sh:PropertyShape ;
sh:maxCount "0"^^xsd:integer ;
sh:message "observable:creationTime is deprecated, and will be an error to use in UCO 2.0.0. observable:observableCreatedTime should be used instead."@en ;
sh:message "observable:creationTime is deprecated, and an error to use as of UCO 2.0.0. observable:observableCreatedTime should be used instead."@en ;
sh:path observable:creationTime ;
sh:severity sh:Warning ;
] ;
sh:targetSubjectsOf observable:creationTime ;
.
Expand Down
4 changes: 2 additions & 2 deletions ontology/uco/types/types.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ types:Thread
;
rdfs:subClassOf
co:Bag ,
core:UcoThing
core:UcoInherentCharacterizationThing
;
rdfs:label "Thread"@en ;
rdfs:comment "A semi-ordered array of items, that can be present in multiple copies. Implemetation of a UCO Thread is similar to a Collections Ontology List, except a Thread may fork and merge - that is, one of its members may have two or more direct successors, and two or more direct predecessors."@en ;
Expand All @@ -202,7 +202,7 @@ types:ThreadItem
;
rdfs:subClassOf
co:Item ,
core:UcoThing
core:UcoInherentCharacterizationThing
;
rdfs:label "ThreadItem"@en ;
rdfs:comment "A ThreadItem is a member of a thread."@en ;
Expand Down
8 changes: 4 additions & 4 deletions tests/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ all: \
database_records_PASS_validation.ttl \
database_records_XFAIL_validation.ttl \
event_XFAIL_validation.ttl \
file_url_PASS_validation.ttl \
file_url_XFAIL_validation.ttl \
has_facet_inverse_functional_PASS_validation.ttl \
has_facet_inverse_functional_XFAIL_validation.ttl \
hash_PASS_validation.ttl \
Expand All @@ -37,7 +37,7 @@ all: \
location_XFAIL_validation.ttl \
message_thread_PASS_validation.ttl \
message_thread_XFAIL_validation.ttl \
observable_creation_time_PASS_validation.ttl \
observable_creation_time_XFAIL_validation.ttl \
owl_axiom_PASS_validation.ttl \
owl_axiom_XFAIL_validation.ttl \
owl_properties_PASS_validation.ttl \
Expand Down Expand Up @@ -99,7 +99,7 @@ check: \
database_records_PASS_validation.ttl \
database_records_XFAIL_validation.ttl \
event_XFAIL_validation.ttl \
file_url_PASS_validation.ttl \
file_url_XFAIL_validation.ttl \
has_facet_inverse_functional_PASS_validation.ttl \
has_facet_inverse_functional_XFAIL_validation.ttl \
hash_PASS_validation.ttl \
Expand All @@ -108,7 +108,7 @@ check: \
location_XFAIL_validation.ttl \
message_thread_PASS_validation.ttl \
message_thread_XFAIL_validation.ttl \
observable_creation_time_PASS_validation.ttl \
observable_creation_time_XFAIL_validation.ttl \
owl_axiom_PASS_validation.ttl \
owl_axiom_XFAIL_validation.ttl \
owl_properties_PASS_validation.ttl \
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

[]
a sh:ValidationReport ;
sh:conforms "true"^^xsd:boolean ;
sh:conforms "false"^^xsd:boolean ;
sh:result [
a sh:ValidationResult ;
sh:focusNode <http://example.org/kb/Thing-23a38d67-3432-458b-9651-955b418c2a77> ;
sh:resultMessage "observable:File and observable:URL are disjoint classes. Assigning both types to a single node will be an error in UCO 2.0.0."@en ;
sh:resultSeverity sh:Warning ;
sh:resultMessage "observable:File and observable:URL are disjoint classes."@en ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:NotConstraintComponent ;
sh:sourceShape observable:File-disjointWith-URL-shape ;
sh:value <http://example.org/kb/Thing-23a38d67-3432-458b-9651-955b418c2a77> ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@

[]
a sh:ValidationReport ;
sh:conforms "true"^^xsd:boolean ;
sh:conforms "false"^^xsd:boolean ;
sh:result [
a sh:ValidationResult ;
sh:focusNode <http://example.org/kb/windows-thread-facet-4967ae35-f00b-49c8-9dd2-38e3bdf851e1> ;
sh:resultMessage "observable:creationTime is deprecated, and will be an error to use in UCO 2.0.0. observable:observableCreatedTime should be used instead."@en ;
sh:resultMessage "observable:creationTime is deprecated, and an error to use as of UCO 2.0.0. observable:observableCreatedTime should be used instead."@en ;
sh:resultPath observable:creationTime ;
sh:resultSeverity sh:Warning ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
sh:sourceShape [
a sh:PropertyShape ;
sh:maxCount "0"^^xsd:integer ;
sh:message "observable:creationTime is deprecated, and will be an error to use in UCO 2.0.0. observable:observableCreatedTime should be used instead."@en ;
sh:message "observable:creationTime is deprecated, and an error to use as of UCO 2.0.0. observable:observableCreatedTime should be used instead."@en ;
sh:path observable:creationTime ;
sh:severity sh:Warning ;
] ;
] ;
.
Expand Down
21 changes: 6 additions & 15 deletions tests/examples/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,10 @@ def test_event_XFAIL() -> None:
}
)

def test_file_url_PASS_validation() -> None:
def test_file_url_XFAIL_validation() -> None:
confirm_validation_results(
"file_url_PASS_validation.ttl",
True,
expected_focus_node_severities={
("http://example.org/kb/Thing-23a38d67-3432-458b-9651-955b418c2a77", str(NS_SH.Warning)),
}
"file_url_XFAIL_validation.ttl",
False,
)

def test_has_facet_inverse_functional_PASS() -> None:
Expand Down Expand Up @@ -383,16 +380,10 @@ def test_message_thread_PASS_validation() -> None:
def test_message_thread_XFAIL_validation() -> None:
confirm_validation_results("message_thread_XFAIL_validation.ttl", False)

def test_observable_creation_time_PASS() -> None:
def test_observable_creation_time_XFAIL() -> None:
confirm_validation_results(
"observable_creation_time_PASS_validation.ttl",
True,
expected_focus_node_severities={
(
"http://example.org/kb/windows-thread-facet-4967ae35-f00b-49c8-9dd2-38e3bdf851e1",
str(NS_SH.Warning)
)
}
"observable_creation_time_XFAIL_validation.ttl",
False,
)

def test_owl_axiom_PASS() -> None:
Expand Down

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions tests/shapes/test_qc_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@
@pytest.mark.parametrize(
["filename", "expected_validation_result", "expected_focus_values"],
[
(
"examples_uco_qc/co_Collection_core_UcoObject_XFAIL_validation.ttl",
False,
{
(
URIRef("http://example.org/ontology/IPAddressRoute"),
URIRef("http://example.org/ontology/IPAddressRoute"),
)
}
),
(
"examples_uco_owl/owl_incompatibleWith_shape_PASS_validation.ttl",
True,
Expand Down

0 comments on commit 9f97b45

Please sign in to comment.