org.openrdf.sesame.sailimpl.omm.versioning
Class VersioningRdbmsSail

java.lang.Object
  extended byorg.openrdf.sesame.sailimpl.rdbms.RdfSource
      extended byorg.openrdf.sesame.sailimpl.rdbms.RdfRepository
          extended byorg.openrdf.sesame.sailimpl.rdbms.RdfSchemaRepository
              extended byorg.openrdf.sesame.sailimpl.omm.versioning.VersioningRdbmsSail
All Implemented Interfaces:
RdfRepository, RdfSchemaRepository, RdfSchemaSource, RdfSource, Sail, TableNames, ValueFactory, VersionManagement

public class VersioningRdbmsSail
extends RdfSchemaRepository
implements VersionManagement

Title:

Description:

Copyright: Copyright (c) 2003

Company:

Version:
1.0
Author:
unascribed

Field Summary
static String BORN_AT_URI
           
static String DIED_AT_URI
           
static String EXPLICIT_KEY
           
static String KIND_KEY
           
static String MADE_BY_URI
           
static String MADE_ON_URI
           
static String USER_ID_URI
           
static String VERSION_NAME_URI
           
static String VERSION_UPDATE_ID
           
 
Fields inherited from class org.openrdf.sesame.sailimpl.rdbms.RdfSchemaRepository
INFERENCER_KEY, rdfAltId, rdfBagId, rdfFirstId, rdfListId, rdfNilId, rdfObjectId, rdfPredicateId, rdfPropertyId, rdfRestId, rdfsClassId, rdfsCommentId, rdfsContainerId, rdfsContainerMembershipPropertyId, rdfsDatatypeId, rdfsDomainId, rdfSeqId, rdfsIsDefinedById, rdfsLabelId, rdfsLiteralId, rdfsMemberId, rdfsRangeId, rdfsResourceId, rdfsSeeAlsoId, rdfsSubClassOfId, rdfsSubPropertyOfId, rdfStatementId, rdfSubjectId, rdfTypeId, rdfValueId, rdfXMLLiteralId, USE_DEPENDENCY_INFERENCER_KEY
 
Fields inherited from class org.openrdf.sesame.sailimpl.rdbms.RdfSource
JDBC_DRIVER_KEY, JDBC_URL_KEY, KEY_EXPORT_FLAGS, KEY_SCHEMACREATOR, KEY_SCHEMAVERSION, PASSWORD_KEY, USER_KEY, VALUE_DIRTY, VALUE_UP_TO_DATE
 
Fields inherited from interface org.openrdf.sesame.sailimpl.rdbms.TableNames
ADDED_TRIPLES_TABLE, ALL_INFERRED_TABLE, ALL_NEW_TRIPLES_TABLE, CLASS_TABLE, DEPEND_TABLE, DIRECT_SUBCLASSOF_TABLE, DIRECT_SUBPROPERTYOF_TABLE, DOMAIN_TABLE, EXPIRED_LITERALS_TABLE, EXPIRED_RESOURCES_TABLE, EXPIRED_TRIPLES_TABLE, EXPIRED_VALUES_TABLE, GROUNDED_TRIPLES_TABLE, INFERRED_TABLE, INSTANCEOF_TABLE, LITERALS_TABLE, NAMESPACES_TABLE, NEW_GROUNDED_TRIPLES_TABLE, NEW_TRIPLES_TABLE, PROPER_INSTANCEOF_TABLE, PROPERTY_TABLE, RANGE_TABLE, RAW_TRIPLES_TABLE, REP_INFO_TABLE, RESOURCES_TABLE, SUBCLASSOF_TABLE, SUBPROPERTYOF_TABLE, TRIPLES_TABLE
 
Constructor Summary
VersioningRdbmsSail()
           
 
Method Summary
 void addStatement(Resource subj, URI pred, Value obj)
          add's a new explicit statement to repository
 String branchState(long stateUID)
          branch the repository at given state for further operations.
 void clearRepository()
          Clears the repository.
 void commitTransaction()
          Commits a started transaction.
 void continueCounterIncrement()
          Coninue with the normal increment of the update counter on each modification made in the repository.
 Map getMetaInfo(String subj, String pred, String obj)
          Retrieves the meta info associated with a statement.
 Iterator getUpdateIds()
          Return a list of all Update states of the current repository as Strings.
 Map getUpdateMetaInfo(String updateId)
          Retrieves the meta info associated with an update.
 Iterator getVersionIds()
          Return a list of all Version Ids of the current repository as Strings.
 Map getVersionMetaInfo(String versionId)
          Retrieves the meta info associated with a version .
 Iterator getVersions()
          Retrive list of all labeled states of the repository.
 void initialize(Map configParams)
          Initializes the TmsSQL92Sail.
 boolean isPausedCounterIncrement()
          Check if the update couter ss paused
 void labelCurrentState(String label)
          Create a labeled version of the curent repository state.
 void labelState(long stateUID, String label)
          Create a labeled version for a statte of the repository assigning the necessary mata-information about thet operation.
 void lockStatements(Iterator statementsList)
          Perform locking of statements in the repository
 void pauseCounterIncrement()
          Stop the increment of the update counter.
 void revertToState(long stateUID)
          Restore the repository to previous state removing all statements added after the value of the update counter and revive all removed ones.
 void shutDown()
          Allow the SAIL to synchronize any stale data.
 void startTransaction()
          Starts a transaction.
 void unlockStatements(Iterator statementsList)
          Perform unlocking of statements in the repository
 void workWithState(long stateUID)
          Sets the repository to given statete for further read operations.
 
