You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Andrew U Frank <fr...@geoinfo.tuwien.ac.at> on 2017/06/01 16:16:16 UTC
query against the default graph and a a graph with a label
i try to combine two queries where one goes against the default graph in
which data were loaded and the other against a specific graph.
SELECT *
from <http://localhost:3030/fabeln2/data/wn>
WHERE {
?s wn:translation ?o .
}
LIMIT 25
and
SELECT *
WHERE {
?s lit:hl1 ?o.
}
LIMIT 25
give both the expected results.
If i add the graph to the second query (in order to formulate a query
connecting the two grahs):
SELECT *
from <http://localhost:3030/fabeln2/data/wn>
WHERE {
?s lit:hl1 ?o.
}
LIMIT 25
i get nothing.
How to include the "default graph" in fuseki to combine with other graphs?
thank you!
andrew
Re: query against the default graph and a a graph with a label
Posted by Andy Seaborne <an...@apache.org>.
On 01/06/17 17:16, Andrew U Frank wrote:
> i try to combine two queries where one goes against the default graph in
> which data were loaded and the other against a specific graph.
>
> SELECT *
> from <http://localhost:3030/fabeln2/data/wn>
I think you want to use GRAPH in query pattern, not FROM.
FROM means use that graph exactly - not any data in the storage default
graph.
To access one graph, it is better to use GRAPH:
SELECT *
WHERE {
GRAPH <http://localhost:3030/fabeln2/data/wn> {
?s lit:hl1 ?o.
}
}
LIMIT 25
> WHERE {
> ?s wn:translation ?o .
> }
> LIMIT 25
>
> and
>
> SELECT *
> WHERE {
> ?s lit:hl1 ?o.
> }
> LIMIT 25
>
> give both the expected results.
> If i add the graph to the second query (in order to formulate a query
> connecting the two grahs):
>
> SELECT *
> from <http://localhost:3030/fabeln2/data/wn>
> WHERE {
> ?s lit:hl1 ?o.
> }
> LIMIT 25
>
> i get nothing.
SELECT *
WHERE {
GRAPH <http://localhost:3030/fabeln2/data/wn> {
?s lit:hl1 ?o.
}
?s wn:translation ?o .
} LIMIT 25
> How to include the "default graph" in fuseki to combine with other graphs?
Another optiuon is to use "default union graph" - the default graph is
the union of all named graphs.
Andy
>
> thank you!
> andrew
>