| org.ontoware.rdf2go.model.ModelSet
All known Subclasses: org.ontoware.rdf2go.model.impl.DelegatingModelSet, org.ontoware.rdf2go.model.impl.AbstractModelSetImpl,
ModelSet | public interface ModelSet extends Sparqlable,ModelSetIO,FindableModelSet,ModelSetAddRemove,ModelValueFactory,Commitable,ReificationSupport(Code) | | A ModelSet is like a Graph Data Set in SPARQL. It contains a number of named
graphs (Models), which might be empty. Additionally, one special unnamed
model, the 'Default Model' belongs to a ModelSet.
ModelSet offers a number of methods that make it behave like a quad store,
however, when e.g. removing all statements with a certain context, the model
named with that context still remains in the ModelSet.
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.
The context URI of the default modell is 'null'.
author: max author: sauermann |
addModel | boolean addModel(Model model)(Code) | | Adds a model to this ModelSet. Creating the named-graph if needed, adding
the triples to it if not.
This method might be much quicker than addAll(model.iterator()) depending
on the implementation.
Parameters: model - true if successful |
close | void close()(Code) | | Close connection to defined, unterlying implementation
|
containsModel | boolean containsModel(URI contextURI)(Code) | | Parameters: contextURI - true if a Model (NamedGraph) named 'contextURI' is known. Themodel might be empty. Some implementations don't manage modelsexplicitly, here empty models cna never exist. |
createStatement | Statement createStatement(URI context, Resource subject, URI predicate, Node object)(Code) | | Creates a statement with a context URI.
Parameters: context - Parameters: subject - Parameters: predicate - Parameters: object - |
createURI | URI createURI(String uriString) throws ModelRuntimeException(Code) | | Creates an RDF2Go URI. This allows a user to create a model via
'getModel( URI )'.
Parameters: uriString - an RDF2Go URI throws: ModelRuntimeException - if URI has not a valid URI fomat - according to the adapter |
dump | void dump()(Code) | | Print the whole content of this ModelSet to System.out.
|
getDefaultModel | Model getDefaultModel()(Code) | | The default model is used when the modelset is loaded from a
serialization that has no context. The default model has a context of
'null'
the default model. It has to be isOpen() == true. |
getModel | Model getModel(URI contextURI)(Code) | | Get the Model with the passed URI. If the model does not exist yet, an
empty model will be created and returned.
Note that the returned model is tied to this modelset, and any changes in
the model will be reflected here.
Parameters: contextURI - the URI of the context. This is the same as the name of thenamed graph. the model identified by this context. May have a size of 0, if nodata was added to it yet. Never returns null. It has to be isOpen() == true. |
getModelURIs | ClosableIterator<URI> getModelURIs()(Code) | | an iterator over all URIs used as model URIs.For some implementations: While you read the iterator you may not WRITEto the models. |
getModels | ClosableIterator<Model> getModels()(Code) | | an Interator over all models within this ModelSet.Some models might be empty.Since 4.4.10: Each model has to be isOpen() == true.For some implementations: While you read the iterator you may not WRITEto the models. |
getUnderlyingModelSetImplementation | Object getUnderlyingModelSetImplementation()(Code) | | the native implementation (e.g. a Jena Model). Using this methodbreaks strict triple store independence, but exposes the fullpower and reduces API dependence. This method is part ofthe main API. |
isEmpty | boolean isEmpty()(Code) | | true if all models in this ModelSet contain zero statements. Thismethod might be faster than calling size() == 0 on each model.Note: This method can return isEmpty == true, even if theModelSet contains a number of models. |
isOpen | boolean isOpen()(Code) | | true if ModelSet is open |
open | void open()(Code) | | Open connection to defined, unterlying implementation
|
removeModel | boolean removeModel(URI contextURI)(Code) | | Removes the Model (NamedGraph) denoted by contextURI from this modelset.
If the model contains statements, they are deleted.
Parameters: contextURI - true if successful |
size | long size() throws ModelRuntimeException(Code) | | The number of explicit statements. Statements that are inferred e.g.
using backward-chaining are per definition not in this number, and also
some inferred stateemtns may or may be not part of ths size, depending on
the implementation of the model. If a new triple is added to the model,
the size must increase.
the number of statements in the modelset. throws: ModelRuntimeException - |
|
|