You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Daniel Hernández <da...@degu.cl> on 2015/04/28 23:34:13 UTC

Can the default graph be defined as the union of all namedgraphs?

hi all,

I have a dataset that have millions of named graph and I want to
query a property path against the union of all. It is not practical
to list all named graphs with FROM clauses, because they are millions.
Thus, I wan't to know if it is possible to set fuseki to assume
that the default graph is the union of all named graphs.

Thanks,
Daniel

Re: Can the default graph be defined as the union of all named graphs?

Posted by Andy Seaborne <an...@apache.org>.
On 30/04/15 11:46, Olivier Rossel wrote:
> Please tell me if I am wrong:
> As far as i understand, there is no single query that will, for sure,
> list all triples of an endpoint once.
> (no matter which endpoint it is, and no matter how it is configured).

This will do it:

SELECT DISTINCT ?s ?p ?o {
   { ?s ?p ?o }
   UNION
   { GRAPH ?g { ?s ?p ?o } }
}

and will do it for in any situation (if it executes - it is a 
potentially very expensive DISTINCT).  The query is trying all 
possibilities of where a 3-tuple of S,P,O is.

	Andy

>
> On Wed, Apr 29, 2015 at 10:59 PM, Andy Seaborne <an...@apache.org> wrote:
>> In default union graph mode, the "graph = set of triples" is handled
>> correctly.  Triples appear only once.
>>
>> SELECT * { ?s ?p ?o }
>>
>> It is not the same as:
>>
>> SELECT ?s ?p ?o {
>>    GRAPH ?g { ?s ?p ?o }
>> }
>>
>>          Andy
>>
>>
>> On 29/04/15 18:04, Olivier Rossel wrote:
>>>
>>> Then what is the standard query to list all triples of the store only
>>> once?
>>>
>>> On Wed, Apr 29, 2015 at 5:31 PM, Daniel Hernández <da...@degu.cl> wrote:
>>>>
>>>> Thanks! I have to ran queries with property property paths against an
>>>> TDB that have several named graphs. I need that named graphs look as
>>>> they where a single graph.
>>>>
>>>> Daniel
>>>>
>>>> On Wed, 2015-04-29 at 10:20 +0100, Andy Seaborne wrote:
>>>>>
>>>>> On 28/04/15 22:34, Daniel Hernández wrote:
>>>>>>
>>>>>> hi all,
>>>>>>
>>>>>> I have a dataset that have millions of named graph and I want to
>>>>>> query a property path against the union of all. It is not practical
>>>>>> to list all named graphs with FROM clauses, because they are millions.
>>>>>> Thus, I wan't to know if it is possible to set fuseki to assume
>>>>>> that the default graph is the union of all named graphs.
>>>>>>
>>>>>> Thanks,
>>>>>> Daniel
>>>>>
>>>>>
>>>>> Yes (if TDB backed).
>>>>>
>>>>> Either in the assembler for the TDB dataset, or "--set
>>>>> tdb:unionDefaultGraph=true" what starting Fuseki.
>>>>>
>>>>>
>>>>> https://jena.apache.org/documentation/tdb/configuration.html#query-of-the-union-of-named-graphs
>>>>>
>>>>> Or query graph <urn:x-arq:UnionGraph>
>>>>>
>>>>>         Andy
>>>>>
>>>>
>>>>
>>


Re: Can the default graph be defined as the union of all named graphs?

Posted by Olivier Rossel <ol...@gmail.com>.
Please tell me if I am wrong:
As far as i understand, there is no single query that will, for sure,
list all triples of an endpoint once.
(no matter which endpoint it is, and no matter how it is configured).

On Wed, Apr 29, 2015 at 10:59 PM, Andy Seaborne <an...@apache.org> wrote:
> In default union graph mode, the "graph = set of triples" is handled
> correctly.  Triples appear only once.
>
> SELECT * { ?s ?p ?o }
>
> It is not the same as:
>
> SELECT ?s ?p ?o {
>   GRAPH ?g { ?s ?p ?o }
> }
>
>         Andy
>
>
> On 29/04/15 18:04, Olivier Rossel wrote:
>>
>> Then what is the standard query to list all triples of the store only
>> once?
>>
>> On Wed, Apr 29, 2015 at 5:31 PM, Daniel Hernández <da...@degu.cl> wrote:
>>>
>>> Thanks! I have to ran queries with property property paths against an
>>> TDB that have several named graphs. I need that named graphs look as
>>> they where a single graph.
>>>
>>> Daniel
>>>
>>> On Wed, 2015-04-29 at 10:20 +0100, Andy Seaborne wrote:
>>>>
>>>> On 28/04/15 22:34, Daniel Hernández wrote:
>>>>>
>>>>> hi all,
>>>>>
>>>>> I have a dataset that have millions of named graph and I want to
>>>>> query a property path against the union of all. It is not practical
>>>>> to list all named graphs with FROM clauses, because they are millions.
>>>>> Thus, I wan't to know if it is possible to set fuseki to assume
>>>>> that the default graph is the union of all named graphs.
>>>>>
>>>>> Thanks,
>>>>> Daniel
>>>>
>>>>
>>>> Yes (if TDB backed).
>>>>
>>>> Either in the assembler for the TDB dataset, or "--set
>>>> tdb:unionDefaultGraph=true" what starting Fuseki.
>>>>
>>>>
>>>> https://jena.apache.org/documentation/tdb/configuration.html#query-of-the-union-of-named-graphs
>>>>
>>>> Or query graph <urn:x-arq:UnionGraph>
>>>>
>>>>        Andy
>>>>
>>>
>>>
>

Re: Can the default graph be defined as the union of all named graphs?

Posted by Andy Seaborne <an...@apache.org>.
In default union graph mode, the "graph = set of triples" is handled 
correctly.  Triples appear only once.

SELECT * { ?s ?p ?o }

It is not the same as:

SELECT ?s ?p ?o {
   GRAPH ?g { ?s ?p ?o }
}

	Andy

On 29/04/15 18:04, Olivier Rossel wrote:
> Then what is the standard query to list all triples of the store only once?
>
> On Wed, Apr 29, 2015 at 5:31 PM, Daniel Hernández <da...@degu.cl> wrote:
>> Thanks! I have to ran queries with property property paths against an
>> TDB that have several named graphs. I need that named graphs look as
>> they where a single graph.
>>
>> Daniel
>>
>> On Wed, 2015-04-29 at 10:20 +0100, Andy Seaborne wrote:
>>> On 28/04/15 22:34, Daniel Hernández wrote:
>>>> hi all,
>>>>
>>>> I have a dataset that have millions of named graph and I want to
>>>> query a property path against the union of all. It is not practical
>>>> to list all named graphs with FROM clauses, because they are millions.
>>>> Thus, I wan't to know if it is possible to set fuseki to assume
>>>> that the default graph is the union of all named graphs.
>>>>
>>>> Thanks,
>>>> Daniel
>>>
>>> Yes (if TDB backed).
>>>
>>> Either in the assembler for the TDB dataset, or "--set
>>> tdb:unionDefaultGraph=true" what starting Fuseki.
>>>
>>> https://jena.apache.org/documentation/tdb/configuration.html#query-of-the-union-of-named-graphs
>>>
>>> Or query graph <urn:x-arq:UnionGraph>
>>>
>>>        Andy
>>>
>>
>>


Re: Can the default graph be defined as the union of all named graphs?

Posted by Olivier Rossel <ol...@gmail.com>.
Then what is the standard query to list all triples of the store only once?

On Wed, Apr 29, 2015 at 5:31 PM, Daniel Hernández <da...@degu.cl> wrote:
> Thanks! I have to ran queries with property property paths against an
> TDB that have several named graphs. I need that named graphs look as
> they where a single graph.
>
> Daniel
>
> On Wed, 2015-04-29 at 10:20 +0100, Andy Seaborne wrote:
>> On 28/04/15 22:34, Daniel Hernández wrote:
>> > hi all,
>> >
>> > I have a dataset that have millions of named graph and I want to
>> > query a property path against the union of all. It is not practical
>> > to list all named graphs with FROM clauses, because they are millions.
>> > Thus, I wan't to know if it is possible to set fuseki to assume
>> > that the default graph is the union of all named graphs.
>> >
>> > Thanks,
>> > Daniel
>>
>> Yes (if TDB backed).
>>
>> Either in the assembler for the TDB dataset, or "--set
>> tdb:unionDefaultGraph=true" what starting Fuseki.
>>
>> https://jena.apache.org/documentation/tdb/configuration.html#query-of-the-union-of-named-graphs
>>
>> Or query graph <urn:x-arq:UnionGraph>
>>
>>       Andy
>>
>
>

Re: Can the default graph be defined as the union of all named graphs?

Posted by Daniel Hernández <da...@degu.cl>.
Thanks! I have to ran queries with property property paths against an
TDB that have several named graphs. I need that named graphs look as
they where a single graph.

Daniel

On Wed, 2015-04-29 at 10:20 +0100, Andy Seaborne wrote:
> On 28/04/15 22:34, Daniel Hernández wrote:
> > hi all,
> >
> > I have a dataset that have millions of named graph and I want to
> > query a property path against the union of all. It is not practical
> > to list all named graphs with FROM clauses, because they are millions.
> > Thus, I wan't to know if it is possible to set fuseki to assume
> > that the default graph is the union of all named graphs.
> >
> > Thanks,
> > Daniel
> 
> Yes (if TDB backed).
> 
> Either in the assembler for the TDB dataset, or "--set 
> tdb:unionDefaultGraph=true" what starting Fuseki.
> 
> https://jena.apache.org/documentation/tdb/configuration.html#query-of-the-union-of-named-graphs
> 
> Or query graph <urn:x-arq:UnionGraph>
> 
> 	Andy
> 



Re: Can the default graph be defined as the union of all named graphs?

Posted by Andy Seaborne <an...@apache.org>.
On 28/04/15 22:34, Daniel Hernández wrote:
> hi all,
>
> I have a dataset that have millions of named graph and I want to
> query a property path against the union of all. It is not practical
> to list all named graphs with FROM clauses, because they are millions.
> Thus, I wan't to know if it is possible to set fuseki to assume
> that the default graph is the union of all named graphs.
>
> Thanks,
> Daniel

Yes (if TDB backed).

Either in the assembler for the TDB dataset, or "--set 
tdb:unionDefaultGraph=true" what starting Fuseki.

https://jena.apache.org/documentation/tdb/configuration.html#query-of-the-union-of-named-graphs

Or query graph <urn:x-arq:UnionGraph>

	Andy


Re: Can the default graph be defined as the union of all named graphs?

Posted by Rob Vesse <rv...@dotnetrdf.org>.
GRAPH clauses only access named graphs so No the triples will not appear
twice because such a query does not access the default graph

Rob

On 29/04/2015 11:33, "Olivier Rossel" <ol...@gmail.com> wrote:

>What happens in that case, if I query the data like this:
>
>select * where {graph ?g {?s ?p ?o}}
>
>will all triples appear twice?
>(once in their original named graph, and once in the "default" named
>graph)
>
>On Wed, Apr 29, 2015 at 10:46 AM, Rob Vesse <rv...@dotnetrdf.org> wrote:
>> See the Fuseki configuration documentation:
>>
>> 
>>http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html#td
>>b
>>
>> The example for TDB shows the use of the tdb:unionDefaultGraph property
>>to
>> enable this functionality
>>
>> Rob
>>
>> On 28/04/2015 22:34, "Daniel Hernández" <da...@degu.cl> wrote:
>>
>>>hi all,
>>>
>>>I have a dataset that have millions of named graph and I want to
>>>query a property path against the union of all. It is not practical
>>>to list all named graphs with FROM clauses, because they are millions.
>>>Thus, I wan't to know if it is possible to set fuseki to assume
>>>that the default graph is the union of all named graphs.
>>>
>>>Thanks,
>>>Daniel
>>
>>
>>
>>





Re: Can the default graph be defined as the union of all named graphs?

Posted by Olivier Rossel <ol...@gmail.com>.
What happens in that case, if I query the data like this:

select * where {graph ?g {?s ?p ?o}}

will all triples appear twice?
(once in their original named graph, and once in the "default" named graph)

On Wed, Apr 29, 2015 at 10:46 AM, Rob Vesse <rv...@dotnetrdf.org> wrote:
> See the Fuseki configuration documentation:
>
> http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html#tdb
>
> The example for TDB shows the use of the tdb:unionDefaultGraph property to
> enable this functionality
>
> Rob
>
> On 28/04/2015 22:34, "Daniel Hernández" <da...@degu.cl> wrote:
>
>>hi all,
>>
>>I have a dataset that have millions of named graph and I want to
>>query a property path against the union of all. It is not practical
>>to list all named graphs with FROM clauses, because they are millions.
>>Thus, I wan't to know if it is possible to set fuseki to assume
>>that the default graph is the union of all named graphs.
>>
>>Thanks,
>>Daniel
>
>
>
>

Re: Can the default graph be defined as the union of all named graphs?

Posted by Rob Vesse <rv...@dotnetrdf.org>.
See the Fuseki configuration documentation:

http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html#tdb

The example for TDB shows the use of the tdb:unionDefaultGraph property to
enable this functionality

Rob

On 28/04/2015 22:34, "Daniel Hernández" <da...@degu.cl> wrote:

>hi all,
>
>I have a dataset that have millions of named graph and I want to
>query a property path against the union of all. It is not practical
>to list all named graphs with FROM clauses, because they are millions.
>Thus, I wan't to know if it is possible to set fuseki to assume
>that the default graph is the union of all named graphs.
>
>Thanks,
>Daniel





Re: Can the default graph be defined as the union of all named graphs?

Posted by Osma Suominen <os...@helsinki.fi>.
On 29/04/15 00:34, Daniel Hernández wrote:
> hi all,
>
> I have a dataset that have millions of named graph and I want to
> query a property path against the union of all. It is not practical
> to list all named graphs with FROM clauses, because they are millions.
> Thus, I wan't to know if it is possible to set fuseki to assume
> that the default graph is the union of all named graphs.

Hi Daniel!

TDB has a configuration option tdb:unionDefaultGraph that I believe does 
what you want. See
https://jena.apache.org/documentation/tdb/datasets.html
https://jena.apache.org/documentation/tdb/configuration.html

-Osma


-- 
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Teollisuuskatu 23)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.suominen@helsinki.fi
http://www.nationallibrary.fi