|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ontoware.rdf2go.model.impl.AbstractModelWriter
org.ontoware.rdf2go.model.impl.AbstractModelAddRemove
org.ontoware.rdf2go.model.impl.AbstractModelRemovePatterns
org.ontoware.rdf2go.model.impl.AbstractModel
org.ontoware.rdf2go.model.impl.DelegatingModel
public class DelegatingModel
Delegates all calls to underlying model. This class is meant to be subclassed and have some methods overriden. This was inspired by Sesame's SAIL API.
| Field Summary |
|---|
| Fields inherited from class org.ontoware.rdf2go.model.impl.AbstractModel |
|---|
model |
| Constructor Summary | |
|---|---|
protected |
DelegatingModel()
Please set model! |
|
DelegatingModel(Model model)
|
| Method Summary | |
|---|---|
void |
addAll(java.util.Iterator<? extends Statement> other)
|
void |
addModel(Model model)
subclasses should overwrite this for performance reasons |
void |
addStatement(Resource subject,
URI predicate,
Node object)
|
void |
addStatement(Resource subject,
URI predicate,
java.lang.String literal)
|
void |
addStatement(Resource subject,
URI predicate,
java.lang.String literal,
java.lang.String languageTag)
|
void |
addStatement(Resource subject,
URI predicate,
java.lang.String literal,
URI datatypeURI)
|
void |
addStatement(Statement statement)
|
void |
addStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal)
|
void |
addStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal,
java.lang.String languageTag)
|
void |
addStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal,
URI datatypeURI)
|
void |
close()
Close connection to defined, unterlying implementation |
void |
commit()
OVERWRITE ME |
boolean |
contains(ResourceOrVariable subject,
UriOrVariable predicate,
NodeOrVariable object)
Convenience method. |
BlankNode |
createBlankNode()
|
BlankNode |
createBlankNode(java.lang.String internalID)
|
URI |
createURI(java.lang.String uriString)
|
void |
dump()
|
ClosableIterator<Statement> |
findStatements(ResourceOrVariable subject,
UriOrVariable predicate,
NodeOrVariable object)
|
ClosableIterator<Statement> |
findStatements(TriplePattern pattern)
Convenience method. |
URI |
getContextURI()
|
Model |
getDelegatedModel()
|
Diff |
getDiff(java.util.Iterator<? extends Statement> other)
Computes a Diff by using HashSets. |
java.lang.String |
getNamespace(java.lang.String prefix)
|
java.util.Map<java.lang.String,java.lang.String> |
getNamespaces()
|
java.lang.Object |
getProperty(URI propertyURI)
Note: This is a property of the model, not an RDF property |
java.lang.Object |
getUnderlyingModelImplementation()
|
boolean |
isEmpty()
sublcasses should override this method for performance |
boolean |
isIsomorphicWith(Model other)
|
boolean |
isLocked()
|
boolean |
isOpen()
|
boolean |
isValidURI(java.lang.String uriString)
|
ClosableIterator<Statement> |
iterator()
|
void |
lock()
|
URI |
newRandomUniqueURI()
|
void |
open()
Open connection to defined, unterlying implementation. |
ClosableIterable<Statement> |
queryConstruct(java.lang.String query,
java.lang.String querylanguage)
Throws an exception if the syntax is not SPARQL |
QueryResultTable |
querySelect(java.lang.String query,
java.lang.String querylanguage)
Throws an exception if the syntax is not SPARQL |
void |
readFrom(java.io.InputStream in)
|
void |
readFrom(java.io.InputStream reader,
Syntax syntax)
Throws an exception if the syntax is not RDF/XML. |
void |
readFrom(java.io.InputStream reader,
Syntax syntax,
java.lang.String baseURI)
Throws an exception if the syntax is not RDF/XML. |
void |
readFrom(java.io.Reader r)
|
void |
readFrom(java.io.Reader reader,
Syntax syntax)
|
void |
readFrom(java.io.Reader in,
Syntax syntax,
java.lang.String baseURI)
Throws an exception if the syntax is not RDF/XML. |
void |
removeAll()
|
void |
removeAll(java.util.Iterator<? extends Statement> other)
|
void |
removeNamespace(java.lang.String prefix)
|
void |
removeStatement(Resource subject,
URI predicate,
Node object)
|
void |
removeStatement(Resource subject,
URI predicate,
java.lang.String literal)
|
void |
removeStatement(Resource subject,
URI predicate,
java.lang.String literal,
java.lang.String languageTag)
|
void |
removeStatement(Resource subject,
URI predicate,
java.lang.String literal,
URI datatypeURI)
|
void |
removeStatement(Statement statement)
|
void |
removeStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal)
|
void |
removeStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal,
java.lang.String languageTag)
|
void |
removeStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal,
URI datatypeURI)
|
void |
removeStatements(ResourceOrVariable subject,
UriOrVariable predicate,
NodeOrVariable object)
|
void |
setAutocommit(boolean autocommit)
OVERWRITE ME |
protected void |
setDelegatedModel(Model model)
|
void |
setNamespace(java.lang.String prefix,
java.lang.String namespaceURI)
|
void |
setProperty(URI propertyURI,
java.lang.Object value)
Add an arbitrary property, this will not be persisted and is only available at runtime. |
long |
size()
This is a really slow implementation, please override. |
boolean |
sparqlAsk(java.lang.String query)
|
ClosableIterable<Statement> |
sparqlConstruct(java.lang.String query)
|
ClosableIterable<Statement> |
sparqlDescribe(java.lang.String query)
|
QueryResultTable |
sparqlSelect(java.lang.String queryString)
|
void |
unlock()
|
void |
update(DiffReader diff)
Implementations with support for transactions should use them instead of this implementation. |
void |
writeTo(java.io.OutputStream out)
|
void |
writeTo(java.io.OutputStream out,
Syntax syntax)
Throws an exception if the syntax is not known |
void |
writeTo(java.io.Writer w)
|
void |
writeTo(java.io.Writer writer,
Syntax syntax)
|
| Methods inherited from class org.ontoware.rdf2go.model.impl.AbstractModel |
|---|
addReificationOf, addReificationOf, assertModel, contains, contains, countStatements, createDatatypeLiteral, createLanguageTagLiteral, createPlainLiteral, createStatement, createTriplePattern, deleteReification, getAllReificationsOf, hasReifications, removeStatements, serialize |
| Methods inherited from class org.ontoware.rdf2go.model.impl.AbstractModelAddRemove |
|---|
update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.ontoware.rdf2go.model.ModelValueFactory |
|---|
createDatatypeLiteral, createLanguageTagLiteral, createPlainLiteral, createStatement |
| Methods inherited from interface org.ontoware.rdf2go.model.ModelRemovePatterns |
|---|
removeStatements |
| Methods inherited from interface org.ontoware.rdf2go.model.FindableModel |
|---|
contains, contains, countStatements, createTriplePattern |
| Methods inherited from interface org.ontoware.rdf2go.model.FindableModel |
|---|
contains, contains, countStatements, createTriplePattern |
| Methods inherited from interface org.ontoware.rdf2go.model.ModelIO |
|---|
serialize |
| Methods inherited from interface org.ontoware.rdf2go.model.ReificationSupport |
|---|
addReificationOf, addReificationOf, deleteReification, getAllReificationsOf, hasReifications |
| Constructor Detail |
|---|
protected DelegatingModel()
public DelegatingModel(Model model)
| Method Detail |
|---|
public void addAll(java.util.Iterator<? extends Statement> other)
throws ModelRuntimeException
addAll in interface ModelWriteraddAll in class AbstractModelModelRuntimeException
public void addStatement(Resource subject,
URI predicate,
Node object)
throws ModelRuntimeException
addStatement in interface ModelWriteraddStatement in class AbstractModelAddRemoveModelRuntimeException
public void addStatement(Resource subject,
URI predicate,
java.lang.String literal)
throws ModelRuntimeException
addStatement in interface ModelWriteraddStatement in class AbstractModelModelRuntimeException
public void addStatement(Resource subject,
URI predicate,
java.lang.String literal,
java.lang.String languageTag)
throws ModelRuntimeException
addStatement in interface ModelWriteraddStatement in class AbstractModelModelRuntimeException
public void addStatement(Resource subject,
URI predicate,
java.lang.String literal,
URI datatypeURI)
throws ModelRuntimeException
addStatement in interface ModelWriteraddStatement in class AbstractModelModelRuntimeException
public void addStatement(Statement statement)
throws ModelRuntimeException
addStatement in interface ModelWriteraddStatement in class AbstractModelModelRuntimeException
public void addStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal)
throws ModelRuntimeException
addStatement in interface ModelWriteraddStatement in class AbstractModelModelRuntimeException
public void addStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal,
java.lang.String languageTag)
throws ModelRuntimeException
addStatement in interface ModelWriteraddStatement in class AbstractModelModelRuntimeException
public void addStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal,
URI datatypeURI)
throws ModelRuntimeException
addStatement in interface ModelWriteraddStatement in class AbstractModelModelRuntimeExceptionpublic void close()
AbstractModel
close in interface Modelclose in class AbstractModelpublic void commit()
AbstractModel
commit in interface Commitablecommit in class AbstractModel
public boolean contains(ResourceOrVariable subject,
UriOrVariable predicate,
NodeOrVariable object)
throws ModelRuntimeException
AbstractModel
contains in interface FindableModelcontains in class AbstractModelModelRuntimeExceptionpublic BlankNode createBlankNode()
createBlankNode in interface ModelValueFactorypublic BlankNode createBlankNode(java.lang.String internalID)
createBlankNode in interface ModelValueFactory
public URI createURI(java.lang.String uriString)
throws ModelRuntimeException
createURI in interface ModelValueFactorycreateURI in class AbstractModelModelRuntimeExceptionpublic void dump()
dump in interface Model
public ClosableIterator<Statement> findStatements(ResourceOrVariable subject,
UriOrVariable predicate,
NodeOrVariable object)
throws ModelRuntimeException
findStatements in interface FindableModelModelRuntimeException
public ClosableIterator<Statement> findStatements(TriplePattern pattern)
throws ModelRuntimeException
AbstractModel
findStatements in interface FindableModelfindStatements in class AbstractModelModelRuntimeExceptionpublic URI getContextURI()
getContextURI in interface Modelpublic Model getDelegatedModel()
public Diff getDiff(java.util.Iterator<? extends Statement> other)
throws ModelRuntimeException
AbstractModel
getDiff in interface ModelAddRemovegetDiff in class AbstractModelModelRuntimeExceptionpublic java.lang.Object getProperty(URI propertyURI)
AbstractModel
getProperty in interface ModelgetProperty in class AbstractModelpublic java.lang.Object getUnderlyingModelImplementation()
getUnderlyingModelImplementation in interface ModelgetUnderlyingModelImplementation in class AbstractModelpublic boolean isEmpty()
AbstractModel
isEmpty in interface ModelisEmpty in class AbstractModelpublic boolean isIsomorphicWith(Model other)
isIsomorphicWith in interface Modelpublic boolean isLocked()
isLocked in interface Lockablepublic boolean isOpen()
isOpen in interface ModelisOpen in class AbstractModelpublic boolean isValidURI(java.lang.String uriString)
isValidURI in interface ModelValueFactorypublic ClosableIterator<Statement> iterator()
iterator in interface java.lang.Iterable<Statement>iterator in interface ClosableIterable<Statement>
public void lock()
throws LockException
lock in interface LockableLockExceptionpublic URI newRandomUniqueURI()
newRandomUniqueURI in interface ModelValueFactorynewRandomUniqueURI in class AbstractModelpublic void open()
AbstractModel
open in interface Modelopen in class AbstractModel
public ClosableIterable<Statement> queryConstruct(java.lang.String query,
java.lang.String querylanguage)
throws QueryLanguageNotSupportedException,
ModelRuntimeException
AbstractModel
queryConstruct in interface SparqlablequeryConstruct in class AbstractModelQueryLanguageNotSupportedException
ModelRuntimeException
public QueryResultTable querySelect(java.lang.String query,
java.lang.String querylanguage)
throws QueryLanguageNotSupportedException,
ModelRuntimeException
AbstractModel
querySelect in interface SparqlablequerySelect in class AbstractModelQueryLanguageNotSupportedException
ModelRuntimeException
public void readFrom(java.io.InputStream in)
throws java.io.IOException,
ModelRuntimeException
readFrom in interface ModelIOjava.io.IOException
ModelRuntimeException
public void readFrom(java.io.InputStream reader,
Syntax syntax)
throws java.io.IOException,
ModelRuntimeException
AbstractModel
readFrom in interface ModelIOreadFrom in class AbstractModeljava.io.IOException
ModelRuntimeException
public void readFrom(java.io.Reader r)
throws java.io.IOException,
ModelRuntimeException
readFrom in interface ModelIOjava.io.IOException
ModelRuntimeException
public void readFrom(java.io.Reader reader,
Syntax syntax)
throws ModelRuntimeException,
java.io.IOException
readFrom in interface ModelIOModelRuntimeException
java.io.IOException
public void removeAll()
throws ModelRuntimeException
removeAll in interface ModelAddRemoveremoveAll in class AbstractModelModelRuntimeException
public void removeAll(java.util.Iterator<? extends Statement> other)
throws ModelRuntimeException
removeAll in interface ModelAddRemoveremoveAll in class AbstractModelModelRuntimeException
public void removeStatement(Resource subject,
URI predicate,
Node object)
throws ModelRuntimeException
removeStatement in interface ModelAddRemoveremoveStatement in class AbstractModelAddRemoveModelRuntimeException
public void removeStatement(Resource subject,
URI predicate,
java.lang.String literal)
throws ModelRuntimeException
removeStatement in interface ModelAddRemoveremoveStatement in class AbstractModelModelRuntimeException
public void removeStatement(Resource subject,
URI predicate,
java.lang.String literal,
java.lang.String languageTag)
throws ModelRuntimeException
removeStatement in interface ModelAddRemoveremoveStatement in class AbstractModelModelRuntimeException
public void removeStatement(Resource subject,
URI predicate,
java.lang.String literal,
URI datatypeURI)
throws ModelRuntimeException
removeStatement in interface ModelAddRemoveremoveStatement in class AbstractModelModelRuntimeException
public void removeStatement(Statement statement)
throws ModelRuntimeException
removeStatement in interface ModelAddRemoveremoveStatement in class AbstractModelModelRuntimeException
public void removeStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal)
throws ModelRuntimeException
removeStatement in interface ModelAddRemoveremoveStatement in class AbstractModelModelRuntimeException
public void removeStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal,
java.lang.String languageTag)
throws ModelRuntimeException
removeStatement in interface ModelAddRemoveremoveStatement in class AbstractModelModelRuntimeException
public void removeStatement(java.lang.String subjectURIString,
URI predicate,
java.lang.String literal,
URI datatypeURI)
throws ModelRuntimeException
removeStatement in interface ModelAddRemoveremoveStatement in class AbstractModelModelRuntimeException
public void removeStatements(ResourceOrVariable subject,
UriOrVariable predicate,
NodeOrVariable object)
throws ModelRuntimeException
removeStatements in interface ModelRemovePatternsremoveStatements in class AbstractModelModelRuntimeExceptionpublic void setAutocommit(boolean autocommit)
AbstractModel
setAutocommit in interface CommitablesetAutocommit in class AbstractModelprotected void setDelegatedModel(Model model)
public void setProperty(URI propertyURI,
java.lang.Object value)
AbstractModel
setProperty in interface ModelsetProperty in class AbstractModel
public long size()
throws ModelRuntimeException
AbstractModel
size in interface Modelsize in class AbstractModelModelRuntimeException
public boolean sparqlAsk(java.lang.String query)
throws ModelRuntimeException
sparqlAsk in interface SparqlablesparqlAsk in class AbstractModelModelRuntimeException
public ClosableIterable<Statement> sparqlConstruct(java.lang.String query)
throws ModelRuntimeException
sparqlConstruct in interface SparqlableModelRuntimeException
public ClosableIterable<Statement> sparqlDescribe(java.lang.String query)
throws ModelRuntimeException
sparqlDescribe in interface SparqlableModelRuntimeException
public QueryResultTable sparqlSelect(java.lang.String queryString)
throws ModelRuntimeException
sparqlSelect in interface SparqlableModelRuntimeExceptionpublic void unlock()
unlock in interface Lockable
public void update(DiffReader diff)
throws ModelRuntimeException
AbstractModel
update in interface ModelAddRemoveupdate in class AbstractModelModelRuntimeException
public void writeTo(java.io.OutputStream out)
throws java.io.IOException,
ModelRuntimeException
writeTo in interface ModelIOjava.io.IOException
ModelRuntimeException
public void writeTo(java.io.OutputStream out,
Syntax syntax)
throws java.io.IOException,
ModelRuntimeException
AbstractModel
writeTo in interface ModelIOwriteTo in class AbstractModeljava.io.IOException
ModelRuntimeException
public void writeTo(java.io.Writer w)
throws java.io.IOException,
ModelRuntimeException
writeTo in interface ModelIOjava.io.IOException
ModelRuntimeException
public void writeTo(java.io.Writer writer,
Syntax syntax)
throws ModelRuntimeException,
java.io.IOException
writeTo in interface ModelIOModelRuntimeException
java.io.IOException
public void readFrom(java.io.Reader in,
Syntax syntax,
java.lang.String baseURI)
throws java.io.IOException,
ModelRuntimeException
AbstractModel
readFrom in interface ModelIOreadFrom in class AbstractModeljava.io.IOException
ModelRuntimeException
public void readFrom(java.io.InputStream reader,
Syntax syntax,
java.lang.String baseURI)
throws java.io.IOException,
ModelRuntimeException
AbstractModel
readFrom in interface ModelIOreadFrom in class AbstractModeljava.io.IOException
ModelRuntimeExceptionpublic java.lang.String getNamespace(java.lang.String prefix)
getNamespace in interface NamespaceSupportpublic java.util.Map<java.lang.String,java.lang.String> getNamespaces()
getNamespaces in interface NamespaceSupportpublic void removeNamespace(java.lang.String prefix)
removeNamespace in interface NamespaceSupport
public void setNamespace(java.lang.String prefix,
java.lang.String namespaceURI)
throws java.lang.IllegalArgumentException
setNamespace in interface NamespaceSupportjava.lang.IllegalArgumentException
public void addModel(Model model)
throws ModelRuntimeException
AbstractModel
addModel in interface ModeladdModel in class AbstractModelModelRuntimeException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||