INCATools / ontology-development-kit

Bootstrap an OBO Library ontology
http://incatools.github.io/ontology-development-kit/
BSD 3-Clause "New" or "Revised" License
219 stars 54 forks source link

add rdflib-endpoint support to ODK? #855

Open matentzn opened 1 year ago

matentzn commented 1 year ago

@gouttegd shared with us some of his experiences with rdflib-endpoint in his amazing OBO Academy tutorial on Protege 5.6.1.

Without voicing your opinion just yet @gouttegd, can you share your recipe here for how to use this for query development use cases etc? Is it hard to install? How to deploy?

gouttegd commented 1 year ago

Not sure adding rdflib-endpoint to the ODK would be useful. rdflib-endpoint works by creating a web server on the localhost, that you can connect to using your web browser.

Running rdflib-endpoint from within an ODK container would confine the web server to that container, where it would not be accessible from the host’s web browser – unless you configure Docker to allow networking between the container and the host, which is doable but adds some noticeable complexity.

rdflib-endpoint is easily installable via PyPI, so I am not too keen on increasing the ODK complexity just to save users a mere python -m pip install rdflib-endpoint

gouttegd commented 1 year ago

As for my “recipe”:

  1. Install rdflib-endpoint:
$ python -m pip install rdflib-endpoint
  1. Start the server with the file you want to query against. Note that rdflib-endpoint does not support XML catalogs AFAIK, so it’s best not to use it against a ODK-style -edit file, otherwise it will get the imports from their actual remote locations and not from the local paths configured in the catalog.
$ rdflib-endpoint serve cl-base.owl
INFO:     📥️ Loaded triples from ../../cl-base.owl, for a total of 71821
INFO:     Started server process [25]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
  1. Point your web browser to the indicated address (http://0.0.0.0:8000) and start querying.

  2. When you’re done, terminate the server by sending a ^C as indicated.