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

How to use Owlery with a Triple Store #141

Open
rpgoldman opened this issue Aug 20, 2021 · 2 comments
Open

How to use Owlery with a Triple Store #141

rpgoldman opened this issue Aug 20, 2021 · 2 comments

Comments

@rpgoldman
Copy link
Contributor

Owlery has solved a big problem for me: making an OpenAPI-accessible server that can answer DL queries.

But now I would like to investigate further the entities that I retrieve from Owlery. E.g., what is the value of some property or properties of an individual I find.

IIUC, one must team Owlery up with a separate SPARQL database to handle this. Is this the correct procedure:

  1. Use an OWL reasoner such as HermiT to expand the ontology to contain explicit assertions that are only implicit in the ontology. I think this is what robot's materialize command is for, but I'm not entirely sure.

  2. Load the resulting ontology file into some SPARQL-capable database. It seems like Apache's Fuseki might be an appropriate choice, although I confess to not having done a lot of comparison shopping.

@balhoff
Copy link
Member

balhoff commented Aug 25, 2021

@rpgoldman I have typically used Owlery as a parallel service to a SPARQL endpoint. I have an application which is querying a SPARQL endpoint for certain information (like labels for certain IRIs), and submits queries to Owlery for reasoner questions. So the integration is all in application code.

Your proposed steps could be independent of Owlery I think. If you are mainly interested in the inferred class hierarchy, and not generating ad hoc class expressions for DL queries, you could materialize rdfs:subClassOf links ahead of time and store in the triple store. Confusingly, you would want ROBOT reason for that. materialize is a bit more specialized; it generates existential relations that aren't explicitly stated in the ontology.

I use Owlery when I want to submit arbitrary user-generated queries like 'bone element' and part_of some skull and develops_from 'endochondral tissue'.

There is a fancier integration between Owlery and a triplestore. You can embed a class expression inside a SPARQL query using an Owlery-specific datatype. Then submit that SPARQL query to Owlery, which will expand the class expression using the reasoner, and inject all the resulting terms into a rewritten query. The response is a new SPARQL query. You then submit that SPARQL query to your triplestore. You can see some examples here: https://github.com/phenoscape/owlet/wiki

@rpgoldman
Copy link
Contributor Author

Thank you very much, @balhoff ! I will have a look at that as soon as possible. Right now I'm still having some trouble with my owlery setup, as witness my earlier query (the novelette I wrote and called an issue!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants