Open lgatto opened 8 years ago
Here's probably a more correct example, where I want to search for the has_part
property with id BFO:0000051
curl 'http://www.ebi.ac.uk/ols/beta/api/ontologies/go/properties/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_0000051' -i -H 'Accept: application/json'
HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
Date: Sun, 03 Jan 2016 22:59:22 GMT
Connection: close
Content-Length: 0
There is possibly progress, moving from an Internal Server Error
to a Bad Request
...
If you are using the term/property URI in the URL then you need to double URL encode the URI.
curl 'http://www.ebi.ac.uk/ols/beta/api/ontologies/go/properties/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FBFO_0000051' -i -H 'Accept: application/json'
Any of these alternatives would also work depending on the type of id you have.
http://www.ebi.ac.uk/ols/beta/api/ontologies/go/properties?iri=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_0000051 http://www.ebi.ac.uk/ols/beta/api/ontologies/go/properties?short_form=BFO_0000051 http://www.ebi.ac.uk/ols/beta/api/ontologies/go/properties?obo_id=BFO:0000051
I'll fix the error messages, it shouldn't be returning a 500.
Thanks.
Is there a way to get all properties of an ontology, along the lines of GET /api/ontologies/{ontology_id}/terms
? Or all properties associated with a term? It looks like config/definitionProperties
and config/hierarchicalProperties
would be were to look for this information, but I can't figure out where to go from there.
To get properties of an ontology, try api/ontologies/{ontology}/properties
, so for example http://www.ebi.ac.uk/ols/beta/api/ontologies/aeo/properties should return all properties as json that are displayed if you browse to http://www.ebi.ac.uk/ols/beta/ontologies/aeo and click on "property view".
In addition, information on properties associated to a term are embedded as links in the JSON that comes back on a term.
See http://www.ebi.ac.uk/ols/beta/api/ontologies/uberon/terms?iri=http://purl.obolibrary.org/obo/UBERON_0002107 has part_of, develops_from etc links
Thanks @LLTommy and @simonjupp, very helpful.
Regarding the embedded link properties, is there a way to tell property links form other links, other than excluding those that are clearly not, such as self
, graph
, jstree
, children
, descendants
, parents
, ancestors
(and possibly others)? Are these other links properties or could they represent other features?
Or, another possibility would be to first extract all the properties in an ontology and then identify the property links in the term by matching the link names in the property labels.
That's a good point. There isn't a good way to distinguish these. I guess they are all relationships apart from /graph and /jstree. Both of these are alternate serialisations and shouldn't be an endpoint but rather something you access using a different content type.
I think I'll change this in the next release so that /graph and /jstree links are removed from the json output. Then all you have are true relationships as links.
It would be useful to make sure it is easily possible to distinguish between links to terms (self
, children
, descendants
, parents
, ancestors
) and links to properties. Maybe using
_links/terms/self
/children
...
and
_links/properties/has_part
/part_of
...
and then, possibly
_links/graphs/jstree
/graph
I am struggling with the properties and individual queries. If I use the example to query a term, that works fine
and
and try to adapt it to properties or individuals, I get errors
Any help would be very much appreciated.