Alex Boyarintsev
Alex Boyarintsev

Reputation: 135

Removing triples from RDF4j Native Store seems quite slow

I've got an RDF4j disk based Native Store with roughly 9M of triples. I'm trying to improve the performance of deleting of about 4K triples which now takes ~20 seconds. I've tried:

1

    Repository rep = new SailRepository(new NativeStore(new File(DATA_DIR + "/db"), "spoc, posc, opsc"));
    diskRep.initialize();
    RepositoryConnection conn = rep.getConnection();
    conn.remove(statements); // first find statements, then pass them into remove method

2

    // Execute with conn.prepareUpdate(QueryLanguage.SPARQL, query)
    DELETE DATA 
    {
      <#book2> <http://purl.org/dc/elements/1.1/title>   "David Copperfield" ; 
             <http://purl.org/dc/elements/1.1/creator> "Edmund Wells"      .
      // all triples explicitly here
    }

3

    // Execute with conn.prepareUpdate(QueryLanguage.SPARQL, query)
    DELETE { ?person ?property ?value } 
    WHERE 
      { ?person ?property ?value ; <http://xmlns.com/foaf/0.1/givenName> "Fred" }
      // query pattern

All three methods show similar timings. I believe there's a quicker way to remove 4K triples. Please, let me know if you've got any ideas of what I'm doing wrong. I'll be glad to provide additional details.

Upvotes: 1

Views: 529

Answers (1)

Jeen Broekstra
Jeen Broekstra

Reputation: 22052

This turned out to be caused by a bug in Rdf4j (see https://github.com/eclipse/rdf4j/issues/1425). It has been fixed in release 2.5.2.

Upvotes: 2

Related Questions