Package com.complexible.stardog.api
Interface Remover
-
public interface Remover
Interface for an object which can remove RDF data from a Stardog database.
Usage:
// remove a single statement c.remove().statements(s,p,o); // we can remove an entire context c.remove().context(cxt);
The changes done through this class might not be sent immediately to the server. The client connection may batch the changes locally and delay sending those changes to the server to minimize the number of network calls. This is an implementation detail and will not change the execution order of read and write operations performed within the transaction.
- Since:
- 0.3
- Version:
- 6.0
- Author:
- Michael Grove
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Remover
all()
Delete the entire contents of the database.Remover
context(Resource theContext)
Remove the context and all the statements within from the database.Remover
graph(java.util.Collection<Statement> theGraph, Resource... theContext)
Remove the specified graph from the database.IO
io()
Get anIO
object to remove contents from an IO sourceRemover
statement(Statement theStatement)
Remove a statement from the database.Remover
statements(Resource theSubj, IRI thePred, Value theObj, Resource... theContexts)
Remove a statement or statements from the database; null's can be used in any position to indicate a wildcard matching anything in that position, thereby removing multiple statements.
-
-
-
Method Detail
-
statement
Remover statement(Statement theStatement) throws StardogException
Remove a statement from the database.- Parameters:
theStatement
- the statement to remove- Returns:
- this object
- Throws:
StardogException
- if there was an error while removing this statement
-
statements
Remover statements(Resource theSubj, IRI thePred, Value theObj, Resource... theContexts) throws StardogException
Remove a statement or statements from the database; null's can be used in any position to indicate a wildcard matching anything in that position, thereby removing multiple statements. If contexts are specified, all statements matching the given SPO pattern will be removed from each context.- Parameters:
theSubj
- the subject, or null for a wildcardthePred
- the predicate, or null for a wildcardtheObj
- the object, or null for a wildcardtheContexts
- the context, or null for a wildcard- Returns:
- this remover
- Throws:
StardogException
- if there was an error removing
-
context
Remover context(Resource theContext) throws StardogException
Remove the context and all the statements within from the database. If the context isContexts.DEFAULT
, this will remove the default graph (no context). If you want to remove everything in the database regardless of context, useall()
.- Parameters:
theContext
- the context to remove- Returns:
- this remover
- Throws:
StardogException
- if there was an error while removing
-
graph
Remover graph(java.util.Collection<Statement> theGraph, Resource... theContext) throws StardogException
Remove the specified graph from the database. If contexts are specified, any context specified on the statements within the graph are ignored.- Parameters:
theGraph
- the graph to removetheContext
- the optional context to remove from- Returns:
- this remover
- Throws:
StardogException
- if there is an error while removing
-
all
Remover all() throws StardogException
Delete the entire contents of the database.- Returns:
- this remover
- Throws:
StardogException
- if there is an error while removing
-
io
IO io() throws StardogException
Get anIO
object to remove contents from an IO source- Returns:
- an IO object to use for removal
- Throws:
StardogException
- if there is an error while creating the IO source
-
-