Of course, WikiPathways already has a OpenAPI and it's more powerful than we can do based on just the WikiPathways RDF (for various reasons), but the advantage is that you can expose any SPARQL query (see the examples at rdf.wikipathways.org) on the WikiPathways end point. As explained in July, you only have to set up a magic GitHub repository, and Chris suggested to show how this could be used to mimick some of the existing API methods.
The magic
The magic is defined in this GitHub repository, which currently exposes a single method:
#+ summary: Lists Organisms
#+ endpoint_in_url: False
#+ endpoint: http://sparql.wikipathways.org/
#+ tags:
#+ - Organism list
PREFIX rdfs:
PREFIX wp:
SELECT DISTINCT (str(?label) as ?organism)
WHERE {
?concept wp:organism ?organism ;
wp:organismName ?label .
}
The result
I run grlc in the normal way and point it to egonw/wp-rdf-api and the result looks like:
And executing the method in this GUI (click the light blue bar of the method), results in a nice CSV reply:
Of course, because there is SPARQL behind each method, you can make any query you like, creating any OpenAPI methods that fit your data analysis workflow.



No comments:
Post a Comment