Using the Ontology Lookup Service (OLS) API
1
0
Entering edit mode
4 weeks ago
longoka ▴ 40

Does anyone have experience formatting API calls to the Ontology Lookup Service (OLS)?

The Ontology Lookup Service Swagger API documentation

For example, I've been trying to retrieve the graph (and its terms) for the EFO ontology term for diabetic retinopathy (EFO_0003770) using the following statement, but I'm getting a 200 error code:

curl -X 'GET' 'https://www.ebi.ac.uk/ols4/api/ontologies/EFO/terms/EFO_0003770/graph?lang=en' -H 'accept: application/json'

Where am I going wrong? Any help appreciated.

API OLS • 251 views
ADD COMMENT
0
Entering edit mode
4 weeks ago
longoka ▴ 40

This is a version of the GET request that appears to work:

https://www.ebi.ac.uk/ols4/api/ontologies/efo/terms/http%253A%252F%252Fwww.ebi.ac.uk%252Fefo%252FEFO_0003770/graph
ADD COMMENT
0
Entering edit mode

I figured it out; the extended URI needs to be double-encoded.

For example, a colon ':' is '%253A' and a forward slash '/' is '%252F'

Then the call works.

ADD REPLY

Login before adding your answer.

Traffic: 1597 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6