Methods inherited from class org.openrdf.sesame.sailimpl.rdbms.RdfSchemaRepository
getClasses, getDirectSubClassOf, getDirectSubPropertyOf, getDirectType, getDomain, getExplicitStatements, getLiterals, getProperties, getRange, getRDBMS, getSubClassOf, getSubPropertyOf, getType, hasExplicitStatement, isClass, isDirectSubClassOf, isDirectSubPropertyOf, isDirectType, isProperty, isSubClassOf, isSubPropertyOf, isType
 
Methods inherited from class org.openrdf.sesame.sailimpl.rdbms.RdfRepository
addListener, changeNamespacePrefix, removeListener, removeStatements, transactionStarted
 
Methods inherited from class org.openrdf.sesame.sailimpl.rdbms.RdfSource
createBNode, createBNode, createLiteral, createLiteral, createLiteral, createStatement, createURI, createURI, getLiteral, getNamespaces, getResource, getStatements, getStatements, getValue, getValueFactory, hasStatement, hasStatement, initialize, initialize, optimizeQuery
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openrdf.sesame.sail.RdfSource
getNamespaces, getStatements, getValueFactory, hasStatement, optimizeQuery
 
Methods inherited from interface org.openrdf.sesame.sail.RdfRepository
addListener, changeNamespacePrefix, removeListener, removeStatements, transactionStarted
 

Field Detail

MADE_BY_URI

public static final String MADE_BY_URI
See Also:
Constant Field Values

USER_ID_URI

public static final String USER_ID_URI
See Also:
Constant Field Values

VERSION_NAME_URI

public static final String VERSION_NAME_URI
See Also:
Constant Field Values

VERSION_UPDATE_ID

public static final String VERSION_UPDATE_ID
See Also:
Constant Field Values

BORN_AT_URI

public static final String BORN_AT_URI
See Also:
Constant Field Values

DIED_AT_URI

public static final String DIED_AT_URI
See Also:
Constant Field Values

MADE_ON_URI

public static final String MADE_ON_URI
See Also:
Constant Field Values

EXPLICIT_KEY

public static final String EXPLICIT_KEY
See Also:
Constant Field Values

KIND_KEY

public static final String KIND_KEY
See Also:
Constant Field Values
Constructor Detail

VersioningRdbmsSail

public VersioningRdbmsSail()
Method Detail

shutDown

public void shutDown()
Allow the SAIL to synchronize any stale data. The SAIL can assume that shutDown() is called before an application is stopped.

Specified by:
shutDown in interface Sail
Overrides:
shutDown in class RdfSource
Throws:
SailInternalException - To indicate an internal error.

initialize

public void initialize(Map configParams)
                throws SailInitializationException
Initializes the TmsSQL92Sail. The supplied Map should contain the following key-value pairs:
keyvalue
jdbcDriverThe String representing the JDBC-driver class, e.g. "org.gjt.mm.mysql.Driver"
jdbcUrlThe String representing the JDBC-url of the database to connect to, e.g. "jdbc:mysql://localhost/sesame"
userThe username that can be used to connect to the DBMS
passwordThe password of the user in the DBMS

Specified by:
initialize in interface Sail
Overrides:
initialize in class RdfSchemaRepository
Parameters:
configParams - configuration parameters
Throws:
SailInitializationException - If the TmsSQL92Sail could not be initialized using the supplied parameters.

addStatement

public void addStatement(Resource subj,
                         URI pred,
                         Value obj)
                  throws SailUpdateException
add's a new explicit statement to repository

Specified by:
addStatement in interface RdfRepository
Overrides:
addStatement in class RdfRepository
Parameters:
subj - is either BNode ot URI denoting the statement's subject
pred - is an URI for predicate
obj - is the object value of the statement (Resource or Literal)
Throws:
SailUpdateException

clearRepository

public void clearRepository()
                     throws SailUpdateException
Clears the repository. After the repository was cleared, it will be in the same state as after initialization. Our Sail implementation clears all additional tables an all currently available branches that are not permanent.

