public class KiWiVersioningConnection extends KiWiConnection
KiWiConnection.RetryCommand<T>, KiWiConnection.RetryExecution<T>cacheManager, connection, dialect, persistence, tripleBatch| Constructor and Description |
|---|
KiWiVersioningConnection(KiWiPersistence persistence,
KiWiDialect dialect,
CacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
constructTripleQuerySnapshot(KiWiResource subject,
KiWiUriResource predicate,
KiWiNode object,
KiWiResource context,
boolean inferred,
Date snapshotDate)
Construct the SQL query string from the query pattern passed as arguments
|
protected Version |
constructVersionFromDatabase(ResultSet row)
Construct a version from the database using the data contained in the result set row passed as argument.
|
Version |
getLatestVersion(KiWiResource resource,
Date date)
Return the version that is the most recent version for a resource given a reference date.
|
long |
getSnapshotSize(Date snapshotDate)
Count all non-deleted triples in the triple store at the given snapshot date
|
long |
getSnapshotSize(KiWiResource context,
Date snapshotDate)
Count all non-deleted triples in the triple store at the given snapshot date
|
Version |
getVersion(Long id)
Retrieve a version by its id.
|
org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> |
listTriplesSnapshot(KiWiResource subject,
KiWiUriResource predicate,
KiWiNode object,
KiWiResource context,
boolean inferred,
Date snapshotDate)
Return a Sesame RepositoryResult of statements according to the query pattern given in the arguments.
|
org.openrdf.repository.RepositoryResult<Version> |
listVersions()
List all versions in the database; operates directly on the result set, i.e.
|
org.openrdf.repository.RepositoryResult<Version> |
listVersions(Date from,
Date to)
List all versions in the database; operates directly on the result set, i.e.
|
org.openrdf.repository.RepositoryResult<Version> |
listVersions(KiWiResource r)
List all versions in the database affecting the given resource as subject; operates directly on the result set,
i.e.
|
org.openrdf.repository.RepositoryResult<Version> |
listVersions(KiWiResource r,
Date from,
Date to)
List all versions in the database; operates directly on the result set, i.e.
|
void |
removeVersion(Long id)
Remove the version with the id passed as argument, including all references to added and removed triples.
|
void |
removeVersions(Date until)
Remove all versions until the date given as argument.
|
void |
removeVersions(Date from,
Date to)
Remove all versions in the given time interval.
|
void |
storeVersion(Version data)
Store a new version in the database.
|
close, commit, constructNamespaceFromDatabase, constructNodeFromDatabase, constructTripleFromDatabase, constructTripleQuery, constructTriplesFromDatabase, deleteAll, deleteContext, deleteNamespace, deleteTriple, flushBatch, getAutoCommit, getBatchSize, getCacheManager, getConfiguration, getDatabaseTables, getDatabaseVersion, getDialect, getJDBCConnection, getLocale, getMetadata, getNextSequence, getPreparedStatement, getPreparedStatement, getSize, getSize, getTransactionId, getTripleId, isBatchCommit, isClosed, listContexts, listNamespaces, listResources, listResources, listTriples, loadAnonResource, loadLiteral, loadLiteral, loadLiteral, loadLiteral, loadLiteral, loadNamespaceByPrefix, loadNamespaceByUri, loadNodeById, loadNodesByIds, loadTripleById, loadUriResource, requireJDBCConnection, rollback, setAutoCommit, setBatchCommit, setBatchSize, setMetadata, storeNamespace, storeNode, storeTriple, undeleteTriplepublic KiWiVersioningConnection(KiWiPersistence persistence, KiWiDialect dialect, CacheManager cacheManager) throws SQLException
SQLExceptionpublic void storeVersion(Version data) throws SQLException
data - SQLExceptionpublic void removeVersion(Long id) throws SQLException
id - SQLExceptionpublic void removeVersions(Date until) throws SQLException
until - date until when to delete versionsSQLExceptionpublic void removeVersions(Date from, Date to) throws SQLException
from - date after which versions will be deletedto - date before which versions will be deletedSQLExceptionpublic Version getVersion(Long id) throws SQLException
id - SQLExceptionpublic Version getLatestVersion(KiWiResource resource, Date date) throws SQLException
resource - the resource for which to find a versiondate - the reference dateSQLExceptionpublic org.openrdf.repository.RepositoryResult<Version> listVersions() throws SQLException
SQLExceptionpublic org.openrdf.repository.RepositoryResult<Version> listVersions(KiWiResource r) throws SQLException
SQLExceptionpublic org.openrdf.repository.RepositoryResult<Version> listVersions(Date from, Date to) throws SQLException
SQLExceptionpublic org.openrdf.repository.RepositoryResult<Version> listVersions(KiWiResource r, Date from, Date to) throws SQLException
SQLExceptionprotected Version constructVersionFromDatabase(ResultSet row) throws SQLException
row - SQLExceptionpublic org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> listTriplesSnapshot(KiWiResource subject, KiWiUriResource predicate, KiWiNode object, KiWiResource context, boolean inferred, Date snapshotDate) throws SQLException
subject - the subject to query for, or null for a wildcard querypredicate - the predicate to query for, or null for a wildcard queryobject - the object to query for, or null for a wildcard querycontext - the context to query for, or null for a wildcard queryinferred - if true, the result will also contain triples inferred by the reasoner, if false notSQLExceptionprotected String constructTripleQuerySnapshot(KiWiResource subject, KiWiUriResource predicate, KiWiNode object, KiWiResource context, boolean inferred, Date snapshotDate)
subject - the subject to query for, or null for a wildcard querypredicate - the predicate to query for, or null for a wildcard queryobject - the object to query for, or null for a wildcard querycontext - the context to query for, or null for a wildcard queryinferred - if true, the result will also contain triples inferred by the reasoner, if false notpublic long getSnapshotSize(Date snapshotDate) throws SQLException
SQLExceptionpublic long getSnapshotSize(KiWiResource context, Date snapshotDate) throws SQLException
SQLExceptionCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.