Hi, Andy, 

Again, many thanks for your help. It works perfectly. 

I come up with my own method that returns a namedGraphList 
--- List<String>. Basically, QueryEngineHTTP is used to create service request 
like:

String queryString = "SELECT ?ng { GRAPH ?ng {} }";
Query query = QueryFactory.create(queryString);

String service = getDatasetUri() + PropNameValue.query.getName();
QueryEngineHTTP qexec = 
(QueryEngineHTTP)QueryExecutionFactory.createServiceRequest(service, query);
ResultSet results = qexec.execSelect();

 
One more question:

What will be the best way to merge tow endpoints, one is the namedGraph at 
remote server and one is the local RDF file.
For example, the graph does not have status value, but the local rdf file has.  
Thanks.

Cheers, 
Frank. 

+++




________________________________
 From: Andy Seaborne <a...@apache.org>
To: users@jena.apache.org 
Sent: Wednesday, August 29, 2012 1:32 AM
Subject: Re: Remote named graph
 
On 28/08/12 23:19, Frank Lee wrote:
> Hi, Andy.
>
> Thanks so much for your warm help.
>
> Obtaining the handle of  DatasetAccessor what I really wanted. Thanks.
>
> BTW, how can we get the list/interator of namedGraphs from DatasetAccessor or 
> ARQ?

You can use:

SELECT ?g { GRAPH ?g {} }

the interface DatasetAccessor does not provide such an operation and you 
need to get it from elsewhere - the interface could be used to a thing 
that stores graphs as a distributed map without ability to enumerate all 
keys ... like a very large key-value store providing just the SPARQL 
Graph Store Protocol (which despite the name, is not a query protocol).

    Andy

>
> Thanks.
> Frank
>
>
>
> ________________________________
>   From: Andy Seaborne <a...@apache.org>
> To: users@jena.apache.org
> Sent: Tuesday, August 28, 2012 2:05 AM
> Subject: Remote named graph
>
>> Hi, Andy,
>>
>> It's easy to get the model for a named graph from local TDB dataset
>>
>> tdb_dir = "c:\\tdb";
>>
>> ds = TDBFactory.createDataset(tdb_dir);
>>
>>
>> String ngUri = "http://xxx .."
>> Model model = ds.getNamedModel(ngUri);
>>
>> However, if we run fuseki server with TDB remotely,  how can we get the 
>> model for the specified named graph?
>> For instance, the fuseki server run at remote server with IP address: 
>> 172.25.19.233 and tdb directory is /home/tdb at linux machine.
>>
>> Thanks.
>>
>> Frank
>>
>>
>> +++
>
> Frank,
>
> I'm not sure what you mean: access the remote named graph or pull its
> contents to the local machine.
>
> 1/ Access:
>
> Use GRAPH in a SPARQL query.
>
> 2/ The remote graph has a name using the SPARQL Graph store protocol:
>
> http://host/datasets/data?graph=http://xxx ..
>
> You can simple GET this although there is some code to present that
> nicely in Fuseki (DatasetAccessor).
>
> This is a local copy.
>
> (this code will move from Fuseki into ARQ sometime with a consequent
> package renaming)
>
>      Andy
>

Reply via email to