You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Bardo Nelgen <ma...@bnnperformances.de> on 2013/01/23 00:23:14 UTC

Looking for a more restrictive type of SPARQL validator

Hi all,

for a content inclusion project I recently wrote the following SPARQL 
query, had it validated at http://sparql.org/query-validator.html and 
tested locally with Twinkle 2 –— all doing perfectly well.


> PREFIX html:    <http://www.w3.org/1999/xhtml>
> PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
> PREFIX skos:    <http://www.w3.org/2004/02/skos/core#>
> PREFIX owl:     <http://www.w3.org/2002/07/owl#>
> PREFIX xsd:     <urn:ietf:params:xml:schema:>
> PREFIX dct:     <http://purl.org/dc/terms/>
> PREFIX i18n21:  <http://apache.org/cocoon/i18n/2.1>
> PREFIX xliff:   <urn:oasis:names:tc:xliff:document:1.2>
> PREFIX cnt:     <http://namespaces.semaworx.org/content#>
> PREFIX timed:   <http://namespaces.semaworx.org/timed#>
 >
> CONSTRUCT    {   ?PageIRI            rdf:type            cnt:page    ;
>                                      dct:hasPart         ?Element    .
>                  ?Element            rdf:type            cnt:element    ;
>                                      dct:hasPart         ?ElementPayload    .
>                  ?ElementPayload     rdf:type            timed:versionedElement    ;
>                                      xliff:source        ?StringContent    .
>              }
> WHERE        {   ?PageIRI            cnt:pageID         "semawine_page_home"   ;
>                                      rdf:type            cnt:page    ;
>                                      dct:hasPart         ?Element    .
>                  ?Element            rdf:type            cnt:element    ;
>                                      dct:hasPart         ?ElementPayload    .
>                  ?ElementPayload     rdf:type            timed:versionedElement    ;
>                                      xliff:source        ?StringContent    .
>                       FILTER    (    isLiteral(?StringContent)
>                                ||    langMatches( lang(?StringContent), "de-de" )    )
>              }


Though, just as soon as this very same query runs on our server, 
JENA/ARQ gives me a

> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler

Which is, why I'm looking for a query validator, which evaluates SPARQL 
more similar to the way JENA/ARQ do— internally and which provides 
errors meaningful enough to properly act upon.

Any help, links, tools etc. are very welcome!!

Best,

Bardo





Re: Looking for a more restrictive type of SPARQL validator

Posted by Bardo Nelgen <ma...@bnnperformances.de>.
Hi Andy,

thank you so much for your in-depth look into this — seems we need a 
major upgrade… ;-)

Best,

Bardo


