public interface ModelSet extends Sparqlable, ModelSetIO, FindableModelSet, ModelSetAddRemove, ModelValueFactory, Commitable, ReificationSupport, NamespaceSupport
ModelSet
can be read from a named graph aware serialization such
as TRIG or TRIX using the read/write methods. If you read a serialization
that supports only one graph (like RDF/XML), a default model will be created.
Modifier and Type | Method and Description |
---|---|
boolean |
addModel(Model model)
Adds a model to this ModelSet.
|
void |
addModel(Model model,
URI contextURI)
Adds a complete
Model to the given contextURI. |
void |
addModelSet(ModelSet modelSet)
Adds a complete
ModelSet to this ModelSet. |
void |
close()
Close connection of the underlying implementation
|
boolean |
containsModel(URI contextURI) |
Statement |
createStatement(URI context,
Resource subject,
URI predicate,
Node object)
Creates a statement with a context URI.
|
URI |
createURI(String uriString)
Creates an RDF2Go URI.
|
void |
dump()
Print the whole content of this ModelSet to System.out.
|
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() |
ClosableIterator<URI> |
getModelURIs() |
Object |
getUnderlyingModelSetImplementation() |
boolean |
isEmpty() |
boolean |
isOpen() |
ModelSet |
open()
Open connection to the underlying implementation
|
void |
removeAll()
Removes all models, which is not the same as removing all
statements from all models in this ModelSet.
|
boolean |
removeModel(URI contextURI)
Removes the Model (NamedGraph) denoted by contextURI from this modelset.
|
long |
size()
The number of explicit statements.
|
queryConstruct, querySelect, sparqlAsk, sparqlConstruct, sparqlDescribe, sparqlSelect
readFrom, readFrom, readFrom, readFrom, readFrom, readFrom, serialize, writeTo, writeTo, writeTo, writeTo
contains, containsStatements, countStatements, createQuadPattern, findStatements, findStatements
addAll, addStatement, addStatement, removeAll, removeStatement, removeStatement, removeStatements, removeStatements, update
iterator
forEach, spliterator
createBlankNode, createBlankNode, createDatatypeLiteral, createLanguageTagLiteral, createPlainLiteral, createStatement, isValidURI, newRandomUniqueURI
commit, setAutocommit
addReificationOf, addReificationOf, deleteReification, getAllReificationsOf, hasReifications
getNamespace, getNamespaces, removeNamespace, setNamespace
ModelSet open()
boolean isOpen()
void close()
long size() throws ModelRuntimeException
ModelSet
.ModelRuntimeException
boolean isEmpty()
URI createURI(String uriString) throws ModelRuntimeException
createURI
in interface ModelValueFactory
uriString
- ModelRuntimeException
- if URI has not a valid URI format -
according to the adapterStatement createStatement(URI context, Resource subject, URI predicate, Node object)
context
- subject
- predicate
- object
- Model getModel(URI contextURI)
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.contextURI
- the URI of the context. This is the same as the name of
the named graph.boolean removeModel(URI contextURI)
contextURI
- boolean addModel(Model model)
model
- void addModel(Model model, URI contextURI) throws ModelRuntimeException
Model
to the given contextURI. The context URI of
the model is ignored.contextURI
- model
- ModelRuntimeException
- if any internal (I/O related) exception
occursvoid addModelSet(ModelSet modelSet) throws ModelRuntimeException
ModelSet
to this ModelSet. Context URIs in the
Statement
s of the modelSet are respected.contextURI
- modelSet
- ModelRuntimeException
- if any internal (I/O related) exception
occursboolean containsModel(URI contextURI)
contextURI
- void removeAll() throws ModelRuntimeException
ModelRuntimeException
Model getDefaultModel()
ClosableIterator<Model> getModels()
ClosableIterator<URI> getModelURIs()
Object getUnderlyingModelSetImplementation()
void dump()
Copyright © 2005–2018 IT-Consulting Dr. Max Völkel | Project started at FZI Forschungszentrum Informatik, www.fzi.de. All rights reserved.