public class NotifyingModelSetLayer extends DelegatingModelSet implements NotifyingModelSet
baseModelSet
Constructor and Description |
---|
NotifyingModelSetLayer(ModelSet modelset) |
Modifier and Type | Method and Description |
---|---|
boolean |
addModel(Model model)
Adds a model to this ModelSet.
|
void |
addModelSetChangedListener(ModelChangedListener listener) |
void |
addModelSetChangedListener(ModelChangedListener listener,
QuadPattern pattern) |
void |
addStatement(Statement statement)
This method creates a Model named statement.getContextURI if needed.
|
Model |
getDefaultModel()
The default model is used when the ModelSet is loaded from a
serialisation that has no context.
|
Model |
getModel(URI contextURI)
Get the Model with the passed URI.
|
ClosableIterator<Model> |
getModels() |
void |
removeModelSetChangedListener(ModelChangedListener listener) |
void |
removeStatement(Statement statement)
Removes the statement (s,p,o) from a model named statement.getContext().
|
void |
update(DiffReader diff)
Apply the changes given by this diff
|
addModel, addModelSet, addReificationOf, addReificationOf, close, commit, containsModel, containsStatements, createBlankNode, createQuadPattern, createURI, deleteReification, findStatements, getAllReificationsOf, getDelegatedModelSet, getModelURIs, getNamespace, getNamespaces, getUnderlyingModelImplementation, getUnderlyingModelSetImplementation, hasReifications, isEmpty, isOpen, open, queryConstruct, querySelect, readFrom, readFrom, readFrom, readFrom, readFrom, readFrom, removeModel, removeNamespace, setAutocommit, setNamespace, size, sparqlAsk, sparqlConstruct, sparqlDescribe, sparqlSelect, writeTo, writeTo, writeTo, writeTo
addAll, addStatement, contains, countStatements, createBlankNode, createDatatypeLiteral, createLanguageTagLiteral, createPlainLiteral, createStatement, createStatement, dump, findStatements, isLocked, isValidURI, iterator, lock, newRandomUniqueURI, removeAll, removeAll, removeStatement, removeStatements, removeStatements, serialize, unlock
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createStatement, dump, removeAll
serialize
contains, countStatements, findStatements
addAll, addStatement, removeAll, removeStatement, removeStatements, removeStatements
iterator
forEach, spliterator
createBlankNode, createDatatypeLiteral, createLanguageTagLiteral, createPlainLiteral, createStatement, isValidURI, newRandomUniqueURI
public NotifyingModelSetLayer(ModelSet modelset)
public void addModelSetChangedListener(ModelChangedListener listener)
addModelSetChangedListener
in interface NotifyingModelSet
public void addModelSetChangedListener(ModelChangedListener listener, QuadPattern pattern)
addModelSetChangedListener
in interface NotifyingModelSet
listener
- to be notified on matching eventspattern
- all add or remove statement events matching the pattern
will be send to the listener. Updates are always send.public void removeModelSetChangedListener(ModelChangedListener listener)
removeModelSetChangedListener
in interface NotifyingModelSet
public boolean addModel(Model model)
ModelSet
addModel
in interface ModelSet
addModel
in class DelegatingModelSet
public void addStatement(Statement statement) throws ModelRuntimeException
ModelSetAddRemove
addStatement
in interface ModelSetAddRemove
addStatement
in class DelegatingModelSet
ModelRuntimeException
- if any internal (I/O related) exception occurspublic Model getDefaultModel()
ModelSet
getDefaultModel
in interface ModelSet
getDefaultModel
in class DelegatingModelSet
public Model getModel(URI contextURI)
ModelSet
ModelSet.isOpen()
is false.
Note that the returned model is tied to this ModelSet
. Any
changes in the model will be reflected here, closing this ModelSet will
close the returned Model. To avoid side-effects, closing the returned
Model will NOT close this ModelSet. Closing the returned model will not
affect objects returned by previous calls to this method, hence this
method should always return a new copy of the Model object to allow
callers to close() a returned model.getModel
in interface ModelSet
getModel
in class DelegatingModelSet
contextURI
- the URI of the context. This is the same as the name of
the named graph.public ClosableIterator<Model> getModels()
getModels
in interface ModelSet
getModels
in class DelegatingModelSet
public void removeStatement(Statement statement) throws ModelRuntimeException
ModelSetAddRemove
removeStatement
in interface ModelSetAddRemove
removeStatement
in class DelegatingModelSet
statement
- a StatementModelRuntimeException
- if any internal (I/O related) exception occurspublic void update(DiffReader diff) throws ModelRuntimeException
ModelSetAddRemove
update
in interface ModelSetAddRemove
update
in class DelegatingModelSet
ModelRuntimeException
- if the ModelSet is lockedCopyright © 2005–2017 IT-Consulting Dr. Max Völkel | Project started at FZI Forschungszentrum Informatik, www.fzi.de. All rights reserved.