Specified by:
clearRepository in interface RdfRepository
Overrides:
clearRepository in class RdfSchemaRepository
Throws:
SailInternalException - To indicate an internal error.
SailUpdateException

startTransaction

public void startTransaction()
Starts a transaction. A transaction needs to be started before data can be added to or removed from the repository.

Specified by:
startTransaction in interface RdfRepository
Overrides:
startTransaction in class RdfRepository
Throws:
SailInternalException - To indicate an internal error.

commitTransaction

public void commitTransaction()
Commits a started transaction. A transaction needs to be commited to be guaranteed that data has been added to, or removed from the repository.

Specified by:
commitTransaction in interface RdfRepository
Overrides:
commitTransaction in class RdfRepository
Throws:
SailInternalException - To indicate an internal error.

getUpdateIds

public Iterator getUpdateIds()
Return a list of all Update states of the current repository as Strings. Mainly used in the HTML User interface.

Specified by:
getUpdateIds in interface VersionManagement
Returns:
Iterator throuh the values of the Update Counter

getVersionIds

public Iterator getVersionIds()
Return a list of all Version Ids of the current repository as Strings.

Specified by:
getVersionIds in interface VersionManagement
Returns:
Iterator over all version ids

labelState

public void labelState(long stateUID,
                       String label)
Create a labeled version for a statte of the repository assigning the necessary mata-information about thet operation.

Specified by:
labelState in interface VersionManagement
Parameters:
stateUID - of a particular repository state
label - associated with the state NOTE: This method can throw a security exception if the request is made on behalf of the user with insufficent rights to create versions

labelCurrentState

public void labelCurrentState(String label)
Create a labeled version of the curent repository state.

Specified by:
labelCurrentState in interface VersionManagement
Parameters:
label - to be associated with the state NOTE: This method can throw a security exception if the request is made on behalf of the user with insufficent rights to create versions

revertToState

public void revertToState(long stateUID)
Restore the repository to previous state removing all statements added after the value of the update counter and revive all removed ones.

Specified by:
revertToState in interface VersionManagement
Parameters:
stateUID - - the update counter of a particular repository state NOTE: This method can throw a security exception if the request is made on behalf of the user with insufficent rights to revert the repository

workWithState

public void workWithState(long stateUID)
Sets the repository to given statete for further read operations.

Specified by:
workWithState in interface VersionManagement
Parameters:
stateUID - - the update counter of a particular repository state

branchState

public String branchState(long stateUID)
Description copied from interface: VersionManagement
branch the repository at given state for further operations.

Specified by:
branchState in interface VersionManagement
Parameters:
stateUID - the update counter of a particular repository state
Returns:
the id of the repository

getVersions

public Iterator getVersions()
Retrive list of all labeled states of the repository.

Specified by:
getVersions in interface VersionManagement
Returns:
a list of Versin interfaces for each labeled state of the repository

lockStatements

public void lockStatements(Iterator statementsList)
Perform locking of statements in the repository

Specified by:
lockStatements in interface VersionManagement
Parameters:
statementsList - - list of statemensts to lock

unlockStatements

public void unlockStatements(Iterator statementsList)
Perform unlocking of statements in the repository

Specified by:
unlockStatements in interface VersionManagement
Parameters:
statementsList - - list of statemensts to unlock

pauseCounterIncrement

public void pauseCounterIncrement()
Stop the increment of the update counter. Usefull for a kind of batch updates or adding a distinct daml coinstructs at once.

Specified by:
pauseCounterIncrement in interface VersionManagement

continueCounterIncrement

public void continueCounterIncrement()
Coninue with the normal increment of the update counter on each modification made in the repository.

Specified by:
continueCounterIncrement in interface VersionManagement

isPausedCounterIncrement

public boolean isPausedCounterIncrement()
Check if the update couter ss paused

Specified by:
isPausedCounterIncrement in interface VersionManagement
Returns:
true if the updateCouter is paused, flase otherwise

getMetaInfo

public Map getMetaInfo(String subj,
                       String pred,
                       String obj)
Retrieves the meta info associated with a statement.

Specified by:
getMetaInfo in interface VersionManagement
Parameters:
subj - the subject of the statement
pred - the predicate of the statement
obj - the object of the statement
Returns:
a map of meta info keys vs meta info values

getUpdateMetaInfo

public Map getUpdateMetaInfo(String updateId)
Retrieves the meta info associated with an update.

Specified by:
getUpdateMetaInfo in interface VersionManagement
Parameters:
updateId - the id of the update
Returns:
a map of meta info keys vs meta info values

getVersionMetaInfo

public Map getVersionMetaInfo(String versionId)
Retrieves the meta info associated with a version .

Specified by:
getVersionMetaInfo in interface VersionManagement
Parameters:
versionId - the id of the update
Returns:
a map of meta info keys vs meta info values


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.