## Thursday, October 15, 2009

### SPARQL end points, Jena and bif:contains

I have been having fun with SPARQL in Bioclipse for a while now, and blogged at several occasions:
One thing I had not been able to work out, is that Virtuoso uses a (rather nice) bif:contains extension that support indexing. However, Jena would complain with:
com.hp.hpl.jena.query.QueryParseException: Line 1, column 31: Unresolved
prefixed name: bif:contains
Defining the prefix did not solve the problem either, but Ivan Mikhailov just replied to my post to the virtuoso-user mailing list providing the solution.

The solution is in the fact that bif: is in its own namespace, which makes it possible to replace bif:contains by its full reference <bif:contains>. I directly gave that a try in Bioclipse, and just succesfull ran this Bioclipse script snippet:
rdf.sparqlRemote(
"http://bio2rdf.org/sparql",
"SELECT * WHERE {?s ?p ?o . ?o <bif:contains> \"aspirin\" .};"
);

Thanx, Ivan!