Reputation: 352
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?
Upvotes: 1
Views: 114
Reputation: 16700
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.
Upvotes: 0