INCATools / INCATools/ontology-access-kit
Feature request: Get all of an ontologies 'own' terms?
- Dominant language
- Python
- Stars
- 198
- Forks
- 35
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 1
Description
I have been using `.entities()`, e.g. from `ProntoImplementation`. But it shows all classes; not the ones that are _owned_ by the ontology. I'm not familiar enough with OWL or RDF to know if there's a standard way to designate which classes are "owned" by the ontology, and which ones are foreign. It feels like it would be very prudent if this existed, though.
I'm guessing that maybe such a thing does not exist, though. Otherwise, I wouldn't see so many `prefix_map` being utilized in a lot of these use cases.
So, perhaps in the absence of any native way to do that in OWL or RDF, we can add a method for this. It would basically be like a wrapper around `.entities()`, with one additional param: `prefix_map`. It'd then call `entities()`, and then filter the results using `prefix_map`.
Can close this issue if nobody wants this, but I think it'd be really nice UX and reduce the lines of code.
---
Bonus if can have some default `prefix_map`s for well known ontologies (I guess you'd pass the ontology name in that case and it could look up the map for you), but I perhaps that is too hard to maintain. I don't imagine there is a good registry for that stuff available that we can access.
Contributor guide
Research direction
Start by locating ProntoImplementation.entities() and reviewing how callers currently apply prefix_map filtering. Determine whether ontology ownership has a defined OWL/RDF interpretation before choosing the method behavior; done means a documented API can return only the requested terms, with tests covering the filtering semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100