On 10/07/13 14:42, Rob Walpole wrote:
Hi Andy,
Thanks for your reply.
That load for the purpose of the query ... you already have the data in
the dataset. Remove these.
Did you load into "http://example.org/bob"
So I used tdbloader2 to store dft.ttl into an empty instance of TDB. I
assume this places the data in the default graph? The dft.ttl data looks
like this:
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<http://example.org/bob> dc:publisher "Bob Hacker" .
<http://example.org/alice> dc:publisher "Alice Hacker" .
and as you see in the putput, all record of "dft.ttl" has gone. When
loaded into the unnamed default graph, there is no name.
Then you use:
"""
SELECT ?who ?g ?mbox
FROM <http://example.org/dft.ttl>
FROM NAMED <http://example.org/alice>
FROM NAMED <http://example.org/bob>
"""
but there is no <http://example.org/dft.ttl> (which in TDB means it's
empty).
And
?g dc:publisher ?who .
matches nothing.
You don't need the FROM/FROM NAMED for this query.
Then I used s-put to store bob.ttl and alice.ttl into the named graphs
http://example.org/bob and http://example.org/alice respectively.
bob.ttl looks like this:-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
_:a foaf:name "Bob" .
_:a foaf:mbox <mailto:[email protected]> .
and alice.ttl looks like this...
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
_:a foaf:name "Alice" .
_:a foaf:mbox <mailto:[email protected]> .
When I run the query though I get no results.
Run this:
SELECT * {
{ ?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } }
}
to see what you have.
I have this:-
--------------------------------------------------------------------------------------------------------------------------------------------
| s | p
| o | g |
============================================================================================================================================
| <http://example.org/bob> |
<http://purl.org/dc/elements/1.1/publisher> | "Bob Hacker"
| |
| <http://example.org/alice> |
<http://purl.org/dc/elements/1.1/publisher> | "Alice Hacker"
| |
| _:b0 | <http://xmlns.com/foaf/0.1/mbox>
| <mailto:[email protected]> | <http://example.org/bob> |
| _:b0 | <http://xmlns.com/foaf/0.1/name>
| "Bob" | <http://example.org/bob> |
| _:b1 | <http://xmlns.com/foaf/0.1/mbox>
| <mailto:[email protected]> | <http://example.org/alice> |
| _:b1 | <http://xmlns.com/foaf/0.1/name>
| "Alice" | <http://example.org/alice> |
--------------------------------------------------------------------------------------------------------------------------------------------
I have tried using the form <http://localhost:3030/my-**
dataset/data?default <http://localhost:3030/my-dataset/data?default>>
but this has no affect (although I can download the data from here...)
Longer:
In TDB it picks FROM/FROM NAMED from the set of already loaded named
graphs.
http://jena.apache.org/**documentation/tdb/dynamic_**datasets.html<http://jena.apache.org/documentation/tdb/dynamic_datasets.html>
But it is only from data already loaded. You probably don't want to do
that.
Are you using union mode?
Well yes that is what I want - all of the data is loaded but some is in
what I think is the default graph and some is in named graphs. Are you
saying that the default graph is either the data not in named graph or the
combination of named graphs? It can only be one or the other?
Yes, roughly speaking. The default union graph at query time masks the
stored default graph. Actually, the default graph is there under the
pseudo name:
<urn:x-arq:DefaultGraph>
Andy
Thanks
Rob