简体   繁体   中英

Is there a way to use a DataAccessor from Jena to use the graph store protocol with Virtuoso?

I tried to insert a dataset using a DataAccessor from jena withL

DatasetAccessor authAcc = DatasetAccessorFactory.createHTTP("http://192.168.56.101:8890/sparql-graph-crud-auth", auth);
authAcc.putModel("oole:g1",dataset.getDefaultModel());

But it does not seem to work, I also tried to PUT the same file using curl and I spotted a difference in the HTTP header.

From jena:

PUT /sparql-graph-crud-auth?graph=oole:g1 HTTP/1.1

While from curl doing:

curl --digest --user usr:pwd --verbose --url "http://192.168.56.101:8890/sparql-graph-crud-auth?graph-uri=oole:g1" -T file.ttl 

I get:

PUT /sparql-graph-crud-auth?graph-uri=oole:g1 HTTP/1.1

The difference seems to be graph-uri as oppsed to graph. Is there any way i can still use the DataAccessor from Jena?

DatasetAccessor is the API to the SPARQL Graph Store Protocol and there it says graph= . This is wired into DatasetAccessorGraphHTTP .

Being open source, if you need something different you could take a copy of that one class, modify it locally (method DatasetAccessorGraphHTTP.target ) to have your own implementation.

It is all built on top of some HTTP convenience code in HttpOp which you could call directly but your own modified DatasetAccessorGraphHTTP looks to be less work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM