webprotege icon indicating copy to clipboard operation
webprotege copied to clipboard

Provide Web APIs to access ontologies in WebProtege

Open tudorache opened this issue 7 years ago • 23 comments

Provide Web APIs (REST, ideally) to:

  • download an ontology
  • get the list of available ontologies
  • upload an ontology
  • replace an ontology

tudorache avatar Mar 10 '17 19:03 tudorache

A rich API would be so powerful. I don't see any indication that there is one.

This has been a great tool for play but an API will make it a truly useful backbone.

Thank you!

A way to get autocompletion suggestions GET /api/#projects/GUID/suggest?query=Prostate

A way to get info about a term including HATEOES to parents and children, synonyms, related terms. GET /api/#projects/GUID/{term/synoym}

ejwinter avatar Apr 29 '19 12:04 ejwinter

is this ever going to be in the works?

rodriguesk avatar Feb 23 '20 22:02 rodriguesk

We from https://github.com/edamontology rely heavily on WebProtégé. An API to

  • create an ontology
  • update an ontology (returning list of changes)

would be extreeemely useful. Otherwise our life is made very difficult, with no CI and CD possible (Continuous Integration and Deployment).

The WebProtégé web frontend has to somehow communicate with the backend. Could that channel be used by 3rd-party applications as some kind of an API?

matuskalas avatar Feb 28 '20 14:02 matuskalas

I can see that WebProtege 3.0.0 tag was removed. Does this mean there is still no API access?? We'd really like to see this happen!! If it did happen is there developer documentation on how to access available?

BreeAnn7 avatar Sep 21 '20 16:09 BreeAnn7

looks like there is an API in current code version, but couldnt find any documentation about it an API, or another method to download and ontology would be very usefull

ronniebrito avatar Jan 19 '21 13:01 ronniebrito

I can see that WebProtege 3.0.0 tag was removed. Does this mean there is still no API access?? We'd really like to see this happen!! If it did happen is there developer documentation on how to access available?

We really need it too! WebProtégé is so amazing and important for us, we just need an API in addition to what it provides (even a very simple API would help)

matuskalas avatar Jan 19 '21 13:01 matuskalas

Any progress on this?

joakimsod avatar Feb 08 '21 20:02 joakimsod

Just being able to export / import an ontology throughh an API would be extremely helpful (and I think for others in this thread, too). Wouldn't it be possible to expose that as a first step, and add more functionality later? I am working on a better integration to convert an existing ontology to graphml to visualize it in yEd...

boris-horner avatar Jul 23 '21 13:07 boris-horner

This is in the works now. We have a project that is funded by BASF to provide a proper Web API and to make WebProtege more extensible.

matthewhorridge avatar Jul 23 '21 15:07 matthewhorridge

Great to hear, thanks for the quick reply. I'll keep an eye on new WebProtégé versions then.

boris-horner avatar Jul 23 '21 16:07 boris-horner

Just being able to export / import an ontology throughh an API would be extremely helpful (and I think for others in this thread, too). Wouldn't it be possible to expose that as a first step, and add more functionality later?

Exactly that! 👆🏽 Pretty please 😊

matuskalas avatar Jul 23 '21 18:07 matuskalas

@matuskalas are you using your own installation of WebProtege?

matthewhorridge avatar Jul 23 '21 18:07 matthewhorridge

This is in the works now. We have a project that is funded by BASF to provide a proper Web API and to make WebProtege more extensible.

Really awesome to hear! 🎉🎆

If you would like to have more folks to test or help shape or specifiy the needs, we the EDAM ontology maintainers would be very happy to help. 🙌🏽

matuskalas avatar Jul 23 '21 18:07 matuskalas

@matuskalas are you using your own installation of WebProtege?

Nope, the public server. Which is important for us, as we don't have the capacity to maintain our own.

matuskalas avatar Jul 23 '21 18:07 matuskalas

This is in the works now. We have a project that is funded by BASF to provide a proper Web API and to make WebProtege more extensible.

I will second @matuskalas! I would be happy to help on shaping out the needs or writing some features of the API.

etiennecl avatar Aug 04 '21 17:08 etiennecl

happy to hear that a Web API. @matthewhorridge is there a planned release date?

Gorogora avatar Oct 20 '21 06:10 Gorogora

Some time early next year for deployment on webprotege.stanford.edu @Gorogora

matthewhorridge avatar Oct 20 '21 18:10 matthewhorridge

Any update on this?

Komposten avatar Jun 10 '22 12:06 Komposten

@matthewhorridge is the API available in any capacity? If not, is there any idea of an updated timeline? Thanks!

rodriguesk avatar Jul 07 '22 16:07 rodriguesk

We also have the same use case: need to use CI/CD to generate ontology doc and publish the validation reference.

By looking in the code I found that it would should be possible to make a key and then use it to download. Then I also found this discussion https://mailman.stanford.edu/pipermail/protege-dev/2020-May/001873.html which seems to confirm this usage.

In my case the key could not be recognized, not sure why. It should be possible to understand - the code is all there.

More importantly, I found that by letting the guest account read a particular project (also done with webprotege-cli), I can download the ontology with a simple GET request and integrate it as I need to. In our case the server is in private network and I do not mind this being unrestricted. Could be some hidden security implications of course due to increased attack surface.

Anyway, the use case is largely solved for us, maybe this approach helps other people too!

volodymyrss avatar Aug 12 '22 14:08 volodymyrss

"Are there any updates on this? Following @volodymyrss's suggestion, I generated an API key using the CLI and associated it with a user. Then, I used this API key to retrieve the project using the code snippet below:

session = requests.Session()
headers = {'Authorization': f'ApiKey {API_KEY}'}
project_url = f"{BASE_URL}/download?project={PROJECT_ID}&format=ttl"
response = session.get(project_url, headers=headers)

However, I got a 403 response and in the WebProtege logs I see the following message:

INFO Received download request from UserId{**guest**} at X for project ProjectId{Y}
INFO Denied download request as the user does not have permission to download this project.

Notice that it says "guest" and not the username that I created the API key for.

Thanks in advance.

asideras avatar Apr 21 '23 10:04 asideras

Notice that it says "guest" and not the username that I created the API key for.

Yes, well, I had to let guest account read a particular project (see I explained in my message). It's not completely ideal, for good for our purposes at least.

volodymyrss avatar Apr 21 '23 10:04 volodymyrss

Any news concerning the API? I am wondering if there is a description of the API - how to use it?

aweissen1 avatar Dec 13 '23 17:12 aweissen1