Am 27.01.2013 12:17, schrieb Andy Seaborne:
> On 27/01/13 10:50, Bardo Nelgen wrote:
>>
>> Hi,
>>
>> it admittedly took me some time to get my hands on the JAVA source for
>> this item…
>>
>> Attached the full file (~200 lines) for reference purposes.
>>
>> *Anticipated JENA / ARQ versions*
>>
>> JENA: 2.5.5
>> ARQ: 2.6
>
> December 2008.
>
> While I'm pleaed this stil works for you (mostly) is very, very old.
>
> Note::
> ** import com.hp.hpl.jena.db.DBConnection;
>
> The RDB database is no longer supported and has been removed from the 
> code base after a long deprecation cycle.
>
> ------------
>
> The problem is that the code masks the true exception.
>
> The code at line 170 says:
>
> throw new QueryParseException("can't parse data source – syntax error 
> ? ", 0, 0);
>
> which is different from
>
> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
>
> because "Syntaxfehler" isn't coming from ARQ.
>
> line 167.
> UpdateAction.parseExecute
>
> A CONSTRUCT is not an update operation, it's a query.
>
> But real the problem is that this hides the original query parse 
> exception qpe. There are details in that exception such as line number 
> and column of the error as the validator prints.
>
> 1/ Print the stack trace from qpe / line 164
> 2/ (debug logging) Print the query out as well if qpe occurs.
> 3/ Plan migration to a newer version of ARQ and Jena.
> This isn't going to be trivial with a 4 year jump.
>
> Andy
>
>>
>> The questionable code part goes:
>>
>>> public void generate() throws SAXException, IOException {
>>> worldgraphModel = ModelRDB.open(dbCon, rdfGraph);
>>>
>>> try {
>>> Query query = QueryFactory.read(sourcefileLocation.getURI());
>>> QueryExecution qexec = QueryExecutionFactory.create(query,
>>> worldgraphModel);
>>>
>>> if (query.getQueryType() == Query.QueryTypeSelect) {
>>> Model outputModel =
>>> ModelFactory.createDefaultModel(ReificationStyle.Minimal);
>>> StringWriter sw = new StringWriter();
>>> ResultSet resultSet = qexec.execSelect();
>>> ResultSetFormatter.asRDF(outputModel, resultSet);
>>> outputModel.write(sw, outputType);
>>> outputModel.close();
>>> doSAX(sw.toString());
>>> }
>>>
>>> if (query.getQueryType() == Query.QueryTypeConstruct) {
>>> Model resultModel = qexec.execConstruct();
>>> StringWriter sw = new StringWriter();
>>> resultModel.write(sw, outputType);
>>> resultModel.close();
>>> doSAX(sw.toString());
>>> }
>>>
>>> if (query.getQueryType() == Query.QueryTypeDescribe) {
>>> Model resultModel = qexec.execDescribe();
>>> StringWriter sw = new StringWriter();
>>> resultModel.write(sw, outputType);
>>> resultModel.close();
>>> doSAX(sw.toString());
>>> }
>>>
>>> if (query.getQueryType() == Query.QueryTypeAsk) {
>>> Model outputModel =
>>> ModelFactory.createDefaultModel(ReificationStyle.Minimal);
>>> StringWriter sw = new StringWriter();
>>> boolean resultBool = qexec.execAsk();
>>> ResultSetFormatter.asRDF(outputModel, resultBool);
>>> outputModel.write(sw, outputType);
>>> outputModel.close();
>>> doSAX(sw.toString());
>>> }
>>> qexec.close();
>>> }
>>> catch (QueryParseException qpe) {
>>> worldgraphModel.begin();
>>> try {
>>> UpdateAction.parseExecute(sparqlString, worldgraphModel);
>>> }
>>> catch (QueryParseException upe) {
>>> throw new QueryParseException("can't parse data source – syntax error
>>> ? ", 0, 0);
>>> }
>>> worldgraphModel.commit();
>>> doSAX("<updatesuccess value=\"true\"/>");
>>> }
>>> finally {
>>> worldgraphModel.close();
>>> }
>>> }
>>
>> Note: Had the entire RDF tree validated @ W3C as well before trying.
>>
>> Any idea, what could have gone wrong here?
>>
>> In advance, thanks for all your time and suggestions.
>>
>> Bardo
>>
>>
>>
>>
>>
>>
>>
>>
>> Am 23.01.2013 11:38, schrieb Andy Seaborne:
>>> On 23/01/13 10:28, Bardo Nelgen wrote:
>>>>
>>>> Hi Andy,
>>>>
>>>> thanks for the fast reply and thank you very much for the hint.
>>>>
>>>> I'll send a copy of this to our programmers then. Just originally
>>>> assumed the error resided inside the SPARQLing (I'm just the 
>>>> markup-guy…
>>>> ;-) )
>>>>
>>>> Nonetheless, here comes the stacktrace (short version):
>>>>
>>>>> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
>>>>> at com.semaworx.ARQGenerator.generate(ARQGenerator.java:170)
>>>
>>> Time to look at line 170 of the (non-Jena) class ARQGenerator!
>>>
>>> Looks like it is throwing the exception (maybe because it caught an
>>> execption from Jena) but "Syntaxfehler" isn't from Jena. So it may be
>>> hiding the details.
>>>
>>> (and which version of Jena are you running?)
>>>
>>> Andy
>>>
>>>
>>
>
>



Re: Looking for a more restrictive type of SPARQL validator

Posted by Andy Seaborne <an...@apache.org>.
On 27/01/13 10:50, Bardo Nelgen wrote:
>
> Hi,
>
> it admittedly took me some time to get my hands on the JAVA source for
> this item…
>
> Attached the full file (~200 lines) for reference purposes.
>
> *Anticipated JENA / ARQ versions*
>
> JENA: 2.5.5
> ARQ: 2.6

December 2008.

While I'm pleaed this stil works for you (mostly) is very, very old.

Note::
** import com.hp.hpl.jena.db.DBConnection;

The RDB database is no longer supported and has been removed from the 
code base after a long deprecation cycle.

------------

The problem is that the code masks the true exception.

The code at line 170 says:

throw new QueryParseException("can't parse data source – syntax error ? 
", 0, 0);

which is different from

com.hp.hpl.jena.query.QueryParseException: Syntaxfehler

because "Syntaxfehler" isn't coming from ARQ.

line 167.
UpdateAction.parseExecute

A CONSTRUCT is not an update operation, it's a query.

But real the problem is that this hides the original query parse 
exception qpe.  There are details in that exception such as line number 
and column of the error as the validator prints.

1/ Print the stack trace from qpe / line 164
2/ (debug logging) Print the query out as well if qpe occurs.
3/ Plan migration to a newer version of ARQ and Jena.
    This isn't going to be trivial with a 4 year jump.

	Andy

>
> The questionable code part goes:
>
>> public void generate() throws SAXException, IOException {
>> worldgraphModel = ModelRDB.open(dbCon, rdfGraph);
>>
>> try {
>> Query query = QueryFactory.read(sourcefileLocation.getURI());
>> QueryExecution qexec = QueryExecutionFactory.create(query,
>> worldgraphModel);
>>
>> if (query.getQueryType() == Query.QueryTypeSelect) {
>> Model outputModel =
>> ModelFactory.createDefaultModel(ReificationStyle.Minimal);
>> StringWriter sw = new StringWriter();
>> ResultSet resultSet = qexec.execSelect();
>> ResultSetFormatter.asRDF(outputModel, resultSet);
>> outputModel.write(sw, outputType);
>> outputModel.close();
>> doSAX(sw.toString());
>> }
>>
>> if (query.getQueryType() == Query.QueryTypeConstruct) {
>> Model resultModel = qexec.execConstruct();
>> StringWriter sw = new StringWriter();
>> resultModel.write(sw, outputType);
>> resultModel.close();
>> doSAX(sw.toString());
>> }
>>
>> if (query.getQueryType() == Query.QueryTypeDescribe) {
>> Model resultModel = qexec.execDescribe();
>> StringWriter sw = new StringWriter();
>> resultModel.write(sw, outputType);
>> resultModel.close();
>> doSAX(sw.toString());
>> }
>>
>> if (query.getQueryType() == Query.QueryTypeAsk) {
>> Model outputModel =
>> ModelFactory.createDefaultModel(ReificationStyle.Minimal);
>> StringWriter sw = new StringWriter();
>> boolean resultBool = qexec.execAsk();
>> ResultSetFormatter.asRDF(outputModel, resultBool);
>> outputModel.write(sw, outputType);
>> outputModel.close();
>> doSAX(sw.toString());
>> }
>> qexec.close();
>> }
>> catch (QueryParseException qpe) {
>> worldgraphModel.begin();
>> try {
>> UpdateAction.parseExecute(sparqlString, worldgraphModel);
>> }
>> catch (QueryParseException upe) {
>> throw new QueryParseException("can't parse data source – syntax error
>> ? ", 0, 0);
>> }
>> worldgraphModel.commit();
>> doSAX("<updatesuccess value=\"true\"/>");
>> }
>> finally {
>> worldgraphModel.close();
>> }
>> }
>
> Note: Had the entire RDF tree validated @ W3C as well before trying.
>
> Any idea, what could have gone wrong here?
>
> In advance, thanks for all your time and suggestions.
>
> Bardo
>
>
>
>
>
>
>
>
> Am 23.01.2013 11:38, schrieb Andy Seaborne:
>> On 23/01/13 10:28, Bardo Nelgen wrote:
>>>
>>> Hi Andy,
>>>
>>> thanks for the fast reply and thank you very much for the hint.
>>>
>>> I'll send a copy of this to our programmers then. Just originally
>>> assumed the error resided inside the SPARQLing (I'm just the markup-guy…
>>> ;-) )
>>>
>>> Nonetheless, here comes the stacktrace (short version):
>>>
>>>> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
>>>> at com.semaworx.ARQGenerator.generate(ARQGenerator.java:170)
>>
>> Time to look at line 170 of the (non-Jena) class ARQGenerator!
>>
>> Looks like it is throwing the exception (maybe because it caught an
>> execption from Jena) but "Syntaxfehler" isn't from Jena. So it may be
>> hiding the details.
>>
>> (and which version of Jena are you running?)
>>
>> Andy
>>
>>
>


Re: Looking for a more restrictive type of SPARQL validator

Posted by Bardo Nelgen <ma...@bnnperformances.de>.
Hi,

it admittedly took me some time to get my hands on the JAVA source for 
this item…

Attached the full file (~200 lines) for reference purposes.

*Anticipated JENA / ARQ versions*

JENA: 2.5.5
ARQ: 2.6

The questionable code part goes:

> public void generate() throws SAXException, IOException {
> worldgraphModel = ModelRDB.open(dbCon, rdfGraph);
>
> try {
> Query query = QueryFactory.read(sourcefileLocation.getURI());
> QueryExecution qexec = QueryExecutionFactory.create(query, 
> worldgraphModel);
>
> if (query.getQueryType() == Query.QueryTypeSelect) {
> Model outputModel = 
> ModelFactory.createDefaultModel(ReificationStyle.Minimal);
> StringWriter sw = new StringWriter();
> ResultSet resultSet = qexec.execSelect();
> ResultSetFormatter.asRDF(outputModel, resultSet);
> outputModel.write(sw, outputType);
> outputModel.close();
> doSAX(sw.toString());
> }
>
> if (query.getQueryType() == Query.QueryTypeConstruct) {
> Model resultModel = qexec.execConstruct();
> StringWriter sw = new StringWriter();
> resultModel.write(sw, outputType);
> resultModel.close();
> doSAX(sw.toString());
> }
>
> if (query.getQueryType() == Query.QueryTypeDescribe) {
> Model resultModel = qexec.execDescribe();
> StringWriter sw = new StringWriter();
> resultModel.write(sw, outputType);
> resultModel.close();
> doSAX(sw.toString());
> }
>
> if (query.getQueryType() == Query.QueryTypeAsk) {
> Model outputModel = 
> ModelFactory.createDefaultModel(ReificationStyle.Minimal);
> StringWriter sw = new StringWriter();
> boolean resultBool = qexec.execAsk();
> ResultSetFormatter.asRDF(outputModel, resultBool);
> outputModel.write(sw, outputType);
> outputModel.close();
> doSAX(sw.toString());
> }
> qexec.close();
> }
> catch (QueryParseException qpe) {
> worldgraphModel.begin();
> try {
> UpdateAction.parseExecute(sparqlString, worldgraphModel);
> }
> catch (QueryParseException upe) {
> throw new QueryParseException("can't parse data source – syntax error 
> ? ", 0, 0);
> }
> worldgraphModel.commit();
> doSAX("<updatesuccess value=\"true\"/>");
> }
> finally {
> worldgraphModel.close();
> }
> }

Note: Had the entire RDF tree validated @ W3C as well before trying.

Any idea, what could have gone wrong here?

In advance, thanks for all your time and suggestions.

Bardo








Am 23.01.2013 11:38, schrieb Andy Seaborne:
> On 23/01/13 10:28, Bardo Nelgen wrote:
>>
>> Hi Andy,
>>
>> thanks for the fast reply and thank you very much for the hint.
>>
>> I'll send a copy of this to our programmers then. Just originally
>> assumed the error resided inside the SPARQLing (I'm just the markup-guy…
>> ;-) )
>>
>> Nonetheless, here comes the stacktrace (short version):
>>
>>> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
>>> at com.semaworx.ARQGenerator.generate(ARQGenerator.java:170)
>
> Time to look at line 170 of the (non-Jena) class ARQGenerator!
>
> Looks like it is throwing the exception (maybe because it caught an 
> execption from Jena) but "Syntaxfehler" isn't from Jena. So it may be 
> hiding the details.
>
> (and which version of Jena are you running?)
>
> Andy
>
>


Re: Looking for a more restrictive type of SPARQL validator

Posted by Andy Seaborne <an...@apache.org>.
On 23/01/13 10:28, Bardo Nelgen wrote:
>
> Hi Andy,
>
> thanks for the fast reply and thank you very much for the hint.
>
> I'll send a copy of this to our programmers then. Just originally
> assumed the error resided inside the SPARQLing (I'm just the markup-guy…
> ;-) )
>
> Nonetheless, here comes the stacktrace (short version):
>
>> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
>>     at com.semaworx.ARQGenerator.generate(ARQGenerator.java:170)

Time to look at line 170 of the (non-Jena) class ARQGenerator!

Looks like it is throwing the exception (maybe because it caught an 
execption from Jena) but "Syntaxfehler" isn't from Jena.  So it may be 
hiding the details.

(and which version of Jena are you running?)

	Andy


Re: Looking for a more restrictive type of SPARQL validator

Posted by Bardo Nelgen <ma...@bnnperformances.de>.
Hi Andy,

thanks for the fast reply and thank you very much for the hint.

I'll send a copy of this to our programmers then. Just originally 
assumed the error resided inside the SPARQLing (I'm just the markup-guy… 
;-) )

