Class UpdateWithModelBuilder
java.lang.Object
org.eclipse.rdf4j.spring.dao.support.UpdateWithModelBuilder
An Operation
that holds a Model
internally and exposes a ModelBuilder
for adding to it.
Moreover it allows for deleting statements.
Thus, the class provides a way of configuring an update to the repository incrementally, and no repository access
happens until execute()
is called. (unless the client uses applyToConnection(Function)
and accesses
the repository that way.)
remove(org.eclipse.rdf4j.model.Resource, org.eclipse.rdf4j.model.IRI, org.eclipse.rdf4j.model.Value, org.eclipse.rdf4j.model.Resource...)
will remove them from the repository when execute()
is called;
moreover, the statements will also be removed from the model at the time of the remove(org.eclipse.rdf4j.model.Resource, org.eclipse.rdf4j.model.IRI, org.eclipse.rdf4j.model.Value, org.eclipse.rdf4j.model.Resource...)
call, such that a
subsequent creation of some of the deleted statements to the model will result in those triples being first deleted
and then added to the repository when execute()
is called.- Since:
- 4.0.0
- Author:
- Florian Kleedorfer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptConnection
(Consumer<RepositoryConnection> connectionConsumer) <T> T
applyToConnection
(Function<RepositoryConnection, T> function) void
execute()
static UpdateWithModelBuilder
fromTemplate
(RDF4JTemplate template) namedGraph
(String prefixedNameOrIRI) namedGraph
(Resource namedGraph) Will remove statements upon update execution, before processing any additions.setNamespace
(String prefix, String namespace) withSink
(Consumer<Collection<Statement>> consumer)
-
Constructor Details
-
UpdateWithModelBuilder
-
-
Method Details
-
fromTemplate
-
remove
public UpdateWithModelBuilder remove(Resource subject, IRI predicate, Value object, Resource... resources) Will remove statements upon update execution, before processing any additions. Statements that are removed here are also removed from the #addModel at the time of this call (not upon update execution)The semantics of
RepositoryConnection.remove(Iterable, Resource...)
apply, i.e. the resource(s) specified here are used there, if any.- Parameters:
subject
- the subject, or null to match any resourcepredicate
- the predicate, or null to match any IRIobject
- the object, or null to match any valueresources
- the context(s), if any- Returns:
- this builder
-
setNamespace
-
setNamespace
-
subject
-
subject
-
namedGraph
-
namedGraph
-
defaultGraph
-
addMaybe
-
add
-
addMaybe
-
add
-
addMaybe
-
add
-
addMaybe
-
add
-
addMaybe
-
add
-
acceptConnection
-
applyToConnection
-
createBNode
-
withSink
-
execute
public void execute()
-