com.clarkparsia.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);

        // or the results of a query
        c.remove().query(constructQuery);
 

Since:
0.3
Version:
1.2
Author:
Michael Grove

Method Summary
 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(Graph theGraph, Resource... theContext)
          Remove the specified graph from the database.
 IO io()
          Get an IO object to remove contents from an IO source
 Remover query(Query theQuery)
          Deprecated. will be removed in the next major version of Stardog (1.3)
 Remover statement(Statement theStatement)
          Remove a statement from the database.
 Remover statements(Resource theSubj, URI 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,
                   URI 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 #allUser.

Parameters:
theContext - the context to remove
Returns:
this remover
Throws:
StardogException - if there was an error while removing

graph

Remover graph(Graph 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

query

@Deprecated
Remover query(Query theQuery)
              throws StardogException
Deprecated. will be removed in the next major version of Stardog (1.3)

Remove the results of the query from the database. The query must be a construct query.

Parameters:
theQuery - the query to execute
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


Copyright © 2010-2013 Clark & Parsia. All Rights Reserved.