-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from owlapy.owl_ontology import Ontology | ||
from owlapy.owl_ontology_manager import OntologyManager | ||
from dicee.knowledge_graph_embeddings import KGE | ||
|
||
# LF: for now functions same as normal OntologyManager (+ can return path) | ||
class NeuralOntologyManager(OntologyManager): | ||
def __init__(self, world_store=None): | ||
super().__init__(world_store) | ||
|
||
def load_ontology(self, path: str = None) -> Ontology: | ||
self._path = path | ||
return super().load_ontology(path) | ||
|
||
def load_neural_embedding(self, path: str = None): | ||
self._path_neural_embedding = path | ||
return KGE(path) | ||
|
||
def get_path(self) -> str: | ||
if hasattr(self, '_path'): | ||
return self._path | ||
else: | ||
return None | ||
|
||
def get_path_neural_embedding(self) -> str: | ||
if hasattr(self, '_path_neural_embedding'): | ||
return self._path_neural_embedding | ||
else: | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters