org.universAAL.context.sesame.sail
Class CardinalityNativeStore

Package class diagram package CardinalityNativeStore
java.lang.Object
  extended by org.openrdf.sail.helpers.SailBase
      extended by org.openrdf.sail.helpers.NotifyingSailBase
          extended by org.universAAL.context.sesame.sail.CardinalityNativeStore
All Implemented Interfaces:
org.openrdf.sail.NotifyingSail, org.openrdf.sail.Sail
Direct Known Subclasses:
CardinCollect2NativeStore, CardinCollectNativeStore

public class CardinalityNativeStore
extends org.openrdf.sail.helpers.NotifyingSailBase

A SAIL implementation using B-Tree indexing on disk for storing and querying its data.

Author:
Arjohn Kampman, jeen

Field Summary
 
Fields inherited from class org.openrdf.sail.helpers.SailBase
connectionTimeOut, DEFAULT_CONNECTION_TIMEOUT, initializationLock, logger
 
Constructor Summary
CardinalityNativeStore()
          Creates a new NativeStore.
CardinalityNativeStore(File dataDir)
           
CardinalityNativeStore(File dataDir, String tripleIndexes, boolean encrypt)
           
 
Method Summary
protected  double cardinality(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.Resource context)
           
protected  info.aduna.iteration.CloseableIteration<? extends org.openrdf.model.Statement,IOException> createStatementIterator(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, boolean includeInferred, boolean readTransaction, org.openrdf.model.Resource... contexts)
          Creates a statement iterator based on the supplied pattern.
protected  org.openrdf.sail.NotifyingSailConnection getConnectionInternal()
           
protected  info.aduna.iteration.CloseableIteration<org.openrdf.model.Resource,IOException> getContextIDs(boolean readTransaction)
           
protected  List<Integer> getContextIDs(org.openrdf.model.Resource... contexts)
           
 boolean getForceSync()
           
protected  org.universAAL.context.sesame.sail.NamespaceStore getNamespaceStore()
           
protected  info.aduna.concurrent.locks.Lock getTransactionLock()
           
 String getTripleIndexes()
           
protected  org.universAAL.context.sesame.sail.TripleStore getTripleStore()
           
 org.openrdf.model.ValueFactory getValueFactory()
           
protected  ValueStore getValueStore()
           
protected  void initializeInternal()
          Initializes this NativeStore.
 boolean isWritable()
           
 void setForceSync(boolean forceSync)
          Specifiec whether updates should be synced to disk forcefully, must be called before initialization.
 void setNamespaceCacheSize(int namespaceCacheSize)
           
 void setNamespaceIDCacheSize(int namespaceIDCacheSize)
           
 void setTripleIndexes(String tripleIndexes)
          Sets the triple indexes for the native store, must be called before initialization.
 void setValueCacheSize(int valueCacheSize)
           
 void setValueIDCacheSize(int valueIDCacheSize)
           
protected  void shutDownInternal()
           
 
Methods inherited from class org.openrdf.sail.helpers.NotifyingSailBase
addSailChangedListener, getConnection, notifySailChanged, removeSailChangedListener
 
Methods inherited from class org.openrdf.sail.helpers.SailBase
connectionClosed, debugEnabled, getDataDir, initialize, isInitialized, setDataDir, shutDown, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openrdf.sail.Sail
getDataDir, initialize, setDataDir, shutDown
 

Constructor Detail

CardinalityNativeStore

public CardinalityNativeStore()
Creates a new NativeStore.


CardinalityNativeStore

public CardinalityNativeStore(File dataDir)

CardinalityNativeStore

public CardinalityNativeStore(File dataDir,
                              String tripleIndexes,
                              boolean encrypt)
Method Detail

setTripleIndexes

public void setTripleIndexes(String tripleIndexes)
Sets the triple indexes for the native store, must be called before initialization.

Parameters:
tripleIndexes - An index strings, e.g. spoc,posc.

getTripleIndexes

public String getTripleIndexes()

setForceSync

public void setForceSync(boolean forceSync)
Specifiec whether updates should be synced to disk forcefully, must be called before initialization. Enabling this feature may prevent corruption in case of events like power loss, but can have a severe impact on write performance. By default, this feature is disabled.


getForceSync

public boolean getForceSync()

setValueCacheSize

public void setValueCacheSize(int valueCacheSize)

setValueIDCacheSize

public void setValueIDCacheSize(int valueIDCacheSize)

setNamespaceCacheSize

public void setNamespaceCacheSize(int namespaceCacheSize)

setNamespaceIDCacheSize

public void setNamespaceIDCacheSize(int namespaceIDCacheSize)

initializeInternal

protected void initializeInternal()
                           throws org.openrdf.sail.SailException
Initializes this NativeStore.

Overrides:
initializeInternal in class org.openrdf.sail.helpers.SailBase
Throws:
org.openrdf.sail.SailException - If this NativeStore could not be initialized using the parameters that have been set.

shutDownInternal

protected void shutDownInternal()
                         throws org.openrdf.sail.SailException
Specified by:
shutDownInternal in class org.openrdf.sail.helpers.SailBase
Throws:
org.openrdf.sail.SailException

isWritable

public boolean isWritable()

getConnectionInternal

protected org.openrdf.sail.NotifyingSailConnection getConnectionInternal()
                                                                  throws org.openrdf.sail.SailException
Overrides:
getConnectionInternal in class org.openrdf.sail.helpers.NotifyingSailBase
Throws:
org.openrdf.sail.SailException

getValueFactory

public org.openrdf.model.ValueFactory getValueFactory()

getTripleStore

protected org.universAAL.context.sesame.sail.TripleStore getTripleStore()

getValueStore

protected ValueStore getValueStore()

getNamespaceStore

protected org.universAAL.context.sesame.sail.NamespaceStore getNamespaceStore()

getTransactionLock

protected info.aduna.concurrent.locks.Lock getTransactionLock()
                                                       throws org.openrdf.sail.SailException
Throws:
org.openrdf.sail.SailException

getContextIDs

protected List<Integer> getContextIDs(org.openrdf.model.Resource... contexts)
                               throws IOException
Throws:
IOException

getContextIDs

protected info.aduna.iteration.CloseableIteration<org.openrdf.model.Resource,IOException> getContextIDs(boolean readTransaction)
                                                                                                 throws IOException
Throws:
IOException

createStatementIterator

protected info.aduna.iteration.CloseableIteration<? extends org.openrdf.model.Statement,IOException> createStatementIterator(org.openrdf.model.Resource subj,
                                                                                                                             org.openrdf.model.URI pred,
                                                                                                                             org.openrdf.model.Value obj,
                                                                                                                             boolean includeInferred,
                                                                                                                             boolean readTransaction,
                                                                                                                             org.openrdf.model.Resource... contexts)
                                                                                                                      throws IOException
Creates a statement iterator based on the supplied pattern.

Parameters:
subj - The subject of the pattern, or null to indicate a wildcard.
pred - The predicate of the pattern, or null to indicate a wildcard.
obj - The object of the pattern, or null to indicate a wildcard.
contexts - The context(s) of the pattern. Note that this parameter is a vararg and as such is optional. If no contexts are supplied the method operates on the entire repository.
Returns:
A StatementIterator that can be used to iterate over the statements that match the specified pattern.
Throws:
IOException

cardinality

protected double cardinality(org.openrdf.model.Resource subj,
                             org.openrdf.model.URI pred,
                             org.openrdf.model.Value obj,
                             org.openrdf.model.Resource context)
                      throws IOException
Throws:
IOException


Copyright © 2014 universAAL Consortium. All Rights Reserved.