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 7585AFFCD for ; Tue, 9 Apr 2013 07:49:13 +0000 (UTC) Received: (qmail 14569 invoked by uid 500); 9 Apr 2013 07:49:11 -0000 Delivered-To: apmail-clerezza-dev-archive@clerezza.apache.org Received: (qmail 14476 invoked by uid 500); 9 Apr 2013 07:49:11 -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 14384 invoked by uid 500); 9 Apr 2013 07:49:07 -0000 Delivered-To: apmail-incubator-clerezza-dev@incubator.apache.org Received: (qmail 14250 invoked by uid 99); 9 Apr 2013 07:49:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Apr 2013 07:49:00 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.217.181] (HELO mail-lb0-f181.google.com) (209.85.217.181) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Apr 2013 07:48:56 +0000 Received: by mail-lb0-f181.google.com with SMTP id r11so6432351lbv.26 for ; Tue, 09 Apr 2013 00:48:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received: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=cGKYnSO/7UJ1YNQ+DUeKov7ujktvkm+C7cJWRri4mww=; b=TKniKT2ygNYA2kMTTy9Sj7Spgz0oIIf/oe/EeW6bvwPK3F4MtDBBnZabwEewiEU0EG a4v1gKQnu1DOCTW+fVSS5yky5/FelacHH+Ago9zljENJyHql/szmMgEeRlmH7mSN0S6c szNEfsA4saWDV2FcPBGM3dJeaB2jbtLIElKYl/j64EAFo7QxYMvfOKYE3bWYO8nmscJX Pu6Zzf/52JYSTRIh4FElS7LXrshfWLinDYiSHV+PrnSFkUUvuZzETKEyD/NiS6XgLkWl OzKY7n/D+wjetVeJZJnbQBT4E6b+MBs62DMisAiKy8v6hg+pcm8qt0lQpsIa9Gt4ClYM 67bA== MIME-Version: 1.0 X-Received: by 10.112.147.99 with SMTP id tj3mr9213587lbb.94.1365493713786; Tue, 09 Apr 2013 00:48:33 -0700 (PDT) Sender: me@farewellutopia.com Received: by 10.152.6.230 with HTTP; Tue, 9 Apr 2013 00:48:33 -0700 (PDT) X-Originating-IP: [194.230.159.77] Received: by 10.152.6.230 with HTTP; Tue, 9 Apr 2013 00:48:33 -0700 (PDT) In-Reply-To: References: Date: Tue, 9 Apr 2013 09:48:33 +0200 X-Google-Sender-Auth: fwu-tEvzuKz3AZBN0MobcPN2pUk Message-ID: Subject: Re: [jira] [Commented] (CLEREZZA-761) Implement SPARQL PreParser to support fastlane From: =?ISO-8859-1?Q?Reto_Bachmann=2DGm=FCr?= To: dev@clerezza.apache.org Cc: clerezza-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=047d7b3a85a2c0f1d804d9e8c70d X-Gm-Message-State: ALoCoQmVSyfGyGIgZCr0yg6puZ6jDE+C6DjBLzloJpcgHR2AEBWUioGT+PfN7HEJpKZwdSjpT407 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b3a85a2c0f1d804d9e8c70d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Hasan For efficiency reason (and considering Minto's usecase) - even though less nice - I think the pre parser should rather return null than all the graphs= . Cheers, Reto On Apr 2, 2013 10:45 PM, "Hasan Hasan" wrote: > Hi Reto, > > after studying carefully the description and examples in > http://www.w3.org/TR/sparql11-query/#rdfDataset > I think the PreParser should - as you suggested - have a TcProvider to > return all TripleCollections, in case no FROM NAMED clause is specified i= n > the query. > > How should we pass the TcProvider to the PreParser? In a separate method, > e.g., > > public void setTcProvider(TcProvider tcProvider); > > Default TcProvider would be TcManager. > > Cheers > Hasan > > > > On Tue, Apr 2, 2013 at 12:34 PM, Reto Bachmann-Gm=FCr > wrote: > > > Hi, > > > > The query SELECT DISTINCT ?g { GRAPH ?g { ?s ?p ?o } } can obviously on= ly > > be answered correctly by a sparql engine that knows about all the > available > > graphs. As typically not all graphs are provided by the same provider > this > > means the query has to be slow laned. > > > > If the pre parser returns only the default graph as this is currently t= he > > case: > > > > zz>spp.getReferredGraphs("SELECT DISTINCT ?g { GRAPH ?g { ?s ?p ?o } > }",new > > UriRef("urn:x-localinstance:/content.graph")) > > res0: java.util.Set[org.apache.clerezza.rdf.core.UriRef] =3D > > [] > > > > The query would be fastlaned to the TcProvider providing the Graph > > which potentially knows about none > of > > the other graphs. > > > > So I think either the preparser has the TcManager and returns all the > > TripleCollections or it returns a special value to tell the caller that > the > > set of affected graphs cannot be limited (return null). > > > > Currently clerezza correctly returns all triple collections: > > > > zz>val q =3D qp.parse("SELECT DISTINCT ?g { GRAPH ?g { ?s ?p ?o } }") > > q: org.apache.clerezza.rdf.core.sparql.query.Query =3D > > SELECT DISTINCT > > ?g > > WHERE > > { GRAPH ?g { ?s ?p ?o . > > } } > > zz>val r =3D tcm.executeSparqlQuery(q.asInstanceOf[SelectQuery], new > > SimpleMGraph) > > r: org.apache.clerezza.rdf.core.sparql.ResultSet =3D > > org.apache.clerezza.rdf.jena.sparql.ResultSetWrapper@b0d2ffd > > zz>r.next > > res5: org.apache.clerezza.rdf.core.sparql.SolutionMapping =3D > > {org.apache.clerezza.rdf.core.sparql.query.Variable@67 > > =3D} > > zz>r.next > > res6: org.apache.clerezza.rdf.core.sparql.SolutionMapping =3D > > {org.apache.clerezza.rdf.core.sparql.query.Variable@67 > > =3D} > > zz>r.next > > res7: org.apache.clerezza.rdf.core.sparql.SolutionMapping =3D > > {org.apache.clerezza.rdf.core.sparql.query.Variable@67 > > =3D} > > zz>r.next > > res8: org.apache.clerezza.rdf.core.sparql.SolutionMapping =3D > > {org.apache.clerezza.rdf.core.sparql.query.Variable@67 > > =3D} > > zz>r.next > > res9: org.apache.clerezza.rdf.core.sparql.SolutionMapping =3D > > {org.apache.clerezza.rdf.core.sparql.query.Variable@67 > > =3D} > > zz>r.next > > res10: org.apache.clerezza.rdf.core.sparql.SolutionMapping =3D > > {org.apache.clerezza.rdf.core.sparql.query.Variable@67 > > =3D} > > zz>r.next > > res11: org.apache.clerezza.rdf.core.sparql.SolutionMapping =3D > > {org.apache.clerezza.rdf.core.sparql.query.Variable@67 > > =3D} > > zz>r.next > > res12: org.apache.clerezza.rdf.core.sparql.SolutionMapping =3D > > {org.apache.clerezza.rdf.core.sparql.query.Variable@67 > > =3D > > > Cheers, > > Reto > > > > On Tue, Apr 2, 2013 at 8:10 AM, Hasan Hasan wrote: > > > > > Hi Reto, all > > > > > > Two issues here: > > > > > > First the query: SELECT DISTINCT ?g { GRAPH ?g { ?s ?p ?o } } > > > does not specify NAMED graphs. > > > If the query is as follows > > > SELECT DISTINCT ?g FROM NAMED http://example.org/g1 { GRAPH ?g { ?s ?= p > > ?o > > > } > > > } > > > then the engine will return http://example.org/g1 > > > because the clause GRAPH refers only NAMED graphs as mentioned by And= y > > > > > > Second the parser: I think the parser needs not know about TcManager = or > > > other providers in this case, because > > > the named graphs are all specified in the query. > > > > > > Cheers > > > Hasan > > > > > > > > > > > > On Fri, Mar 29, 2013 at 1:47 PM, Reto Bachmann-Gm=FCr (JIRA) > > > wrote: > > > > > > > > > > > [ > > > > > > > > > > https://issues.apache.org/jira/browse/CLEREZZA-761?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D136172= 95#comment-13617295 > > > ] > > > > > > > > Reto Bachmann-Gm=FCr commented on CLEREZZA-761: > > > > --------------------------------------------- > > > > > > > > zz>import org.apache.clerezza.rdf.core.sparql._ > > > > import org.apache.clerezza.rdf.core.sparql._ > > > > zz>val spp =3D $[SparqlPreParser] > > > > spp: org.apache.clerezza.rdf.core.sparql.SparqlPreParser =3D > > > > org.apache.clerezza.rdf.core.sparql.SparqlPreParser@3aa78e7a > > > > zz>spp.getReferredGraphs("SELECT DISTINCT ?g { GRAPH ?g { ?s ?p ?o = } > > }", > > > > new UriRef("urn:x-localinstance:/content.graph")) > > > > res0: java.util.Set[org.apache.clerezza.rdf.core.UriRef] =3D > > > > [] > > > > zz> > > > > > > > > As discussed in > > > > > > > > > > http://mail-archives.apache.org/mod_mbox/clerezza-dev/201303.mbox/%3C5149= 8242.4020809@apache.org%3Ethisshouldreturnall the graphs in the dataset. I = think that > > > > SParqlPreParser being a service it could consider by default > TcManager > > > > being the dataset, but it probably should also have a method that > takes > > > any > > > > TcProvider as dataset and return it's triple collections. > > > > > > > > > Implement SPARQL PreParser to support fastlane > > > > > ---------------------------------------------- > > > > > > > > > > Key: CLEREZZA-761 > > > > > URL: > > > https://issues.apache.org/jira/browse/CLEREZZA-761 > > > > > Project: Clerezza > > > > > Issue Type: New Feature > > > > > Reporter: Hasan > > > > > Assignee: Hasan > > > > > > > > > > The purpose is to have a class with a method to obtain referred > > graphs > > > > in a SPARQL Query or SPARQL Update > > > > > > > > -- > > > > This message is automatically generated by JIRA. > > > > If you think it was sent incorrectly, please contact your JIRA > > > > administrators > > > > For more information on JIRA, see: > > > http://www.atlassian.com/software/jira > > > > > > > > > > --047d7b3a85a2c0f1d804d9e8c70d--