org.ontoware.rdf2go.model
Interface Model

All Superinterfaces:
ClosableIterable<Statement>, Commitable, FindableModel, java.lang.Iterable<Statement>, Lockable, ModelAddRemove, ModelIO, ModelRemovePatterns, ModelValueFactory, ModelWriter, NamespaceSupport, QueryableModel, ReificationSupport, Sparqlable

public interface Model
extends ModelValueFactory, ModelAddRemove, ModelRemovePatterns, QueryableModel, ModelIO, Commitable, ReificationSupport, NamespaceSupport

Defines an RDF Model, and the functions to add and delete statements of all possible kinds to this model. Query functions are also provided. IMPROVE: add support for union, intersection

Author:
Max Voelkel , Benjamin Heitmann , Leo Sauermann

Method Summary
 void addModel(Model model)
          Adds a complete Model to this Model.
 void close()
          Close connection to defined, unterlying implementation. commit() is called internally.
 void dump()
          Dumps the whole content of the model via System.out
 URI getContextURI()
           
 java.lang.Object getProperty(URI propertyURI)
           
 java.lang.Object getUnderlyingModelImplementation()
           
 boolean isEmpty()
           
 boolean isIsomorphicWith(Model other)
          Two models can be equal even if they do not contain the same statements.
 boolean isOpen()
           
 void open()
          Open connection to defined, unterlying implementation
 void setProperty(URI propertyURI, java.lang.Object value)
          Add an arbitrary runtime property, this will not be persisted and is only available at runtime.
 long size()
          For plain models without any inference, this is the exact number of explicit statements.
 
Methods inherited from interface org.ontoware.rdf2go.model.ModelValueFactory
createBlankNode, createBlankNode, createDatatypeLiteral, createLanguageTagLiteral, createPlainLiteral, createStatement, createURI, isValidURI, newRandomUniqueURI
 
Methods inherited from interface org.ontoware.rdf2go.model.ModelRemovePatterns
removeStatements, removeStatements
 
Methods inherited from interface org.ontoware.rdf2go.model.FindableModel
contains, contains, contains, countStatements, createTriplePattern, findStatements, findStatements
 
Methods inherited from interface org.ontoware.rdf2go.model.Sparqlable
queryConstruct, querySelect, sparqlAsk, sparqlConstruct, sparqlDescribe, sparqlSelect
 
Methods inherited from interface org.ontoware.rdf2go.model.FindableModel
contains, contains, contains, countStatements, createTriplePattern, findStatements, findStatements
 
Methods inherited from interface org.ontoware.rdf2go.model.ModelIO
readFrom, readFrom, readFrom, readFrom, readFrom, readFrom, serialize, writeTo, writeTo, writeTo, writeTo
 
Methods inherited from interface org.ontoware.rdf2go.model.Commitable
commit, setAutocommit
 
Methods inherited from interface org.ontoware.rdf2go.model.ReificationSupport
addReificationOf, addReificationOf, deleteReification, getAllReificationsOf, hasReifications
 
Methods inherited from interface org.ontoware.rdf2go.model.NamespaceSupport
getNamespace, getNamespaces, removeNamespace, setNamespace
 

Method Detail

getContextURI

URI getContextURI()
Returns:
the context URI or null

open

void open()
Open connection to defined, unterlying implementation


close

void close()
Close connection to defined, unterlying implementation. commit() is called internally.


isOpen

boolean isOpen()
Returns:
true, if model has been opened and not yet closed.

size

long size()
          throws ModelRuntimeException
For plain models without any inference, this is the exact number of explicit statements. For models with inference, this number may be anything between the number of explicit statements up to the number of all inferrable statements plus the number of explicit statements. For both cases: If one new triple is added to the model, the size must increase at least one.

Returns:
the (imprecise?) number of statements in the model (see comment)
Throws:
ModelRuntimeException

isEmpty

boolean isEmpty()
Returns:
true if the model is empty, i.e. contains no statements. This is the same as size() == 0, but might be faster.

addModel

void addModel(Model model)
              throws ModelRuntimeException
Adds a complete Model to this Model. The context URI of the other model is ignored, if present. Note: this might be faster than addAll( model.iterator() );

Parameters:
model -
Throws:
ModelRuntimeException - if any internal (I/O related) exception occurs
Since:
4.6

getUnderlyingModelImplementation

java.lang.Object getUnderlyingModelImplementation()
Returns:
the native implementation (e.g. a Jena Model). Using this method breaks strict triple store independence, but exposes the full power and reduces API dependence. This method is part of the main API.

setProperty

void setProperty(URI propertyURI,
                 java.lang.Object value)
Add an arbitrary runtime property, this will not be persisted and is only available at runtime. This allows Model to serve as a central data model in larger applications (like SemVersion.ontoware.org)

Parameters:
propertyURI -
value -

getProperty

java.lang.Object getProperty(URI propertyURI)
Parameters:
propertyURI -
Returns:
stored runtime property value or null

dump

void dump()
Dumps the whole content of the model via System.out


isIsomorphicWith

boolean isIsomorphicWith(Model other)
Two models can be equal even if they do not contain the same statements. We owe this problem mainly to blank nodes. See http://www.w3.org/TR/2002/WD-rdf-concepts-20020829/#xtocid103648 for the official definition of graph equality (which is based on graph isomorphism). See also http://www.w3.org/TR/rdf-mt/.

Parameters:
other -
Returns:
true if the two models are isomorphic as defined in http://www.w3.org/TR/rdf-mt/


Copyright © 2005-2008 FZI - Forschungszentrum Informatik | Karlsruhe | Germany. All Rights Reserved.