Nonetheless, here comes the stacktrace (short version):

> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
> 	at com.semaworx.ARQGenerator.generate(ARQGenerator.java:170)
> 	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:579)
> 	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:280)
> 	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:481)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:144)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
> 	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
> 	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
> 	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
> 	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
> 	at org.apache.cocoon.Cocoon.process(Cocoon.java:699)
> 	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1154)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> 	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
> 	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
> 	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
> 	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
> 	at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
> 	at java.lang.Thread.run(Thread.java:619)

and here the full one

> org.apache.cocoon.ProcessingException: Failed to process pipeline
> 	at <map:serialize type="rdf"> - file:///home/semaworx/tomcat6/webapps/cocoon/semaworx/sitemap.xmap:518:32
> 	at <map:generate type="ARQGenerator"> - file:///home/semaworx/tomcat6/webapps/cocoon/semaworx/sitemap.xmap:513:90
> 	at <map:mount> - file:///home/semaworx/tomcat6/webapps/cocoon/sitemap.xmap:1034:92
> 	at org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.java:145)
> 	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.handleException(AbstractProcessingPipeline.java:953)
> 	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:583)
> 	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:280)
> 	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:481)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:144)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
> 	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
> 	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
> 	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
> 	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
> 	at org.apache.cocoon.Cocoon.process(Cocoon.java:699)
> 	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1154)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> 	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
> 	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
> 	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
> 	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
> 	at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
> 	at java.lang.Thread.run(Thread.java:619)
> Caused by: com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
> 	at com.semaworx.ARQGenerator.generate(ARQGenerator.java:170)
> 	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:579)
> 	... 40 more




