From b7ea21037909aa19db15a478b9211df69f3700b1 Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Thu, 2 May 2024 18:08:30 +0200 Subject: [PATCH] Added more recognised keys to tripper.convert --- tripper/__init__.py | 2 ++ tripper/convert/convert.py | 8 ++++++++ tripper/namespace.py | 7 ++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tripper/__init__.py b/tripper/__init__.py index 8811aa64..0b40addf 100644 --- a/tripper/__init__.py +++ b/tripper/__init__.py @@ -15,6 +15,7 @@ FNO, FOAF, MAP, + OTEIO, OWL, RDF, RDFS, @@ -40,6 +41,7 @@ "FNO", "FOAF", "MAP", + "OTEIO", "OWL", "RDF", "RDFS", diff --git a/tripper/convert/convert.py b/tripper/convert/convert.py index fb67860a..344c60a5 100644 --- a/tripper/convert/convert.py +++ b/tripper/convert/convert.py @@ -10,6 +10,7 @@ DCTERMS, EMMO, MAP, + OTEIO, OWL, RDF, RDFS, @@ -48,6 +49,13 @@ "label": RDFS.label, "comment": RDFS.comment, "mapsTo": MAP.mapsTo, + "dataresource": OTEIO.DataResourceStrategy, + "parse": OTEIO.ParseStrategy, # add to ontology + "generate": OTEIO.GenerateStrategy, # add to ontology + "mapping": OTEIO.MappingStrategy, + "function": OTEIO.FunctionStrategy, + "transformation": OTEIO.TransformationStrategy, + "configuration": OTEIO.Configuration, } diff --git a/tripper/namespace.py b/tripper/namespace.py index f272999c..31799611 100644 --- a/tripper/namespace.py +++ b/tripper/namespace.py @@ -154,6 +154,7 @@ def _update_iris(self, triplestore=None, reload=False, format=None): def _get_cachefile(self) -> "Path": """Return path to cache file for this namespace.""" + # pylint: disable=too-many-function-args name = self._iri.rstrip("#/").rsplit("/", 1)[-1] hashno = hashlib.shake_128(self._iri.encode()).hexdigest(5) return get_cachedir() / f"{name}-{hashno}.cache" @@ -259,9 +260,9 @@ def get_cachedir(create=True) -> Path: FNO = Namespace("https://w3id.org/function/ontology#") # EMMO = Namespace("http://w3id.org/emmo#") -# MAP = Namespace("http://w3id.org/domain-mappings#") -# DM = Namespace("http://w3id.org/datamodel#") -# OTEIO = Namespace("http://w3id.org/oteio#") +# MAP = Namespace("http://w3id.org/emmo/domain/mappings#") +# DM = Namespace("http://w3id.org/emmo/domain/datamodel#") +# OTEIO = Namespace("http://w3id.org/emmo/domain/oteio#") EMMO = Namespace("http://emmo.info/emmo#") MAP = Namespace("http://emmo.info/domain-mappings#") DM = Namespace("http://emmo.info/datamodel#")