org.ontoware.rdf2go.model
Interface ModelSetAddRemove
- All Superinterfaces:
- ClosableIterable<Statement>, java.lang.Iterable<Statement>, Lockable
- All Known Subinterfaces:
- ModelSet
public interface ModelSetAddRemove
- extends ClosableIterable<Statement>, Lockable
Allows to add and removes statements from a ModelSet. Statements without a
context are added/removed from the default model.
For plain triples models, this is modeled as a number of interfaces:
ClosableIterable, ModelWriter, Lockable
- Author:
- voelkel
|
Method Summary |
void |
addAll(java.util.Iterator<? extends Statement> statement)
For each statement in the iterator, this method creates a Model named
statement.getContextURI if needed. |
void |
addStatement(Statement statement)
This method creates a Model named statement.getContextURI if needed. |
void |
addStatement(URI contextURI,
Resource subject,
URI predicate,
Node object)
This method creates a Model named 'contextURI' if needed. |
void |
removeAll(java.util.Iterator<? extends Statement> statement)
For each statement in the iterator, the statement is removed form the
model named statement.getContext(); If the model named
statement.getContext() becomes empty, it remains in the ModelSet. |
void |
removeStatement(Statement statement)
Removes the statement (s,p,o) from a model named statement.getContext(). |
void |
removeStatement(URI contextURI,
Resource subject,
URI predicate,
Node object)
Removes the statement (s,p,o) from a model named contextURI. |
void |
removeStatements(QuadPattern quadPattern)
Find all models matching the context of the pattern and remove all
matching triple patterms from them |
void |
removeStatements(UriOrVariable context,
ResourceOrVariable subject,
UriOrVariable predicate,
NodeOrVariable object)
Find all models matching the context, and remove all (subject, property
,object)-statements from these model |
void |
update(DiffReader diff)
Apply the changes given by this diff in one atomic operation
Implementations must check that all statements to be removed are still in
the Model. |
addStatement
void addStatement(URI contextURI,
Resource subject,
URI predicate,
Node object)
throws ModelRuntimeException
- This method creates a Model named 'contextURI' if needed. Then the
statement (s,p,o) is inserted into that model.
- Parameters:
contextURI - a URI or nullsubject - a Resource (URI or BlankNode)predicate - object - a Node
- Throws:
ModelRuntimeException - if any internal (I/O related) exception occurs
addStatement
void addStatement(Statement statement)
throws ModelRuntimeException
- This method creates a Model named statement.getContextURI if needed. Then
the statement (s,p,o) is inserted into that model.
- Parameters:
statement -
- Throws:
ModelRuntimeException - if any internal (I/O related) exception occurs
addAll
void addAll(java.util.Iterator<? extends Statement> statement)
throws ModelRuntimeException
- For each statement in the iterator, this method creates a Model named
statement.getContextURI if needed. Then the statement (s,p,o) is inserted
into that model.
- Parameters:
statement -
- Throws:
ModelRuntimeException - if any internal (I/O related) exception occurs
removeStatement
void removeStatement(URI contextURI,
Resource subject,
URI predicate,
Node object)
throws ModelRuntimeException
- Removes the statement (s,p,o) from a model named contextURI. If the model
named 'contextURI' becomes empty, it remains in the ModelSet.
- Parameters:
context - a URI or nullsubject - a Resource (URI or BlankNode)predicate - object - a Node
- Throws:
ModelRuntimeException - if any internal (I/O related) exception occurs
removeStatement
void removeStatement(Statement statement)
throws ModelRuntimeException
- Removes the statement (s,p,o) from a model named statement.getContext().
If the model named statement.getContext() becomes empty, it remains in
the ModelSet.
- Parameters:
statement - a Statement
- Throws:
ModelRuntimeException - if any internal (I/O related) exception occurs
removeAll
void removeAll(java.util.Iterator<? extends Statement> statement)
throws ModelRuntimeException
- For each statement in the iterator, the statement is removed form the
model named statement.getContext(); If the model named
statement.getContext() becomes empty, it remains in the ModelSet.
- Parameters:
statement -
- Throws:
ModelRuntimeException - if any internal (I/O related) exception occurs
removeStatements
void removeStatements(QuadPattern quadPattern)
throws ModelRuntimeException
- Find all models matching the context of the pattern and remove all
matching triple patterms from them
- Parameters:
quadPattern -
- Throws:
ModelRuntimeException
removeStatements
void removeStatements(UriOrVariable context,
ResourceOrVariable subject,
UriOrVariable predicate,
NodeOrVariable object)
throws ModelRuntimeException
- Find all models matching the context, and remove all (subject, property
,object)-statements from these model
- Throws:
ModelRuntimeException
update
void update(DiffReader diff)
throws ModelRuntimeException
- Apply the changes given by this diff in one atomic operation
Implementations must check that all statements to be removed are still in
the Model. Otherwise an exception is thrown.
First all triples to be removed are removed, then triples to be added are
added.
In this modelset, this means (s,p,o) is removed from the graph named c,
for all statements (c,s,p,o). Note: Models becoming empty are not
removed.
- Parameters:
diff -
- Throws:
ModelRuntimeException - if a model or statement in a model to be removed does not
exist.
Copyright © 2005-2008 FZI - Forschungszentrum Informatik | Karlsruhe | Germany. All Rights Reserved.