Kjetil, I guess that you need "define input:default-graph-uri <" + defaultGraph + "> \n"
i.e. < and > around defaultGraph. Best Regards, Ivan Mikhailov OpenLink Software http://virtuoso.openlinksw.com On Tue, 2009-02-24 at 18:47 +0100, Kjetil Kjernsmo wrote: > All, > > To get the Jena RDF/XML-ABBREV syntax, I run some queries through Jena. > I need to set define sql:describe-mode "SPO" and also the default graph URI, > and for the SPARQL endpoint, this is trivially done by setting > DB.DBA.SYS_SPARQL_HOST, and that works great. > > But how do I set it when using JDBC? > > I have tried to pass defines from the code, e.g.: > sparql = QueryFactory.create( > "define sql:describe-mode \"SPO\"\n" + > "define input:default-graph-uri " + defaultGraph > + " \n" + > req.getParameterValues("query")[0]); > > but that seems to cause Jena to croak and say the query is invalid. > > Then, the question is of course whether using JDBC gives me much? I could > just > use the endpoint and then parse and reserialise the result, but that seems > wasteful. > > > Kind regards > > Kjetil Kjernsmo