On 09/11/15 18:58, Zen 98052 wrote:
Thanks Martynas!
Shouldn't it call graph's size(), which in turn calls graphBaseSize()?

Depends what "it" is. Have you implemented some or all of the algebra or are you using the general query engine over a graph/dataset?

ARQ's general query engine does not call Graph.size.

COUNT(*) is a general operator and COUNT(*) means count rows.

So it counts the rows of the pattern:

other queries work:

SELECT (COUNT(*) AS ?no) {
   { <someuri> ?p ?o } UNION { GRAPH ?g { <someuri> ?p ?o } } }

(TDB uses delayed evaluation of results so it never pulls the real nodes for variables in COUNT(*)).

        Andy


My graph implementation overrides graphBaseSize(), but looks like it never got 
called for that query.

Thanks,
Z
________________________________________
From: Martynas Jusevičius <marty...@graphity.org>
Sent: Monday, November 9, 2015 9:52 AM
To: users@jena.apache.org
Subject: Re: total triples

That would only count triples in the default graph and omit triples in
named graphs. To account for them, you would need something like

SELECT (COUNT(*) AS ?no) { { ?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } } }

On Mon, Nov 9, 2015 at 3:47 PM, Zen 98052 <z98...@outlook.com> wrote:
What is the most efficient way to get total number of triples?

Is this query below the only way?

SELECT (COUNT(*) AS ?no) { ?s ?p ?o }


Thanks,

Z

Reply via email to