Hi Laurent,

since you are building a single jar out of few other (if I got it right) - could you check the contents of the MATE-INF/service subfolders of the final jar for all the parsing service specific definitions - text files named by the service interface with lines stating specific interface implementations i.e. specifically for a file named META-INF/services/org.openrdf.query.parser.QueryParserFactory with
contents:
org.openrdf.query.parser.sparql.SPARQLParserFactory

if you merge several jars where there is a such file, the last one will override the one from other jars

hope this is of some help

regards,
Damyan

----- Original Message ----- From: "Laurent PELLEGRINO" <laurent.pellegr...@sophia.inria.fr>
To: <owlim-discussion@ontotext.com>
Sent: Monday, July 27, 2009 8:15 PM
Subject: Re: [Owlim-discussion] OWLIM/Sesame and Query parsing


Thanks for your response.

I do same and it works in a JunitTest. However, when I test it in my
global application which link jar and create a JAR of all my classes,
i get the previous Exception.

JAR are in classpath and the problem seems to be the same that the
link I previously referenced.

RepositoryConnection conn = null;
       boolean result = false;

       try {
           conn = this.repository.getConnection();

           try {
result = conn.prepareBooleanQuery(language, query).evaluate();
           } finally {
               conn.close();
           }
       } catch (Exception e) {
           e.printStackTrace();
       }

       return new Boolean(result);

Where language is QueryLanguage.SPARQL and query is equals to "ASK { ?
s ?p ?o }"

Regards,
Laurent

Le 27 juil. 09 à 16:13, Damyan Ognyanoff a écrit :

Hi,

how do you parse the query? The following code works just fine ...

BooleanQuery q = repository.getConnection().prepareBooleanQuery(QueryLanguage.SPARQL, "ASK { ?S a ?C} ");
  System.out.println("result is "+ q.evaluate());

regards,
Damyan


----- Original Message ----- From: "Laurent PELLEGRINO" <laurent.pellegr...@sophia.inria.fr
>
To: <owlim-discussion@ontotext.com>
Sent: Monday, July 27, 2009 4:25 PM
Subject: [Owlim-discussion] OWLIM/Sesame and Query parsing


Dear all,

I am trying to parse and to execute a SPARQL ASK query in my application. When I do that, I get the following exception :

org.openrdf.query.UnsupportedQueryLanguageException: No factory available for query language SPARQL

However all the JAR are in the classpath. It is a known problem ?

I have searched on the web and I have found a similar subject but it dates back to 2007 :
http://www.openrdf.org/forum/mvnforum/viewthread?thread=1410

The solution is to use a more recent Sesame version which corrects this bug. So i have tried with the Sesame 2.3-pr1 version but the problem is always the same.

Does someone has an idea ?

Thanks.

Kind Regards
Laurent

_______________________________________________
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion


_______________________________________________
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion
_______________________________________________
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion

Reply via email to