Skip to content

Commit

Permalink
Merge branch 'main' into UCO-Feature-Issue-596, with fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnelson-nist committed Jul 18, 2024
2 parents 5ef29da + a04ce8a commit c8895ad
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dependencies/CDO-Shapes-gufo
63 changes: 63 additions & 0 deletions ontology/uco-gufo.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@prefix uco-analysis: <https://ontology.unifiedcyberontology.org/uco/analysis/> .
@prefix uco-core: <https://ontology.unifiedcyberontology.org/uco/core/> .
@prefix uco-identity: <https://ontology.unifiedcyberontology.org/uco/identity/> .
@prefix uco-location: <https://ontology.unifiedcyberontology.org/uco/location/> .
@prefix uco-observable: <https://ontology.unifiedcyberontology.org/uco/observable/> .
@prefix uco-types: <https://ontology.unifiedcyberontology.org/uco/types/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
Expand Down Expand Up @@ -146,6 +147,7 @@ drafting:Service
gufo:Category ,
owl:Class
;
rdfs:subClassOf uco-observable:Process ;
rdfs:isDefinedBy <https://github.com/ucoProject/UCO/issues/596> ;
.

Expand Down Expand Up @@ -263,6 +265,13 @@ uco-core:Item
;
.

uco-core:Relationship
rdfs:subClassOf
drafting:Endurant ,
gufo:Object
;
.

uco-core:endTime
rdfs:seeAlso
gufo:hasEndPoint ,
Expand Down Expand Up @@ -301,6 +310,21 @@ uco-identity:Person
;
.

uco-location:Location
rdfs:subClassOf
drafting:Endurant ,
gufo:Object
;
.

uco-observable:AlternateDataStream
a gufo:Kind ;
rdfs:subClassOf
drafting:Endurant ,
gufo:Object
;
.

uco-observable:BluetoothAddressFacet
a drafting:SpecificFacetType ;
.
Expand All @@ -312,6 +336,10 @@ uco-observable:Device
;
.

uco-observable:FileSystemObject
a gufo:Category ;
.

uco-observable:MACAddressFacet
a drafting:GeneralFacetType ;
.
Expand All @@ -326,6 +354,7 @@ uco-observable:Software

uco-observable:WindowsService
a gufo:Kind ;
rdfs:subClassOf drafting:Service ;
.

uco-observable:WindowsTask
Expand Down Expand Up @@ -360,3 +389,37 @@ uco-types:Hash
owl:annotatedSubject uco-core:Assertion ;
.

[]
a owl:NegativePropertyAssertion ;
rdfs:comment "If this specialization were introduced, a further specialization would be suggested for gufo:mediates. A demonstration exists among the CASE examples that is incompatible: A Relationship, 'Mapped_Into', that relates two Actions together to demonstrate a lifecycle phase."@en ;
rdfs:seeAlso
<http://example.org/kb/lifecycle_phase-60a55e96-d39e-487e-9b39-3ba96e1ffc7a> ,
<https://github.com/casework/CASE-Examples/tree/dc6f6b901289c1684fd88e25e9bcec925974d155/examples/illustrations/forensic_lifecycle> ,
[
a owl:NegativePropertyAssertion ;
rdfs:comment "gufo:mediates has range gufo:Endurant, but a uco-core:Relationship is permitted to link any UcoObject, including perdurants."@en ;
rdfs:seeAlso
<http://example.org/kb/lifecycle_phase-60a55e96-d39e-487e-9b39-3ba96e1ffc7a> ,
<https://github.com/casework/CASE-Examples/tree/dc6f6b901289c1684fd88e25e9bcec925974d155/examples/illustrations/forensic_lifecycle>
;
owl:assertionProperty rdfs:subPropertyOf ;
owl:sourceInvididual uco-core:source ;
owl:targetInvididual gufo:mediates ;
] ,
[
a owl:NegativePropertyAssertion ;
rdfs:comment "gufo:mediates has range gufo:Endurant, but a uco-core:Relationship is permitted to link any UcoObject, including perdurants."@en ;
rdfs:seeAlso
<http://example.org/kb/lifecycle_phase-60a55e96-d39e-487e-9b39-3ba96e1ffc7a> ,
<https://github.com/casework/CASE-Examples/tree/dc6f6b901289c1684fd88e25e9bcec925974d155/examples/illustrations/forensic_lifecycle>
;
owl:assertionProperty rdfs:subPropertyOf ;
owl:sourceInvididual uco-core:target ;
owl:targetInvididual gufo:mediates ;
]
;
owl:assertionProperty rdfs:subClassOf ;
owl:sourceInvididual uco-core:Relationship ;
owl:targetInvididual gufo:Relator ;
.

34 changes: 34 additions & 0 deletions tests/exemplars.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@prefix uco-analysis: <https://ontology.unifiedcyberontology.org/uco/analysis/> .
@prefix uco-core: <https://ontology.unifiedcyberontology.org/uco/core/> .
@prefix uco-identity: <https://ontology.unifiedcyberontology.org/uco/identity/> .
@prefix uco-location: <https://ontology.unifiedcyberontology.org/uco/location/> .
@prefix uco-observable: <https://ontology.unifiedcyberontology.org/uco/observable/> .
@prefix uco-types: <https://ontology.unifiedcyberontology.org/uco/types/> .
@prefix uco-vocabulary: <https://ontology.unifiedcyberontology.org/uco/vocabulary/> .
Expand All @@ -30,6 +31,15 @@ kb:Action-13c91d40-9ca0-4558-81a1-4f7db888c371
uco-action:startTime "2020-01-02T03:04:05Z"^^xsd:dateTime ;
.