Am 23.01.2013 11:08, schrieb Andy Seaborne:
> On 22/01/13 23:23, Bardo Nelgen wrote:
>> Hi all,
>>
>> for a content inclusion project I recently wrote the following SPARQL
>> query, had it validated at http://sparql.org/query-validator.html and
>> tested locally with Twinkle 2 –— all doing perfectly well.
>>
>>
>>> PREFIX html: <http://www.w3.org/1999/xhtml>
>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
>>> PREFIX owl: <http://www.w3.org/2002/07/owl#>
>>> PREFIX xsd: <urn:ietf:params:xml:schema:>
>>> PREFIX dct: <http://purl.org/dc/terms/>
>>> PREFIX i18n21: <http://apache.org/cocoon/i18n/2.1>
>>> PREFIX xliff: <urn:oasis:names:tc:xliff:document:1.2>
>>> PREFIX cnt: <http://namespaces.semaworx.org/content#>
>>> PREFIX timed: <http://namespaces.semaworx.org/timed#>
>> >
>>> CONSTRUCT { ?PageIRI rdf:type cnt:page ;
>>> dct:hasPart ?Element .
>>> ?Element rdf:type cnt:element ;
>>> dct:hasPart
>>> ?ElementPayload .
>>> ?ElementPayload rdf:type ql
>>> timed:versionedElement ;
>>> xliff:source
>>> ?StringContent .
>>> }
>>> WHERE { ?PageIRI cnt:pageID
>>> "semawine_page_home" ;
>>> rdf:type cnt:page ;
>>> dct:hasPart ?Element .
>>> ?Element rdf:type cnt:element ;
>>> dct:hasPart
>>> ?ElementPayload .
>>> ?ElementPayload rdf:type
>>> timed:versionedElement ;
>>> xliff:source
>>> ?StringContent .
>>> FILTER ( isLiteral(?StringContent)
>>> || langMatches(
>>> lang(?StringContent), "de-de" ) )
>>> }
>>
>>
>> Though, just as soon as this very same query runs on our server,
>> JENA/ARQ gives me a
>>
>>> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
>>
>> Which is, why I'm looking for a query validator, which evaluates SPARQL
>> more similar to the way JENA/ARQ do— internally and which provides
>> errors meaningful enough to properly act upon.
>>
>> Any help, links, tools etc. are very welcome!!
>
> http://sparql.org/query-validator.html is running Jena (it is a Fuseki 
> server).
>
> Parse errors return the line number and column of the error (being an 
> LL parser, they are usually right!)
>
> You have a different error - what's the stacktrace?
>
> Andy
>
>>
>> Best,
>>
>> Bardo
>>
>>
>>
>>
>
>



