On 19/02/15 12:42, Trevor Donaldson wrote:
Thanks Andy for your feedback. I realized I can not use
datasetAccessor.putModel or datasetAccessor.add. After much trial and error
I have determined that the following allocates space (often doubling the
database size) and never releases it.
for(int i=0; i<1000;i++){
Resource s = ResourceFactory.createResource("http://example.org/A/
"+i);
Property p = ResourceFactory.createProperty("urn:my:id");
RDFNode o = ResourceFactory.createTypedLiteral(i);
Statement stmt = model.createStatement(s,p,o);
model.add(stmt);
}
datasetAccessor.putModel(GRAPH_NAME,model); //doesn't matter if I use
this or add(GRAPH_NAME,model)
One thing I have noticed is that if I use sparql inserts and deletes the
database size does not grow exponentially. I think the sparql query route
is probably more prone to error but since it seems more reliable as far as
database growth, I will go that route.
What are the inserts and deletes you are doing?
Something for use to look at. I would have through that putModel and an
equivalent SPARQL Update would cause very similar pace usage despite
being different routes through the code. Maybe the putModel route is
wrong in some way.
But first data point is whether the SPARQL Updates are indeed
sufficiently equivalent.
Andy