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 EEE0CF42A for ; Wed, 3 Apr 2013 09:46:17 +0000 (UTC) Received: (qmail 25531 invoked by uid 500); 3 Apr 2013 09:46:17 -0000 Delivered-To: apmail-clerezza-dev-archive@clerezza.apache.org Received: (qmail 25359 invoked by uid 500); 3 Apr 2013 09:46:16 -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 25293 invoked by uid 99); 3 Apr 2013 09:46:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Apr 2013 09:46:14 +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 (nike.apache.org: local policy) Received: from [209.85.215.49] (HELO mail-la0-f49.google.com) (209.85.215.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Apr 2013 09:46:08 +0000 Received: by mail-la0-f49.google.com with SMTP id fs13so1225364lab.8 for ; Wed, 03 Apr 2013 02:45:47 -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=vml3bqLvdr4xutDXNR3o3A+/RpQmXDUQJxE48Bc4MeM=; b=lFr0GAFtGlEuvSP/ZyQn/K5+O8R537T2bxpNKcyyw8U+eAK86iL32A9Etbt59pc/Ea XtYoOq+sFfa5HAOu7Wfo9vhYHp2of4Re5kslbP4JxpECo++PyKSlFGdMWUHgoQr+yhiE pcOnvxGRAhv/CWhod/V/dJxf+6F059wTpW4EgLExw7sRIA4TQB7ZzHfghNzYxyaM8ZHt obmSsQ1RKp++VuN0cF9C3yktWxaKvEISMh6QZzHHxzffKF3JAjYZJeO/EGB6alHrtqAm AAG/Q21k7DD6mvtEmvR4TJRD8oFPfj2nm4UIsMLu0mjUHzgZtTJQV8NnU8AV7jrsiHZX Oy3Q== MIME-Version: 1.0 X-Received: by 10.112.88.9 with SMTP id bc9mr748317lbb.22.1364982347220; Wed, 03 Apr 2013 02:45:47 -0700 (PDT) Sender: me@farewellutopia.com Received: by 10.152.8.138 with HTTP; Wed, 3 Apr 2013 02:45:47 -0700 (PDT) X-Originating-IP: [91.137.97.21] In-Reply-To: References: Date: Wed, 3 Apr 2013 11:45:47 +0200 X-Google-Sender-Auth: ACmi8nrFWsRB0tkyoAsthIs7_wk 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=f46d04016be1ee7ad604d971b7c4 X-Gm-Message-State: ALoCoQkg5mV44iF8V8rboWmqAm8QjbmbVZLUHd+xCcDupZygn0x858FeQeQqzebBlrQfC0ymvgBO X-Virus-Checked: Checked by ClamAV on apache.org --f46d04016be1ee7ad604d971b7c4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Apr 2, 2013 at 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); > I think we could have a constructor that takes a TcProvider while the service would always use TcManager. Cheers, Reto > > 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 > > > > > > > > > > --f46d04016be1ee7ad604d971b7c4--