From 607381a5d412c0a5144f231b100b9240f08f91da Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 9 May 2023 11:07:31 -0400 Subject: [PATCH 1/2] Refine inherence documentation Signed-off-by: Alex Nelson --- case_utils/inherent_uuid.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/case_utils/inherent_uuid.py b/case_utils/inherent_uuid.py index 058de59..2a3bcb9 100644 --- a/case_utils/inherent_uuid.py +++ b/case_utils/inherent_uuid.py @@ -93,11 +93,11 @@ ) -def inherence_uuid(n_uco_thing: URIRef, *args: Any, **kwargs: Any) -> uuid.UUID: +def inherence_uuid(n_thing: URIRef, *args: Any, **kwargs: Any) -> uuid.UUID: """ - This function returns a UUIDv5 for any UcoThing, that can be used as a UUID Namespace in further `uuid.uuidv5` calls. + This function returns a UUIDv5 for any OWL Thing, that can be used as a UUID Namespace in further `uuid.uuidv5` calls. - In the case that the UcoThing ends with a UUID, that UUID string will be returned wrapped in a UUID object. In all other cases, a UUID version 5 object will be returned for the node as a name under the URL namespace [#rfc4122ac]_. + In the case that the Thing is a UcoThing that ends with a UUID, that UUID string will be returned wrapped in a UUID object. In all other cases, a UUID version 5 object will be returned for the Thing as a name under the URL namespace [#rfc4122ac]_. References ========== @@ -123,7 +123,7 @@ def inherence_uuid(n_uco_thing: URIRef, *args: Any, **kwargs: Any) -> uuid.UUID: >>> case_homepage_uuid_namespace UUID('2c6406b7-3396-5fdd-b9bf-c6e21273e40a') """ - node_iri = str(n_uco_thing) + node_iri = str(n_thing) if len(node_iri) < 40 or RX_UUID.search(node_iri) is None: # <40 -> Too short to have a UUID and scheme. return uuid.uuid5(uuid.NAMESPACE_URL, node_iri) @@ -138,7 +138,7 @@ def facet_inherence_uuid( **kwargs: Any ) -> uuid.UUID: """ - :param n_facet_class: This node is expected to be the `rdflib.term.URIRef` for an OWL Class that is either in UCO or extends a class in UCO, such as `case_utils.namespace.NS_UCO_OBSERVABLE.FileFacet`. The Facet class SHOULD be a 'leaf' class - that is, it should have no OWL subclasses. (This 'SHOULD' might become a more stringent requirement in the future. uco-core:Facet must not be used. There is some question on how this rule should apply for uco-observable:WifiAddressFacet and its parent class uco-observable:MACAddressFacet.) + :param n_facet_class: This node is expected to be the `rdflib.term.URIRef` for an OWL Class that is either in UCO or extends a class in UCO, such as `case_utils.namespace.NS_UCO_OBSERVABLE.FileFacet`. The Facet class SHOULD be a 'leaf' class - that is, it should have no OWL subclasses. (This 'SHOULD' might become a more stringent requirement in the future. uco-core:Facet MUST not be used. There is some question on how this rule should apply for uco-observable:WifiAddressFacet and its parent class uco-observable:MACAddressFacet.) :type n_facet_class: rdflib.term.URIRef """ From 6da50dbe19794c9b5d293b8bd83fc364f341a4d3 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 9 May 2023 11:28:47 -0400 Subject: [PATCH 2/2] Bump versions Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- case_utils/case_file/__init__.py | 2 +- case_utils/inherent_uuid.py | 2 +- case_utils/ontology/src/ontology_and_version_iris.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index 9d281a0..a9456fb 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -11,6 +11,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.10.0" +__version__ = "0.11.0" from . import local_uuid # noqa: F401 diff --git a/case_utils/case_file/__init__.py b/case_utils/case_file/__init__.py index 536e7fb..051e07d 100644 --- a/case_utils/case_file/__init__.py +++ b/case_utils/case_file/__init__.py @@ -15,7 +15,7 @@ This module creates a graph object that provides a basic UCO characterization of a single file. The gathered metadata is among the more "durable" file characteristics, i.e. characteristics that would remain consistent when transferring a file between locations. """ -__version__ = "0.4.0" +__version__ = "0.5.0" import argparse import datetime diff --git a/case_utils/inherent_uuid.py b/case_utils/inherent_uuid.py index 2a3bcb9..667a8d1 100644 --- a/case_utils/inherent_uuid.py +++ b/case_utils/inherent_uuid.py @@ -54,7 +54,7 @@ >>> assert str(n_file_facet)[-36:] == str(n_file_facet_2)[-36:] """ -__version__ = "0.0.3" +__version__ = "0.1.0" import binascii import re diff --git a/case_utils/ontology/src/ontology_and_version_iris.py b/case_utils/ontology/src/ontology_and_version_iris.py index e85f0ff..f0139ed 100644 --- a/case_utils/ontology/src/ontology_and_version_iris.py +++ b/case_utils/ontology/src/ontology_and_version_iris.py @@ -15,7 +15,7 @@ This script creates a list of all ontology and version IRIs that have ever existed in a CDO ontology to describe a CDO ontology. I.e. the subject of triples with owl:Ontology as predicate are included, as are the objects of version-referencing triples (owl:versionIRI, owl:incompatibleWith, etc.). """ -__version__ = "0.1.0" +__version__ = "0.1.1" import argparse import typing