title: Most efficient way to clear a named graph?
body: <p>I am working with an instance of Ontotext GraphDB and often want to clear a named graph with a large number of triples. </p>
  
  <p>Currently, my technique involves issuing a SPARQL command to the graph server, which searches and matches a triple pattern of every triple in the named graph:</p>
  
  <pre><code>DELETE { GRAPH example:exampleGraph { ?s ?p ?o }} WHERE {?s ?p ?o .}
  </code></pre>
  
  <p>When there are a lot of triples, this approach often takes quite some time to clear the named graph.</p>
  
  <p>I am wondering whether there is a more efficient way to do this. Even a triplestore-specific solution would be acceptable to me.  </p>
  
  <p>I should also note that I am using the RDF4J library to communicate with the graph. I understand that certain solutions may work on the Ontotext web interface, but I am only interested in a solution which I can implement programatically.</p>