Return-Path: Delivered-To: apmail-incubator-clerezza-dev-archive@minotaur.apache.org Received: (qmail 83421 invoked from network); 15 Jun 2010 12:58:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Jun 2010 12:58:30 -0000 Received: (qmail 13781 invoked by uid 500); 15 Jun 2010 12:58:30 -0000 Delivered-To: apmail-incubator-clerezza-dev-archive@incubator.apache.org Received: (qmail 13741 invoked by uid 500); 15 Jun 2010 12:58:29 -0000 Mailing-List: contact clerezza-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: clerezza-dev@incubator.apache.org Delivered-To: mailing list clerezza-dev@incubator.apache.org Received: (qmail 13731 invoked by uid 99); 15 Jun 2010 12:58:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jun 2010 12:58:28 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [216.86.168.182] (HELO mxout-07.mxes.net) (216.86.168.182) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jun 2010 12:58:18 +0000 Received: from mail-fx0-f47.google.com (unknown [209.85.161.47]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 11A3522E247 for ; Tue, 15 Jun 2010 08:57:56 -0400 (EDT) Received: by fxm9 with SMTP id 9so3332916fxm.6 for ; Tue, 15 Jun 2010 05:57:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.102.243.26 with SMTP id q26mr2345567muh.34.1276606675620; Tue, 15 Jun 2010 05:57:55 -0700 (PDT) Received: by 10.103.228.8 with HTTP; Tue, 15 Jun 2010 05:57:55 -0700 (PDT) X-Originating-IP: [217.71.242.228] In-Reply-To: References: Date: Tue, 15 Jun 2010 14:57:55 +0200 Message-ID: Subject: Re: SPARQL query performance/scalability From: Reto Bachmann-Gmuer To: clerezza-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=0016364163396b14c504891127c0 X-Virus-Checked: Checked by ClamAV on apache.org --0016364163396b14c504891127c0 Content-Type: text/plain; charset=UTF-8 On Tue, Jun 15, 2010 at 1:32 PM, Bertrand Delacretaz wrote: > How should I apply a sparql query to the complete set of triples of a > given TcManager efficiently? > > IIUC it's something like > > MGraph defaultGraph = new UnionMGraph(...) > ResultSet rs = tcManager.executeSparqlQuery(query, defaultGraph); > > but I'm not sure what the defaultGraph exactly means - could I use > null if the sparql query contains a FROM clause, and would that be > better? > > The default graph in section 8.2.1 of the sparql spec, it can be defined with a FROM clause, if there is no such clause in the query the one passed to the method is used. So yes it should be possible to set that argument to null. A query may also provide multiple FROM clauses yielding to the same result as with the union graph. Performance-wise it should make no difference, but with the implementation of the fastlane the approach with the from-clause(s) is potentially more performant. > > > > The clerezza sparql endpoint doesn't need to have the triples in memory. > You > > can have a UnionGraph of multiple graphs even from different backends > > without any data actually being copied around... > > Ok, so I guess what I'm missing is how to construct that UnionGraph > efficiently, while allowing all triples to be queried. > > new UnionMGraph(tcm.getGraph(x), tcm.getGraph(y),....) reto --0016364163396b14c504891127c0--