VirtualFlyBrain / VFB

Virtual Fly Brain
www.virtualflybrain.org
GNU General Public License v2.0
16 stars 5 forks source link

Add OWL query restful API server #568

Open Robbie1977 opened 9 years ago

Robbie1977 commented 9 years ago

Take manchester syntax query via JSON and return results as JSON

dosumis commented 9 years ago

Here's a more fleshed out version of the draft script I posted on the last ticket. https://gist.github.com/dosumis/ce57643890d331930aee

Should be pretty straightforward to rewrite in Java and to hook it up to an http server allowing queries to be passed as post requests + JSON. Also needs better error handling - returning something useful when the OWL-API throws an error due to a bad query. Typically, this would be an unrecognised entity in a manchester syntax query. In this case the query should return an error message in the status field that includes the ID of the unrecognised entity.

We might want to fold this into a more general API for VFB, with OWL queries returning data from SOLR.

dosumis commented 9 years ago

This service is provided by Aber-OWL:

Example query http://aber-owl.net/service/api/runQuery.groovy?type=subeq&query=overlaps%20some%20%27adult%20antennal%20lobe%27&ontology=FB-BT&labels=true

No support for individuals right now, but have requested. Can point people to this as a way of getting JSON lists of terms relveant for annotation.

We might want to re-use their code locally to run our reasoner. We could ditch all of the Nestor Code for OWL queries in favour of some very compact Groovy scripts.

dosumis commented 9 years ago

https://github.com/bio-ontology-research-group/AberOWL/tree/master/src

dosumis commented 8 years ago

@Robbie1977: We still urgently need an OWL server. Either:

As well as being needed for queries on VFB, this would be extremely useful for back-end scripting, much of which could be switched from Jython to Python 3.

Robbie1977 commented 8 years ago

Got a local Aber-OWL server running - waiting for a query on the sync setup.

running on test machine (via VPN): 129.215.164.244 :3000 is web server :31337 AberOWL server :6379 Redis DB

Once sync is running then you can in theory run the same querys as you showed above here: http://129.215.164.244:31337/api/runQuery.groovy

Would we be looking to sync their ontology copies (as they have fbbt) of load our own directly?

dosumis commented 8 years ago

Would we be looking to sync their ontology copies (as they have fbbt) of load our own directly?

Best to configure just to run ours. Can get their help to do that if not obvious.

dosumis commented 8 years ago

Attempting to load full VFB KB into AberOWL: http://aber-owl.net/ontology/VFB

Ticket claiming support for individuals is here: https://github.com/bio-ontology-research-group/AberOWL/issues/18

dosumis commented 8 years ago

Smaller test KB uploaded here: http://aber-owl.net/ontology/VFB_test

dosumis commented 8 years ago

Some test queries - for once this loaded (taking an age) http://aber-owl.net/service/api/runQuery.groovy?type=realize&query=%3Chttp://purl.obolibrary.org/obo/FBbt_00007683%3E&ontology=VFB_test http://aber-owl.net/service/api/runQuery.groovy?type=realize&direct=false&query=%3Chttp://purl.obolibrary.org/obo/FBbt_00007683%3E&ontology=VFB_test

Robbie1977 commented 8 years ago

behaving the same as the full sized one did for me. time didn't seem to help: http://129.215.164.244:8080/ontology (via ed VPN) http://129.215.164.244:8080/service/api/runQuery.groovy?type=realize&direct=false&query=%3Chttp://purl.obolibrary.org/obo/FBbt_00007683%3E&ontology=VFB Although API is giving no response rather than

java.lang.IllegalArgumentException: URI is not absolute
dosumis commented 8 years ago

Is ontology name as specified during load?

Robbie1977 commented 8 years ago

Fixed http://aber-owl.net/ontology/VFB See https://github.com/bio-ontology-research-group/AberOWL/issues/38