Re: Looking for a more restrictive type of SPARQL validator

Posted by Bardo Nelgen <ma...@bnnperformances.de>.
Thanks, Rob — that really appears to be the more reliable approach.


Am 23.01.2013 11:24, schrieb Rob Vesse:
> By the way I would not treat Twinkle as a good SPARQL validator.  Last I
> knew Twinkle was using a very outdated version of ARQ which significantly
> pre-dates the Jena transition into Apache
>
> Use sparql.org as Andy suggests which runs the latest release version, or
> if you download and run our Fuseki server tool locally it includes the
> SPARQL validator in its default configuration.
>
> Rob
>
>
> On 1/23/13 10:08 AM, "Andy Seaborne" <an...@apache.org> wrote:
>
>> On 22/01/13 23:23, Bardo Nelgen wrote:
>>> Hi all,
>>>
>>> for a content inclusion project I recently wrote the following SPARQL
>>> query, had it validated at http://sparql.org/query-validator.html and
>>> tested locally with Twinkle 2 –? all doing perfectly well.
>>>
>>>
>>>> PREFIX html:    <http://www.w3.org/1999/xhtml>
>>>> PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>>>> PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
>>>> PREFIX skos:    <http://www.w3.org/2004/02/skos/core#>
>>>> PREFIX owl:     <http://www.w3.org/2002/07/owl#>
>>>> PREFIX xsd:     <urn:ietf:params:xml:schema:>
>>>> PREFIX dct:     <http://purl.org/dc/terms/>
>>>> PREFIX i18n21:  <http://apache.org/cocoon/i18n/2.1>
>>>> PREFIX xliff:   <urn:oasis:names:tc:xliff:document:1.2>
>>>> PREFIX cnt:     <http://namespaces.semaworx.org/content#>
>>>> PREFIX timed:   <http://namespaces.semaworx.org/timed#>
>>>   >
>>>> CONSTRUCT    {   ?PageIRI            rdf:type            cnt:page    ;
>>>>                                       dct:hasPart         ?Element    .
>>>>                   ?Element            rdf:type            cnt:element
>>>> ;
>>>>                                       dct:hasPart
>>>> ?ElementPayload    .
>>>>                   ?ElementPayload     rdf:type          ql
>>>> timed:versionedElement    ;
>>>>                                       xliff:source
>>>> ?StringContent    .
>>>>               }
>>>> WHERE        {   ?PageIRI            cnt:pageID
>>>> "semawine_page_home"   ;
>>>>                                       rdf:type            cnt:page    ;
>>>>                                       dct:hasPart         ?Element    .
>>>>                   ?Element            rdf:type            cnt:element
>>>> ;
>>>>                                       dct:hasPart
>>>> ?ElementPayload    .
>>>>                   ?ElementPayload     rdf:type
>>>> timed:versionedElement    ;
>>>>                                       xliff:source
>>>> ?StringContent    .
>>>>                        FILTER    (    isLiteral(?StringContent)
>>>>                                 ||    langMatches(
>>>> lang(?StringContent), "de-de" )    )
>>>>               }
>>>
>>> Though, just as soon as this very same query runs on our server,
>>> JENA/ARQ gives me a
>>>
>>>> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
>>> Which is, why I'm looking for a query validator, which evaluates SPARQL
>>> more similar to the way JENA/ARQ do? internally and which provides
>>> errors meaningful enough to properly act upon.
>>>
>>> Any help, links, tools etc. are very welcome!!
>> http://sparql.org/query-validator.html is running Jena (it is a Fuseki
>> server).
>>
>> Parse errors return the line number and column of the error (being an LL
>> parser, they are usually right!)
>>
>> You have a different error - what's the stacktrace?
>>
>> 	Andy
>>
>>> Best,
>>>
>>> Bardo
>>>
>>>
>>>
>>>



