Skip to content

Commit

Permalink
Merge branch 'develop-2.0.0' into Feature-Issue-544
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnelson-nist committed Dec 8, 2023
2 parents b5aaed1 + 3173779 commit 55598d5
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 1 deletion.
11 changes: 11 additions & 0 deletions ontology/uco/action/action.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ action:Action
rdfs:subClassOf core:Perdurant ;
rdfs:label "Action"@en ;
rdfs:comment "An action is something that may be done or performed."@en ;
owl:disjointWith core:Event ;
sh:property
[
sh:class action:Action ;
Expand Down Expand Up @@ -150,6 +151,16 @@ action:Action
sh:targetClass action:Action ;
.

action:Action-disjointWith-Event-shape
a sh:NodeShape ;
sh:message "action:Action and core:Event are disjoint classes."@en ;
sh:not [
a sh:NodeShape ;
sh:class core:Event ;
] ;
sh:targetClass action:Action ;
.

action:ActionArgumentFacet
a
owl:Class ,
Expand Down
71 changes: 71 additions & 0 deletions ontology/uco/core/core.ttl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@prefix action: <https://ontology.unifiedcyberontology.org/uco/action/> .
@prefix core: <https://ontology.unifiedcyberontology.org/uco/core/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
Expand All @@ -16,6 +17,11 @@
owl:versionIRI core:1.2.0 ;
.

action:Action
a owl:Class ;
rdfs:isDefinedBy <https://ontology.unifiedcyberontology.org/uco/types> ;
.

core:Annotation
a
owl:Class ,
Expand Down Expand Up @@ -195,6 +201,45 @@ core:Endurant-disjointWith-Perdurant
sh:targetClass core:Endurant ;
.

core:Event
a
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf core:UcoObject ;
rdfs:label "Event"@en ;
rdfs:comment "An Event is a noteworthy occurrence (something that happens or might happen)."@en ;
owl:disjointWith action:Action ;
sh:property
[
sh:class core:UcoObject ;
sh:nodeKind sh:IRI ;
sh:path core:eventContext ;
] ,
[
sh:class types:Dictionary ;
sh:nodeKind sh:IRI ;
sh:path core:eventAttribute ;
] ,
[
sh:datatype xsd:dateTime ;
sh:nodeKind sh:Literal ;
sh:path core:endTime ;
] ,
[
sh:datatype xsd:dateTime ;
sh:nodeKind sh:Literal ;
sh:path core:startTime ;
] ,
[
sh:datatype xsd:string ;
sh:nodeKind sh:Literal ;
sh:path core:eventType ;
]
;
sh:targetClass core:Event ;
.

core:ExternalReference
a
owl:Class ,
Expand Down Expand Up @@ -559,6 +604,27 @@ core:endTime
rdfs:range xsd:dateTime ;
.

core:eventAttribute
a owl:ObjectProperty ;
rdfs:label "Event Attribute"@en ;
rdfs:comment "An event attribute specifies an ad-hoc attribute/value for an event."@en ;
rdfs:range types:Dictionary ;
.

core:eventContext
a owl:ObjectProperty ;
rdfs:label "Event Context"@en ;
rdfs:comment "An event context describes the association of actions and objects relating to an event."@en ;
rdfs:range core:UcoObject ;
.

core:eventType
a owl:DatatypeProperty ;
rdfs:label "Event Type"@en ;
rdfs:comment "An event type specifies a classification type for the event."@en ;
rdfs:range xsd:string ;
.

core:externalIdentifier
a owl:DatatypeProperty ;
rdfs:label "externalIdentifier"@en ;
Expand Down Expand Up @@ -738,6 +804,11 @@ core:value
rdfs:range xsd:string ;
.

types:Dictionary
a owl:Class ;
rdfs:isDefinedBy <https://ontology.unifiedcyberontology.org/uco/types> ;
.

[]
a owl:AllDisjointClasses ;
owl:members (
Expand Down
4 changes: 3 additions & 1 deletion 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 @@ -5040,7 +5041,8 @@ observable:ObservablePattern
;
rdfs:subClassOf
core:Endurant ,
observable:Observable
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 ;
Expand Down
2 changes: 2 additions & 0 deletions tests/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ all: \
configuration_setting_XFAIL_validation.ttl \
database_records_PASS_validation.ttl \
database_records_XFAIL_validation.ttl \
event_XFAIL_validation.ttl \
file_url_XFAIL_validation.ttl \
has_facet_inverse_functional_PASS_validation.ttl \
has_facet_inverse_functional_XFAIL_validation.ttl \
Expand Down Expand Up @@ -97,6 +98,7 @@ check: \
configuration_setting_XFAIL_validation.ttl \
database_records_PASS_validation.ttl \
database_records_XFAIL_validation.ttl \
event_XFAIL_validation.ttl \
file_url_XFAIL_validation.ttl \
has_facet_inverse_functional_PASS_validation.ttl \
has_facet_inverse_functional_XFAIL_validation.ttl \
Expand Down
28 changes: 28 additions & 0 deletions tests/examples/event_XFAIL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"@context": {
"kb": "http://example.org/kb/",
"action": "https://ontology.unifiedcyberontology.org/uco/action/",
"core": "https://ontology.unifiedcyberontology.org/uco/core/",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@graph": [
{
"@id": "kb:Action-0-03ee1fe6-12cf-4a35-b7dd-06d4e69369b5",
"@type": [
"action:Action",
"core:Event"
],
"rdfs:comment": "This node will trigger an XFAIL for designating itself an Action and Event, which are disjoint classes."
},
{
"@id": "kb:Action-1-763c1ff2-d18d-427b-aa82-30d90701a644",
"@type": "action:Action",
"rdfs:comment": "This node should pass validation."
},
{
"@id": "kb:Event-1-ee9450b6-3535-473d-984d-17a91408a54f",
"@type": "event:Event",
"rdfs:comment": "This node should pass validation."
}
]
}
21 changes: 21 additions & 0 deletions tests/examples/event_XFAIL_validation.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@prefix action: <https://ontology.unifiedcyberontology.org/uco/action/> .
@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#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

[]
a sh:ValidationReport ;
sh:conforms "false"^^xsd:boolean ;
sh:result [
a sh:ValidationResult ;
sh:focusNode <http://example.org/kb/Action-0-03ee1fe6-12cf-4a35-b7dd-06d4e69369b5> ;
sh:resultMessage "action:Action and core:Event are disjoint classes."@en ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:NotConstraintComponent ;
sh:sourceShape action:Action-disjointWith-Event-shape ;
sh:value <http://example.org/kb/Action-0-03ee1fe6-12cf-4a35-b7dd-06d4e69369b5> ;
] ;
.

9 changes: 9 additions & 0 deletions tests/examples/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@ def test_database_records_XFAIL() -> None:
}
)

def test_event_XFAIL() -> None:
confirm_validation_results(
"event_XFAIL_validation.ttl",
False,
expected_focus_node_severities = {
("http://example.org/kb/Action-0-03ee1fe6-12cf-4a35-b7dd-06d4e69369b5", str(NS_SH.Violation)),
}
)

def test_file_url_XFAIL_validation() -> None:
confirm_validation_results(
"file_url_XFAIL_validation.ttl",
Expand Down

0 comments on commit 55598d5

Please sign in to comment.