kb:AlternateDataStream-e6ceee40-5614-4740-b08c-d21ce9b2356d
a
uco-observable:AlternateDataStream ,
uco-observable:FileSystemObject
;
rdfs:comment "TODO - The assignment of FileSystemObject is only necessary until UCO Issue 590 is incorporated."@en ;
rdfs:seeAlso <https://github.com/ucoProject/UCO/issues/590> ;
.

kb:AnalyticResult-34fb92db-d576-45a7-9d62-dae04510968f
a uco-analysis:AnalyticResult ;
.
Expand All @@ -55,11 +65,19 @@ kb:Compiler-7ae00fea-f392-4da5-9b07-ea0ee12e27ed
a drafting:Compiler ;
.

kb:ContentData-0571dfb7-889e-4e8c-bec7-47a62ab9286f
a uco-observable:ContentData ;
.

kb:ContentData-179c7e84-f72d-47f7-b6f3-3f4a1f0938bd
a uco-observable:ContentData ;
uco-core:hasFacet kb:ContentDataFacet-a961d865-087b-43bd-ab31-0e33331c5628 ;
.

kb:ContentData-3f13e43a-a3f4-4dcc-8db2-e934b24890ec
a uco-observable:ContentData ;
.

kb:ContentDataFacet-a961d865-087b-43bd-ab31-0e33331c5628
a uco-observable:ContentDataFacet ;
.
Expand Down Expand Up @@ -109,6 +127,10 @@ kb:LinuxTask-45f8dd65-afee-4f48-8d4c-886b5d53cfa3
a drafting:LinuxTask ;
.

kb:Location-c39f5c70-ba6d-44a1-8c6c-426b0372eade
a uco-location:Location ;
.

kb:MACAddressFacet-3b25d05e-a3b0-4828-8b6d-1e08f4d4264f
a uco-observable:MACAddressFacet ;
.
Expand Down Expand Up @@ -147,6 +169,14 @@ kb:QualityValueAttributionSituation-872b7dd1-b49a-4278-bfdf-df507493d63f
gufo:hasEndPoint kb:Instant-c9ae3fce-ddcb-416b-971b-559c2f5bee95 ;
.

kb:Relationship-2be6b54a-a051-499c-9dcd-63d17d813293
a uco-core:Relationship ;
uco-core:isDirectional "true"^^xsd:boolean ;
uco-core:kindOfRelationship "Contained_Within" ;
uco-core:source kb:ContentData-0571dfb7-889e-4e8c-bec7-47a62ab9286f ;
uco-core:target kb:ContentData-3f13e43a-a3f4-4dcc-8db2-e934b24890ec ;
.

kb:ServicePack-fbdc96ef-b634-4869-8cd6-b23d31ff5b18
a drafting:ServicePack ;
.
Expand All @@ -168,6 +198,10 @@ kb:Velocity-62bc6232-b570-45d7-b382-d4e0a36fceb9
gufo:inheresIn kb:Vehicle-c7e910e8-4bed-473e-ad74-3df3eb63cbcc ;
.

kb:WindowsService-ba5cfea3-b6f8-474d-8130-053b752cbc8c
a uco-observable:WindowsService ;
.

kb:WindowsTask-1148ebc4-750b-43f8-a17d-6ba239f62ae7
a uco-observable:WindowsTask ;
.
Expand Down
18 changes: 18 additions & 0 deletions tests/test_exemplar_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from typing import Optional, Set

from rdflib import RDF, RDFS, Graph, URIRef
from rdflib.query import ResultRow

NS_RDF = RDF
NS_RDFS = RDFS
Expand All @@ -34,6 +35,7 @@ def test_exemplar_coverage() -> None:
ontologies) designated a subclass of some C', and each property P
designated a subproperty of some P', C (/P) is used in the exemplars
graph.
For gUFO, instances of a gufo:Type are also included in the review.
"""
exemplar_graph = Graph()
profile_graph = Graph()
Expand Down Expand Up @@ -66,6 +68,22 @@ def test_exemplar_coverage() -> None:
assert isinstance(triple[0], URIRef)
classes_mapped.add(triple[0])

gufo_type_query = """\
PREFIX gufo: <http://purl.org/nemo/gufo#>
SELECT ?nClass
WHERE {
# owl:Class restriction is to not pick up Relators.
?nClass
a owl:Class ;
a/rdfs:subClassOf* gufo:Type ;
.
}
"""
for gufo_type_query_result in tbox_graph.query(gufo_type_query):
assert isinstance(gufo_type_query_result, ResultRow)
assert isinstance(gufo_type_query_result[0], URIRef)
classes_mapped.add(gufo_type_query_result[0])

result: Optional[bool]

class_query = """\
Expand Down

0 comments on commit c8895ad

Please sign in to comment.