Re: Looking for a more restrictive type of SPARQL validator

Posted by Rob Vesse <rv...@yarcdata.com>.
By the way I would not treat Twinkle as a good SPARQL validator.  Last I
knew Twinkle was using a very outdated version of ARQ which significantly
pre-dates the Jena transition into Apache

Use sparql.org as Andy suggests which runs the latest release version, or
if you download and run our Fuseki server tool locally it includes the
SPARQL validator in its default configuration.

Rob


On 1/23/13 10:08 AM, "Andy Seaborne" <an...@apache.org> wrote:

>On 22/01/13 23:23, Bardo Nelgen wrote:
>> Hi all,
>>
>> for a content inclusion project I recently wrote the following SPARQL
>> query, had it validated at http://sparql.org/query-validator.html and
>> tested locally with Twinkle 2 –? all doing perfectly well.
>>
>>
>>> PREFIX html:    <http://www.w3.org/1999/xhtml>
>>> PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>>> PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
>>> PREFIX skos:    <http://www.w3.org/2004/02/skos/core#>
>>> PREFIX owl:     <http://www.w3.org/2002/07/owl#>
>>> PREFIX xsd:     <urn:ietf:params:xml:schema:>
>>> PREFIX dct:     <http://purl.org/dc/terms/>
>>> PREFIX i18n21:  <http://apache.org/cocoon/i18n/2.1>
>>> PREFIX xliff:   <urn:oasis:names:tc:xliff:document:1.2>
>>> PREFIX cnt:     <http://namespaces.semaworx.org/content#>
>>> PREFIX timed:   <http://namespaces.semaworx.org/timed#>
>>  >
>>> CONSTRUCT    {   ?PageIRI            rdf:type            cnt:page    ;
>>>                                      dct:hasPart         ?Element    .
>>>                  ?Element            rdf:type            cnt:element
>>> ;
>>>                                      dct:hasPart
>>> ?ElementPayload    .
>>>                  ?ElementPayload     rdf:type          ql
>>> timed:versionedElement    ;
>>>                                      xliff:source
>>> ?StringContent    .
>>>              }
>>> WHERE        {   ?PageIRI            cnt:pageID
>>> "semawine_page_home"   ;
>>>                                      rdf:type            cnt:page    ;
>>>                                      dct:hasPart         ?Element    .
>>>                  ?Element            rdf:type            cnt:element
>>> ;
>>>                                      dct:hasPart
>>> ?ElementPayload    .
>>>                  ?ElementPayload     rdf:type
>>> timed:versionedElement    ;
>>>                                      xliff:source
>>> ?StringContent    .
>>>                       FILTER    (    isLiteral(?StringContent)
>>>                                ||    langMatches(
>>> lang(?StringContent), "de-de" )    )
>>>              }
>>
>>
>> Though, just as soon as this very same query runs on our server,
>> JENA/ARQ gives me a
>>
>>> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
>>
>> Which is, why I'm looking for a query validator, which evaluates SPARQL
>> more similar to the way JENA/ARQ do? internally and which provides
>> errors meaningful enough to properly act upon.
>>
>> Any help, links, tools etc. are very welcome!!
>
>http://sparql.org/query-validator.html is running Jena (it is a Fuseki
>server).
>
>Parse errors return the line number and column of the error (being an LL
>parser, they are usually right!)
>
>You have a different error - what's the stacktrace?
>
>	Andy
>
>>
>> Best,
>>
>> Bardo
>>
>>
>>
>>
>


