From 4379ca9fde49751fa8b3512b5f103fd44c7e52c0 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 5 Jun 2024 07:59:05 -0400 Subject: [PATCH 1/2] Classify AlternateDataStream and test for gufo:Type instantiations among exemplars No effects were observed on Make-managed files. References: * https://github.com/ucoProject/UCO/issues/590 Signed-off-by: Alex Nelson --- ontology/uco-gufo.ttl | 8 ++++++++ tests/exemplars.ttl | 9 +++++++++ tests/test_exemplar_coverage.py | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/ontology/uco-gufo.ttl b/ontology/uco-gufo.ttl index db86ce5..ab9da11 100644 --- a/ontology/uco-gufo.ttl +++ b/ontology/uco-gufo.ttl @@ -205,6 +205,10 @@ uco-identity:Person ; . +uco-observable:AlternateDataStream + a gufo:Kind ; + . + uco-observable:BluetoothAddressFacet a drafting:SpecificFacetType ; . @@ -216,6 +220,10 @@ uco-observable:Device ; . +uco-observable:FileSystemObject + a gufo:Category ; + . + uco-observable:MACAddressFacet a drafting:GeneralFacetType ; . diff --git a/tests/exemplars.ttl b/tests/exemplars.ttl index c7786a8..5235b73 100644 --- a/tests/exemplars.ttl +++ b/tests/exemplars.ttl @@ -29,6 +29,15 @@ kb:Action-13c91d40-9ca0-4558-81a1-4f7db888c371 gufo:hasEndPointInXSDDateTimeStamp "2021-02-03T04:05:06Z"^^xsd:dateTimeStamp ; . +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 ; + . + kb:BluetoothAddress-53c6bc31-4f9c-4ca7-96cb-c9c61d7e4ca2 a uco-observable:BluetoothAddress ; uco-core:hasFacet diff --git a/tests/test_exemplar_coverage.py b/tests/test_exemplar_coverage.py index a6ce568..7e0ff06 100644 --- a/tests/test_exemplar_coverage.py +++ b/tests/test_exemplar_coverage.py @@ -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 @@ -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() @@ -66,6 +68,22 @@ def test_exemplar_coverage() -> None: assert isinstance(triple[0], URIRef) classes_mapped.add(triple[0]) + gufo_type_query = """\ +PREFIX 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 = """\ From 9ccdc955759b8e7301b381c9c0aae5a8e27ce3d6 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 21 Jun 2024 10:49:15 -0400 Subject: [PATCH 2/2] Align AlternateDataStream as a subclass of gufo:Object No effects were observed on Make-managed files. Reported-by: Paul Brandt Signed-off-by: Alex Nelson --- ontology/uco-gufo.ttl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ontology/uco-gufo.ttl b/ontology/uco-gufo.ttl index 3144894..af74787 100644 --- a/ontology/uco-gufo.ttl +++ b/ontology/uco-gufo.ttl @@ -220,6 +220,10 @@ uco-identity:Person uco-observable:AlternateDataStream a gufo:Kind ; + rdfs:subClassOf + drafting:Endurant , + gufo:Object + ; . uco-observable:BluetoothAddressFacet