Hi rupert, Isley, Yes the excpetion ios thrown in the implementation of ExtendedIterator com.hp.hpl.jena.graph.impl.GraphBase#graphBaseFind(TripleMatch m) when the subject in m is a literal. I think it would be safe to return an empty iterator if this case.
Cheers, Reto On Mon, Jun 3, 2013 at 9:45 AM, Rupert Westenthaler < rupert.westentha...@gmail.com> wrote: > Hi Isley, Clerezza community > > this seams to be related to an issue in the Clerezza SPARQL > implementation. I think the problem is that the "Jena <-> Clerezza" > Adapter enforces that subjects of triples need to be NonLiterals, but > the last statement of your Sparql Query. An assumption that MUST NOT > be true for SPARQL query results where resources in any position > (subject, predicate, object) can have any type (Literal, URI or > bNode). > > This query > > > SELECT * WHERE { > > <Target Person 1 URI> ?pf1 ?middle . > > <Target Person 2 URI> ?ps1 ?os1 . > > ?os1 ?ps2 ?middle . > > } LIMIT 10 > > does exactly that, as it uses values ( 'os1') of '<Target Person 2 > URI> ?ps1 ?os1' as first argument (subject) for an second join '?os1 > ?ps2 ?middle'. > > Would be nice if someone with more knowledge about the Clerezza SPARQL > implementation could look into that. > > best > Rupert > > > > On Fri, May 31, 2013 at 7:17 PM, Isley, Steven <sis...@prgs.edu> wrote: > > Hello everyone, > > > > I've been trying to integrate Apache Stanbol and Relfinder[1] (my two > favorite demos to show people who have never heard of the semantic web). I > ran into some problems with Relfinder that I think I fixed. It was using a > different parameter name to specify the graph to use in the SPARQL query. > After recompiling Relfinder to work with Stanbol, I've run into some other > errors which may be Stanbol related. > > > > Relfinder tries to find paths through a dataset that link two nodes. > I've uploaded an rdf data set to a clerezza managed site. The data consists > of documents, their authors, and then some other information (such as an > author's department, or a document's publish date). I've got about 500k > triples. > > > > My version of Relfinder will find some links between nodes. Like if the > two input nodes are people, it will find documents they both authored, or > departments they both belong to. However, the more impressive searches > result in an "Error 500 cannot convert {one of my URIs} to NonLiteral" (see > end of email for full error message). Using firebug to monitor the network > requests shows that this error occurs for all the searches that are > supposed to return the more complicated results (Target Person 1 authored > document X, also authored by person B, that authored document Y, that was > also authored by Target Person 2) > > > > I spent some time playing with Stanbol's SPARQL endpoint, and the > simplest example that reproduces the error is: > > > > SELECT * WHERE { > > <Target Person 1 URI> ?pf1 ?middle . > > <Target Person 2 URI> ?ps1 ?os1 . > > ?os1 ?ps2 ?middle . > > } LIMIT 10 > > > > However, the following query works fine: > > SELECT * WHERE { > > <Target Person 1 URI> ?pf1 ?middle . > > <Target Person 2 URI> ?ps1 ?os1 . > > } LIMIT 10 > > > > Note that these are simplified searches, the actual Relfinder queries > are more complicated, and attempt to filter out literal values. See the > very, very end of this email for the original query. Relfinder works fine > on other SPARQL endpoints, like dbpedia's. > > > > Thanks for any insights you can offer on this problem. The help is much > appreciated. > > > > > > -- > > Steven Isley > > Ph.D. Candidate > > Pardee RAND Graduate School > > RAND Corporation > > ph: (310)393-0411 x6643 > > > > -Steve Isley > > > > [1] http://www.visualdataweb.org/relfinder.php > > > > > > p.s. - if anyone else is trying to use RelFinder, I also ran into issues > with CPU usage. Sometimes Stanbol would overrun the cpu limit on my server > and would be silently killed. Took me a while to figure that one out! I > managed to get around this using "unlimit cpu" - but the IT folks at my > workplace will probably come down on me for that :) > > > > Error Output: > > <html> > > <head> > > <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> > > <title>Error 500 cannot convert "{the rdfs:label for Person 1}" to > NonLiteral</title> > > </head> > > <body><h2>HTTP ERROR 500</h2> > > <p>Problem accessing /sparql. Reason: > > <pre> cannot convert "{the rdfs:label for Person 1}" to > NonLiteral</pre></p><h3>Caused by:</h3><pre>java.lang.RuntimeException: > cannot convert "{the rdfs:label for Person 1}"to NonLiteral > > at > org.apache.clerezza.rdf.jena.commons.Jena2TriaUtil.convertNonLiteral(Jena2TriaUtil.java:127) > > at > org.apache.clerezza.rdf.jena.facade.JenaGraph.filter(JenaGraph.java:123) > > at > org.apache.clerezza.rdf.jena.facade.JenaGraph.graphBaseFind(JenaGraph.java:151) > > at com.hp.hpl.jena.graph.impl.GraphBase.find(GraphBase.java:240) > > at > com.hp.hpl.jena.graph.impl.GraphBase.graphBaseFind(GraphBase.java:260) > > at com.hp.hpl.jena.graph.impl.GraphBase.find(GraphBase.java:257) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIterTriplePattern$TripleMapper.<init>(QueryIterTriplePattern.java:67) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIterTriplePattern.nextStage(QueryIterTriplePattern.java:41) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage(QueryIterRepeatApply.java:91) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding(QueryIterRepeatApply.java:52) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:66) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIterBlockTriples.hasNextBinding(QueryIterBlockTriples.java:53) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:66) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIterSlice.hasNextBinding(QueryIterSlice.java:64) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:66) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:28) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:66) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:28) > > at > com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:66) > > at > com.hp.hpl.jena.sparql.engine.ResultSetStream.hasNext(ResultSetStream.java:57) > > at > org.apache.clerezza.rdf.jena.sparql.ResultSetWrapper.<init>(ResultSetWrapper.java:39) > > at > org.apache.clerezza.rdf.jena.sparql.JenaSparqlEngine.execute(JenaSparqlEngine.java:68) > > at > org.apache.clerezza.rdf.core.access.TcManager.executeSparqlQuery(TcManager.java:272) > > at > org.apache.stanbol.commons.web.sparql.resource.SparqlEndpointResource.sparql(SparqlEndpointResource.java:162) > > at > org.apache.stanbol.commons.web.sparql.resource.SparqlEndpointResource.postSparql(SparqlEndpointResource.java:182) > > at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source) > > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > at java.lang.reflect.Method.invoke(Method.java:616) > > at > com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) > > at > com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) > > at > com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) > > at > com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) > > at > com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) > > at > com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) > > at > com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) > > at > com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1480) > > at > com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1411) > > at > com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360) > > at > com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350) > > at > com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) > > at > com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) > > at > com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > > at > org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96) > > at > org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79) > > at > org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42) > > at > org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49) > > at > org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33) > > at > org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:78) > > at > org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47) > > at > org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33) > > at > org.apache.stanbol.commons.httpqueryheaders.impl.QueryHeadersFilter.doFilter(QueryHeadersFilter.java:75) > > at > org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88) > > at > org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76) > > at > org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47) > > at > org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33) > > at > org.apache.stanbol.commons.web.resources.ResourceServingFilter.doFilterHttp(ResourceServingFilter.java:148) > > at > org.apache.stanbol.commons.web.resources.ResourceServingFilter.doFilter(ResourceServingFilter.java:91) > > at > org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88) > > at > org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76) > > at > org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47) > > at > org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33) > > at > org.apache.stanbol.commons.security.auth.AuthenticatingFilter$1.run(AuthenticatingFilter.java:163) > > at java.security.AccessController.doPrivileged(Native Method) > > at javax.security.auth.Subject.doAsPrivileged(Subject.java:537) > > at > org.apache.stanbol.commons.security.auth.AuthenticatingFilter.doFilter(AuthenticatingFilter.java:159) > > at > org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88) > > at > org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76) > > at > org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47) > > at > org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33) > > at > org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48) > > at > org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39) > > at > org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > > at > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) > > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) > > at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) > > at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) > > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) > > at org.mortbay.jetty.Server.handle(Server.java:326) > > at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) > > at > org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943) > > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) > > at > org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) > > at > org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) > > at > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) > > </pre> > > <hr /><i><small>Powered by Jetty://</small></i><br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > <br/> > > > > </body> > > </html> > > > > > > RelFinder Query: > > > > SELECT * WHERE { > > <http://dopma-ropma.rand.org/people/{Target Person 1}> ?pf1 ?middle . > > <http://dopma-ropma.rand.org/people/{Target Person 2}> ?ps1 ?os1 . > > ?os1 ?ps2 ?middle . > > FILTER ( > > (?pf1 != <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ) > > && (?pf1 != <http://www.w3.org/2004/02/skos/core#subject> ) > > && (?pf1 != <http://www.w3.org/2002/07/owl#sameAs> ) > > && (?pf1 != <http://purl.org/dc/terms/subject> ) > > && (?pf1 != <http://purl.org/dc/terms/dateCopyrighted> ) > > && (?pf1 != <http://purl.org/dc/terms/title> ) > > && (?pf1 != <http://dopma-ropma.rand.org/people/employeeID2> ) > > && (?pf1 != <http://xmlns.com/foaf/0.1/mbox> ) > > && (?ps1 != <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ) > > && (?ps1 != <http://www.w3.org/2004/02/skos/core#subject> ) > > && (?ps1 != <http://www.w3.org/2002/07/owl#sameAs> ) > > && (?ps1 != <http://purl.org/dc/terms/subject> ) > > && (?ps1 != <http://purl.org/dc/terms/dateCopyrighted> ) > > && (?ps1 != <http://purl.org/dc/terms/title> ) > > && (?ps1 != <http://dopma-ropma.rand.org/people/employeeID2> ) > > && (?ps1 != <http://xmlns.com/foaf/0.1/mbox> ) > > && (?ps2 != <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ) > > && (?ps2 != <http://www.w3.org/2004/02/skos/core#subject> ) > > && (?ps2 != <http://www.w3.org/2002/07/owl#sameAs> ) > > && (?ps2 != <http://purl.org/dc/terms/subject> ) > > && (?ps2 != <http://purl.org/dc/terms/dateCopyrighted> ) > > && (?ps2 != <http://purl.org/dc/terms/title> ) > > && (?ps2 != <http://dopma-ropma.rand.org/people/employeeID2> ) > > && (?ps2 != <http://xmlns.com/foaf/0.1/mbox> ) > > && (!isLiteral(?middle)) > > && (?middle != <http://dopma-ropma.rand.org/people/{Target Person 1}> ) > > && (?middle != <http://dopma-ropma.rand.org/people/{Target Person 2}> ) > > && (?middle != ?os1 ) && (!isLiteral(?os1)) > > && (?os1 != <http://dopma-ropma.rand.org/people/{Target Person 1}> ) > > && (?os1 != <http://dopma-ropma.rand.org/people/{Target Person 2}> ) > > && (?os1 != ?middle ) ). > > } LIMIT 10 > > > > > __________________________________________________________________________ > > > > This email message is for the sole use of the intended recipient(s) and > > may contain confidential information. Any unauthorized review, use, > > disclosure or distribution is prohibited. If you are not the intended > > recipient, please contact the sender by reply email and destroy all > copies > > of the original message. > > > > > > -- > | Rupert Westenthaler rupert.westentha...@gmail.com > | Bodenlehenstraße 11 ++43-699-11108907 > | A-5500 Bischofshofen >