org.openanzo.server.repository.structures
Class Statement

java.lang.Object
  extended by org.openanzo.server.repository.structures.Statement
All Implemented Interfaces:
Batchable

public class Statement
extends java.lang.Object
implements Batchable

Provides read and write access to a statement stored in the repository as well as the the statement's uri Statement data is cached in memory and is not persisted to the repository until commit is called or a batch commit (via the Batchable interface) is performed.

Author:
Joe Betz
See Also:
Batchable

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.openanzo.jdbc.utils.batchable.Batchable
Batchable.BatchGroup, Batchable.BatchOperation, Batchable.BatchOperationSet, Batchable.NullBatch
 
Field Summary
 
Fields inherited from interface org.openanzo.jdbc.utils.batchable.Batchable
EMPTY_BATCH
 
Method Summary
 void commit()
          Commit the changes for this statement into the database threw a BatchExecutor
static Statement createStatement(RepositoryConnection repositoryConnection, org.openrdf.model.Statement statement, java.lang.Long modified, java.lang.Long namedGraphId)
          Create a new Statement for provided data
 java.lang.Long getId()
          Get unique ID for this statement
 java.lang.Long getModified()
          Get the timestamp when this statement was modified
 java.lang.Long getNamedGraphId()
          Get the ID for the NamedGraph that this statement belongs
 org.openrdf.model.Statement getStatement()
          Get the Anzo statement object
 boolean isStored()
          Is this statement stored in the database
 java.util.List<Batchable.BatchOperation> listBatchOperations()
          Get the current list of batch operations for this object
 void remove(java.lang.Long modified)
          Remove this statement from the database at the given timestamp
static java.util.List<Statement> selectAllStatements(RepositoryConnection repositoryConnection, boolean includeInferredStatements)
          Returns a list of all Statements in the statements table.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createStatement

public static Statement createStatement(RepositoryConnection repositoryConnection,
                                        org.openrdf.model.Statement statement,
                                        java.lang.Long modified,
                                        java.lang.Long namedGraphId)
                                 throws AnzoException
Create a new Statement for provided data

Parameters:
repositoryConnection - Repository connection to run queries against
statement - Statement containing statement data
modified - Timestamp when statement was created
namedGraphId - ID for NamedGraph that this statement belongs
Returns:
a new Statement for the provided data
Throws:
AnzoException

isStored

public boolean isStored()
Is this statement stored in the database

Returns:
Is this statement stored in the database

getId

public java.lang.Long getId()
Get unique ID for this statement

Returns:
Unique ID for this statement

remove

public void remove(java.lang.Long modified)
Remove this statement from the database at the given timestamp

Parameters:
modified - Timestamp when statement was removed

getModified

public java.lang.Long getModified()
Get the timestamp when this statement was modified

Returns:
Timestamp when this statement was modified

getNamedGraphId

public java.lang.Long getNamedGraphId()
Get the ID for the NamedGraph that this statement belongs

Returns:
ID for the NamedGraph that this statement belongs

selectAllStatements

public static java.util.List<Statement> selectAllStatements(RepositoryConnection repositoryConnection,
                                                            boolean includeInferredStatements)
                                                     throws AnzoException
Returns a list of all Statements in the statements table. Used to rebuild the index.

Parameters:
repositoryConnection - connection to database
includeInferredStatements - include inferred statements in the list
Returns:
a list of all Statements in the statements table. Used to rebuild the index. *
Throws:
AnzoException

commit

public void commit()
            throws RdbException
Commit the changes for this statement into the database threw a BatchExecutor

Throws:
RdbException

listBatchOperations

public java.util.List<Batchable.BatchOperation> listBatchOperations()
Description copied from interface: Batchable
Get the current list of batch operations for this object

Specified by:
listBatchOperations in interface Batchable
Returns:
the current list of batch operations for this object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getStatement

public org.openrdf.model.Statement getStatement()
Get the Anzo statement object

Returns:
the Anzo statement object


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.