Return-Path: X-Original-To: apmail-clerezza-dev-archive@www.apache.org Delivered-To: apmail-clerezza-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88ECEC752 for ; Mon, 3 Jun 2013 15:40:22 +0000 (UTC) Received: (qmail 33411 invoked by uid 500); 3 Jun 2013 15:40:22 -0000 Delivered-To: apmail-clerezza-dev-archive@clerezza.apache.org Received: (qmail 33327 invoked by uid 500); 3 Jun 2013 15:40:21 -0000 Mailing-List: contact dev-help@clerezza.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@clerezza.apache.org Delivered-To: mailing list dev@clerezza.apache.org Received: (qmail 33303 invoked by uid 500); 3 Jun 2013 15:40:20 -0000 Delivered-To: apmail-incubator-clerezza-dev@incubator.apache.org Received: (qmail 33092 invoked by uid 99); 3 Jun 2013 15:40:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 15:40:20 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [209.85.217.172] (HELO mail-lb0-f172.google.com) (209.85.217.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 15:40:13 +0000 Received: by mail-lb0-f172.google.com with SMTP id p10so3968296lbi.17 for ; Mon, 03 Jun 2013 08:39:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=Z8oCuB/H9J+acmC3PWQufZxxEPzlBrDOFrTEKTAHcHg=; b=eGACNXNahDIn63gmjcVuQjIuLbsJuCDBzZ8stisHvy2XMrjKIyHR7u8tUcJkFxrb1F dvuFQCci4+uj7VKrTpVy1E/6E85XgxBXM2oScA35+rBmGbO3/m05wiEI/cvaRrokDOPm VZ8mRs59zB6IVt0i3x9la1Y8YydnLCeLhUS2T5ZvRmPRlQ54mpUt+HMluC9X1tox+25Q w9vIeMCYpcMoyEA2AFfR9/nMk1kwH+u29AZi8KIUy9STJKLzqN6eY1Se07/tz6InvS65 dDq93NjjUoyFw1RNIl7MyPBr5VJg6PjHaNhs6APTwGK2sU39iv41VeffmufZgGJjKijA QyEA== MIME-Version: 1.0 X-Received: by 10.152.116.7 with SMTP id js7mr11249526lab.7.1370273971923; Mon, 03 Jun 2013 08:39:31 -0700 (PDT) Sender: me@farewellutopia.com Received: by 10.152.135.175 with HTTP; Mon, 3 Jun 2013 08:39:31 -0700 (PDT) X-Originating-IP: [91.137.97.21] In-Reply-To: References: <9823E7E2D9C1A2408143C2FD1BC5E7F44A1897AF@smmb2.rand.org> Date: Mon, 3 Jun 2013 17:39:31 +0200 X-Google-Sender-Auth: aOXj33i5OBXV7XHsL9S1zLsJHM8 Message-ID: Subject: Re: Stanbol SPARQL and RelFinder From: =?ISO-8859-1?Q?Reto_Bachmann=2DGm=FCr?= To: dev@stanbol.apache.org Cc: "clerezza-dev@incubator.apache.org" Content-Type: multipart/alternative; boundary=001a11c2672a57842b04de41c5c8 X-Gm-Message-State: ALoCoQmN/0jCnRR6UeWlpH+zwi5am1shueD6gY9GUu8RFstD9UGmn0cojOUg8yo/h8sTRc/9z/G5 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2672a57842b04de41c5c8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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.westenthaler@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 { > > ?pf1 ?middle . > > ?ps1 ?os1 . > > ?os1 ?ps2 ?middle . > > } LIMIT 10 > > does exactly that, as it uses values ( 'os1') of ' 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 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 othe= r > 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 consis= ts > 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" (s= ee > end of email for full error message). Using firebug to monitor the networ= k > 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 { > > ?pf1 ?middle . > > ?ps1 ?os1 . > > ?os1 ?ps2 ?middle . > > } LIMIT 10 > > > > However, the following query works fine: > > SELECT * WHERE { > > ?pf1 ?middle . > > ?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 issue= s > with CPU usage. Sometimes Stanbol would overrun the cpu limit on my serve= r > 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: > > > > > > > > Error 500 cannot convert "{the rdfs:label for Person 1}" to > NonLiteral > > > >

HTTP ERROR 500

> >

Problem accessing /sparql. Reason: > >

    cannot convert "{the rdfs:label for Person 1}" to
> NonLiteral

Caused by:

java.lang.RuntimeException:
> cannot convert "{the rdfs:label for Person 1}"to NonLiteral
> >         at
> org.apache.clerezza.rdf.jena.commons.Jena2TriaUtil.convertNonLiteral(Jena=
2TriaUtil.java:127)
> >         at
> org.apache.clerezza.rdf.jena.facade.JenaGraph.filter(JenaGraph.java:123)
> >         at
> org.apache.clerezza.rdf.jena.facade.JenaGraph.graphBaseFind(JenaGraph.jav=
a: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$TripleMappe=
r.<init>(QueryIterTriplePattern.java:67)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIterTriplePattern.nextStage(Q=
ueryIterTriplePattern.java:41)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage=
(QueryIterRepeatApply.java:91)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBindin=
g(QueryIterRepeatApply.java:52)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIte=
ratorBase.java:66)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIterBlockTriples.hasNextBindi=
ng(QueryIterBlockTriples.java:53)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIte=
ratorBase.java:66)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIterSlice.hasNextBinding(Quer=
yIterSlice.java:64)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIte=
ratorBase.java:66)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBindin=
g(QueryIteratorWrapper.java:28)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIte=
ratorBase.java:66)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBindin=
g(QueryIteratorWrapper.java:28)
> >         at
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIte=
ratorBase.java:66)
> >         at
> com.hp.hpl.jena.sparql.engine.ResultSetStream.hasNext(ResultSetStream.jav=
a:57)
> >         at
> org.apache.clerezza.rdf.jena.sparql.ResultSetWrapper.<init>(ResultS=
etWrapper.java:39)
> >         at
> org.apache.clerezza.rdf.jena.sparql.JenaSparqlEngine.execute(JenaSparqlEn=
gine.java:68)
> >         at
> org.apache.clerezza.rdf.core.access.TcManager.executeSparqlQuery(TcManage=
r.java:272)
> >         at
> org.apache.stanbol.commons.web.sparql.resource.SparqlEndpointResource.spa=
rql(SparqlEndpointResource.java:162)
> >         at
> org.apache.stanbol.commons.web.sparql.resource.SparqlEndpointResource.pos=
tSparql(SparqlEndpointResource.java:182)
> >         at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
> >         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI=
mpl.java:43)
> >         at java.lang.reflect.Method.invoke(Method.java:616)
> >         at
> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethod=
InvokerFactory.java:60)
> >         at
> com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDi=
spatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchP=
rovider.java:205)
> >         at
> com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispat=
cher.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(ResourceCla=
ssRule.java:108)
> >         at
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPa=
thRule.java:147)
> >         at
> com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootR=
esourceClassesRule.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(W=
ebApplicationImpl.java:1360)
> >         at
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(W=
ebApplicationImpl.java:1350)
> >         at
> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.ja=
va:416)
> >         at
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletCont=
ainer.java:538)
> >         at
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletCont=
ainer.java:716)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> >         at
> org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(Servl=
etHandler.java:96)
> >         at
> org.apache.felix.http.base.internal.handler.ServletHandler.handle(Servlet=
Handler.java:79)
> >         at
> org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(Servl=
etPipeline.java:42)
> >         at
> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilt=
er(InvocationFilterChain.java:49)
> >         at
> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(Htt=
pFilterChain.java:33)
> >         at
> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHa=
ndler.java:78)
> >         at
> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilt=
er(InvocationFilterChain.java:47)
> >         at
> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(Htt=
pFilterChain.java:33)
> >         at
> org.apache.stanbol.commons.httpqueryheaders.impl.QueryHeadersFilter.doFil=
ter(QueryHeadersFilter.java:75)
> >         at
> org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(Filter=
Handler.java:88)
> >         at
> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHa=
ndler.java:76)
> >         at
> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilt=
er(InvocationFilterChain.java:47)
> >         at
> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(Htt=
pFilterChain.java:33)
> >         at
> org.apache.stanbol.commons.web.resources.ResourceServingFilter.doFilterHt=
tp(ResourceServingFilter.java:148)
> >         at
> org.apache.stanbol.commons.web.resources.ResourceServingFilter.doFilter(R=
esourceServingFilter.java:91)
> >         at
> org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(Filter=
Handler.java:88)
> >         at
> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHa=
ndler.java:76)
> >         at
> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilt=
er(InvocationFilterChain.java:47)
> >         at
> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(Htt=
pFilterChain.java:33)
> >         at
> org.apache.stanbol.commons.security.auth.AuthenticatingFilter$1.run(Authe=
nticatingFilter.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(Au=
thenticatingFilter.java:159)
> >         at
> org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(Filter=
Handler.java:88)
> >         at
> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHa=
ndler.java:76)
> >         at
> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilt=
er(InvocationFilterChain.java:47)
> >         at
> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(Htt=
pFilterChain.java:33)
> >         at
> org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(Filt=
erPipeline.java:48)
> >         at
> org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatch=
er.java:39)
> >         at
> org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherS=
ervlet.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.ja=
va: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:4=
10)
> >         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:=
582)
> > 
> >
Powered by Jetty://
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > > > > > > > > > > RelFinder Query: > > > > SELECT * WHERE { > > ?pf1 ?middle . > > ?ps1 ?os1 . > > ?os1 ?ps2 ?middle . > > FILTER ( > > (?pf1 !=3D ) > > && (?pf1 !=3D ) > > && (?pf1 !=3D ) > > && (?pf1 !=3D ) > > && (?pf1 !=3D ) > > && (?pf1 !=3D ) > > && (?pf1 !=3D ) > > && (?pf1 !=3D ) > > && (?ps1 !=3D ) > > && (?ps1 !=3D ) > > && (?ps1 !=3D ) > > && (?ps1 !=3D ) > > && (?ps1 !=3D ) > > && (?ps1 !=3D ) > > && (?ps1 !=3D ) > > && (?ps1 !=3D ) > > && (?ps2 !=3D ) > > && (?ps2 !=3D ) > > && (?ps2 !=3D ) > > && (?ps2 !=3D ) > > && (?ps2 !=3D ) > > && (?ps2 !=3D ) > > && (?ps2 !=3D ) > > && (?ps2 !=3D ) > > && (!isLiteral(?middle)) > > && (?middle !=3D = ) > > && (?middle !=3D = ) > > && (?middle !=3D ?os1 ) && (!isLiteral(?os1)) > > && (?os1 !=3D ) > > && (?os1 !=3D ) > > && (?os1 !=3D ?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.westenthaler@gmail.com > | Bodenlehenstra=DFe 11 ++43-699-11108907 > | A-5500 Bischofshofen > --001a11c2672a57842b04de41c5c8--