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

  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(Collection<Statement> theGraph, Resource... theContext)`
  Remove the specified graph from the database.
  `IO`
  `io()`
  Get an `IO` object to remove contents from an IO source
  `Remover`
  `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 Details

  - ### 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 wildcard
      `thePred` - the predicate, or null for a wildcard
      `theObj` - the object, or null for a wildcard
      `theContexts` - 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 is `Contexts.DEFAULT`, this will remove the default graph (no context). If you want to remove everything in the database regardless of context, use `all()`.
    Parameters:
      `theContext` - the context to remove
    Returns:
      this remover
    Throws:
      `StardogException` - if there was an error while removing

  - ### graph

    Remover graph(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 remove
      `theContext` - 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 an `IO` 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