Skip to content

Commit

Permalink
Merge pull request #8 from ucoProject/classify_ntfs_ads
Browse files Browse the repository at this point in the history
Classify AlternateDataStream and test for gufo:Type instantiations among exemplars
  • Loading branch information
plbt5 authored Jun 21, 2024
2 parents 91878fc + 9ccdc95 commit 87b7f22
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ontology/uco-gufo.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ uco-identity:Person
;
.

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

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

uco-observable:FileSystemObject
a gufo:Category ;
.

uco-observable:MACAddressFacet
a drafting:GeneralFacetType ;
.
Expand Down
9 changes: 9 additions & 0 deletions tests/exemplars.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,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 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 87b7f22

Please sign in to comment.