Dear all,

I experience some problems with query execution over jena. For some reason I
cannot execute the following query to my local TDB:

         String queryString = 
                                "PREFIX
dqm:<http://purl.org/dqm-vocabulary/v1.1/dqm#>" +
                                "PREFIX
xsd:<http://www.w3.org/2001/XMLSchema#>" +
                                "SELECT ?dqr ?i" +
                                "WHERE {" +
                                "?dqr a dqm:PropertyCompletenessRule ." +
                                "?dqr dqm:testedClass ?tclass ." +
                                "?dqr dqm:testedProperty1 ?tprop ." +
                                "?dqr dqm:requiredValue
\"true\"^^xsd:boolean ." +
                                "?dqr dqm:requiredProperty
\"true\"^^xsd:boolean ." +
                                "?tclass dqm:hasURI ?tclassreal ." +
                                "?tprop dqm:hasURI ?tpropreal ." +
                                "BIND (IRI(str(?tpropreal)) AS ?tpropURI) ."
+
                                "BIND (IRI(str(?tclassreal)) AS ?tclassURI)
." +
                                "{" +
                                "?i a ?tclassURI ." +
                                "NOT EXISTS{" +
                                "?i ?tpropURI ?value ." +
                                "}" +
                                "}UNION{" +
                                "?i a ?tclassURI ." +
                                "?i ?tpropURI \"\"." +
                                "}" +
                                "}";    
        String directory = "D:/Fuseki-0.2.0/DB" ;
        Dataset ds = TDBFactory.createDataset(directory) ;
        Query query =
QueryFactory.create(queryString,Syntax.syntaxSPARQL_11);                
        QueryExecution qe = QueryExecutionFactory.create(query, ds);
        ResultSet results = qe.execSelect();
        System.out.print(ResultSetFormatter.asText(results));

When I execute the above code, I receive the following error:

Exception in thread "main" com.hp.hpl.jena.query.QueryParseException:
Encountered " <NOTEXISTS> "NOT EXISTS "" at line 1, column 478.
Was expecting one of:
    <IRIref> ...
    <PNAME_NS> ...
    <PNAME_LN> ...
    <BLANK_NODE_LABEL> ...
    <VAR1> ...
    <VAR2> ...
    "graph" ...
    "optional" ...
    "minus" ...
    "bind" ...
    "service" ...
    "filter" ...
    "true" ...
    "false" ...
    <INTEGER> ...
    <DECIMAL> ...
    <DOUBLE> ...
    <INTEGER_POSITIVE> ...
    <DECIMAL_POSITIVE> ...
    <DOUBLE_POSITIVE> ...
    <INTEGER_NEGATIVE> ...
    <DECIMAL_NEGATIVE> ...
    <DOUBLE_NEGATIVE> ...
    <STRING_LITERAL1> ...
    <STRING_LITERAL2> ...
    <STRING_LITERAL_LONG1> ...
    <STRING_LITERAL_LONG2> ...
    "(" ...
    <NIL> ...
    "{" ...
    "}" ...
    "[" ...
    <ANON> ...
    
        at
com.hp.hpl.jena.sparql.lang.ParserSPARQL11.perform(ParserSPARQL11.java:87)
        at
com.hp.hpl.jena.sparql.lang.ParserSPARQL11.parse(ParserSPARQL11.java:40)
        at com.hp.hpl.jena.query.QueryFactory.parse(QueryFactory.java:132)
        at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:69)
        at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:40)
        at SPARQLTDB.main(SPARQLTDB.java:46)

Other queries without NOT EXISTS work fine. The query also executes on
FUSEKI's query UI without any problems.

Thanks for your help,

Christian 

------------------------------------------
Dipl.-Kfm. Christian Fürber
Professur für Allgemeine BWL, insbesondere E-Business
e-business & web science research group
Universität der Bundeswehr München
 
e-mail: [email protected]
www:   http://www.unibw.de/ebusiness/
skype: c.fuerber
twitter: cfuerber



Reply via email to