Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more recognised keys to tripper.convert #206

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tripper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
FNO,
FOAF,
MAP,
OTEIO,
OWL,
RDF,
RDFS,
Expand All @@ -40,6 +41,7 @@
"FNO",
"FOAF",
"MAP",
"OTEIO",
"OWL",
"RDF",
"RDFS",
Expand Down
8 changes: 8 additions & 0 deletions tripper/convert/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
DCTERMS,
EMMO,
MAP,
OTEIO,
OWL,
RDF,
RDFS,
Expand Down Expand Up @@ -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,
}


Expand Down
7 changes: 4 additions & 3 deletions tripper/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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#")
Expand Down
Loading