On 05/02/13 16:27, Paul Taylor wrote:
Hello there,
I would like to know whether I can feed an SDBStore (backed by MySQL)
with triples that I get from a remote SPARQL endpoint using a
federated SERVICE query without loading the entire ResultSet into
memory. A concrete example of what I would like to achieve is the
following: ask a SELECT * WHERE {?s ?p ?o} over a remote SPARQL
endpoint and store the retrieved triples into a local SDBStore
directly not in a ResultSet in memory.
One way to approach this is to ask the remote endpoint directly to
return triples:
CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }
(but that may be too large.)
Then load from the file on disk.
If this is not possible I was thinking to retrieve the triples from
the remote SPARQL service in chunks, get the ResultSet in memory, and
then add them to the SDBStore, is this reasonable? How do I go about
to formulate such a query? Using a OFFSET construct of a SPARQL
query? Also, I was thinking whether is possible to get a Model object
using a CONSTRUCT query directly into the SDBStore?
To slice: if SPARQL 1.1 remote endpoint:
CONSTRUCT { ?s ?p ?o } WHERE
{
SELECT ?s ?p ?o { ?s ?p ?o } OFFSET NNN LIMIT NNN
}
else this may work (slower), use SERVICE and a local query and get slices:
CONSTRUCT { ?s ?p ?o } WHERE
{
SERVICE <foo> {
SELECT ?s ?p ?o { ?s ?p ?o } OFFSET NNN LIMIT NNN
}
}
issue repeatedly, write files to disk and load from disk
and hope repeated OFFSET LIMIT is OK.
Andy