-
Notifications
You must be signed in to change notification settings - Fork 29
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
.entities()
typedef update
#688
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import logging | ||
from dataclasses import dataclass | ||
from typing import Any, Iterable, List, Mapping, Optional | ||
from typing import Any, Iterable, List, Mapping, Optional, Union | ||
|
||
import rdflib | ||
from funowl import ( | ||
|
@@ -27,7 +27,7 @@ | |
from oaklib.interfaces.basic_ontology_interface import LANGUAGE_TAG | ||
from oaklib.interfaces.owl_interface import OwlInterface, ReasonerConfiguration | ||
from oaklib.interfaces.patcher_interface import PatcherInterface | ||
from oaklib.types import CURIE, PRED_CURIE | ||
from oaklib.types import CURIE, PRED_CURIE, URI | ||
|
||
|
||
@dataclass | ||
|
@@ -97,7 +97,7 @@ def label(self, curie: CURIE, lang: Optional[LANGUAGE_TAG] = None) -> str: | |
else: | ||
raise ValueError(f"Label must be literal, not {label}") | ||
|
||
def entities(self, filter_obsoletes=True, owl_type=None) -> Iterable[CURIE]: | ||
def entities(self, filter_obsoletes=True, owl_type=None) -> Iterable[Union[URI, CURIE]]: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatives?LinkML has There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No The URI and CURIE definition are There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Order of types?This is a super minor thing, but I am going to guess that if there is a Python convention, maybe it should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not matter. |
||
for ax in self._ontology.axioms: | ||
if isinstance(ax, Declaration): | ||
uri = ax.v.full_uri(self.functional_writer.g) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The update
This is a minor update. I just happened to notice that while I was using this for
SqlImplementation
, I was getting back URIs sometimes. I assume this should always be a possible thing for the other implementations as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @joeflack4 !