Re: Looking for a more restrictive type of SPARQL validator

Posted by Andy Seaborne <an...@apache.org>.
On 22/01/13 23:23, Bardo Nelgen wrote:
> Hi all,
>
> for a content inclusion project I recently wrote the following SPARQL
> query, had it validated at http://sparql.org/query-validator.html and
> tested locally with Twinkle 2 –— all doing perfectly well.
>
>
>> PREFIX html:    <http://www.w3.org/1999/xhtml>
>> PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>> PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
>> PREFIX skos:    <http://www.w3.org/2004/02/skos/core#>
>> PREFIX owl:     <http://www.w3.org/2002/07/owl#>
>> PREFIX xsd:     <urn:ietf:params:xml:schema:>
>> PREFIX dct:     <http://purl.org/dc/terms/>
>> PREFIX i18n21:  <http://apache.org/cocoon/i18n/2.1>
>> PREFIX xliff:   <urn:oasis:names:tc:xliff:document:1.2>
>> PREFIX cnt:     <http://namespaces.semaworx.org/content#>
>> PREFIX timed:   <http://namespaces.semaworx.org/timed#>
>  >
>> CONSTRUCT    {   ?PageIRI            rdf:type            cnt:page    ;
>>                                      dct:hasPart         ?Element    .
>>                  ?Element            rdf:type            cnt:element    ;
>>                                      dct:hasPart
>> ?ElementPayload    .
>>                  ?ElementPayload     rdf:type          ql
>> timed:versionedElement    ;
>>                                      xliff:source
>> ?StringContent    .
>>              }
>> WHERE        {   ?PageIRI            cnt:pageID
>> "semawine_page_home"   ;
>>                                      rdf:type            cnt:page    ;
>>                                      dct:hasPart         ?Element    .
>>                  ?Element            rdf:type            cnt:element    ;
>>                                      dct:hasPart
>> ?ElementPayload    .
>>                  ?ElementPayload     rdf:type
>> timed:versionedElement    ;
>>                                      xliff:source
>> ?StringContent    .
>>                       FILTER    (    isLiteral(?StringContent)
>>                                ||    langMatches(
>> lang(?StringContent), "de-de" )    )
>>              }
>
>
> Though, just as soon as this very same query runs on our server,
> JENA/ARQ gives me a
>
>> com.hp.hpl.jena.query.QueryParseException: Syntaxfehler
>
> Which is, why I'm looking for a query validator, which evaluates SPARQL
> more similar to the way JENA/ARQ do— internally and which provides
> errors meaningful enough to properly act upon.
>
> Any help, links, tools etc. are very welcome!!

http://sparql.org/query-validator.html is running Jena (it is a Fuseki 
server).

Parse errors return the line number and column of the error (being an LL 
parser, they are usually right!)

You have a different error - what's the stacktrace?

	Andy

>
> Best,
>
> Bardo
>
>
>
>