com.bigdata.rdf.sail
Class BigdataSailHelper

java.lang.Object
  extended by com.bigdata.rdf.sail.BigdataSailHelper

public class BigdataSailHelper
extends Object

Class provides guidance on parameter setup a data set and queries.

Version:
$Id: BigdataSailHelper.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
BigdataSailHelper()
           
 
Method Summary
 Properties getProperties()
          Return the Properties that will be used to configure a new AbstractTripleStore instance.
 Properties getProperties(BigdataSail sail)
          Return the properties associated with the AbstractTripleStore backing the BigdataSail.
protected  Properties getProperties(IIndexManager indexManager, String namespace)
          Return the properties associated with the given namespace.
 BigdataSail getSail(IBigdataFederation<?> fed, String namespace, long timestamp)
          (Re-)open a SAIL backed by persistent data stored in an IBigdataFederation.
 BigdataSail getSail(String filename, String namespace, long timestamp)
          (Re-)open a SAIL backed by persistent data stored on a Journal.
static void main(String[] args)
          Utility class.
 Properties setProperties(BigdataSail sail, Properties properties)
          Update properties for the SAIL.
protected  Properties setProperties(IIndexManager indexManager, String namespace, Properties properties)
           
static void showLexiconIndexDetails(BigdataSail sail)
          Shows some interesting details about the term2id index.
protected static void showProperties(Properties p)
           
static void showSPOIndexDetails(BigdataSail sail)
          Shows some interesting details about the primary index for the SPORelation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BigdataSailHelper

public BigdataSailHelper()
Method Detail

getSail

public BigdataSail getSail(IBigdataFederation<?> fed,
                           String namespace,
                           long timestamp)
(Re-)open a SAIL backed by persistent data stored in an IBigdataFederation.

Parameters:
fed - The federation.
namespace - The namespace of the triple store.
timestamp - The timestamp of the view.
Returns:
The SAIL.

getSail

public BigdataSail getSail(String filename,
                           String namespace,
                           long timestamp)
(Re-)open a SAIL backed by persistent data stored on a Journal.

Parameters:
filename - The name of the backing file for the Journal.
namespace - The namespace of the triple store.
timestamp - The timestamp of the view.
Returns:
The SAIL.

getProperties

public Properties getProperties()
Return the Properties that will be used to configure a new AbstractTripleStore instance. The AbstractTripleStore will remember the properties with which it was created and use those values each time it is re-opened. The properties are stored in the global row store for the backing IIndexManager.

Note: You need to edit this code to correspond to your application requirements. Currently the code reflects an application using a triple store without inference, without statement level provenance, and with the full text index enabled. Another common configuration is a triple store with RDFS++ inference, which can be realized by changing the AbstractTripleStore.Options#AXIOMS_CLASS property value and possibly enabling BigdataSail.Options.TRUTH_MAINTENANCE depending on whether or not you will be incrementally or bulk loading data.

TODO:
Bundle some sample properties files which will make it easier for people to configure a BigdataSail and make that a command line option. The jini configuration approach is nice since it allows us to use symbolic constants in the configuration files.

getProperties

public Properties getProperties(BigdataSail sail)
Return the properties associated with the AbstractTripleStore backing the BigdataSail.

Parameters:
namespace - The sail.
Returns:
The persistent properties.

getProperties

protected Properties getProperties(IIndexManager indexManager,
                                   String namespace)
Return the properties associated with the given namespace.

Parameters:
indexManager - Use BigdataSail.getDatabase() and then AbstractResource.getIndexManager().
namespace - The namespace of a locatable resource such as an AbstractTripleStore, SPORelation or LexiconRelation.
Returns:
The persistent properties.

setProperties

public Properties setProperties(BigdataSail sail,
                                Properties properties)
Update properties for the SAIL. This will overwrite any properties having the same name with their new values. Properties that are not overwritten will remain visible. A property can be deleted by specifying a null value.

Note: this changes the persistent property values associated with the SAIL. It DOES NOT change the properties associated with the given instance. You MUST re-open the SAIL in order for the new properties to be in effect.

Note: While many property values can be changed dynamically, some may not. In particular, the properties that effect the way in which the keys for the indices are generated as stored within the indices themselves. Among other things this ensures that Unicode configuration options are applied uniformly when an is accessed by any host in a federation.

Parameters:
sail - The SAIL.
properties - The properties.
Returns:
The post-modification properties.

setProperties

protected Properties setProperties(IIndexManager indexManager,
                                   String namespace,
                                   Properties properties)
Parameters:
indexManager -
namespace -
properties -
Returns:
The post-modification properties.

showProperties

protected static void showProperties(Properties p)

showLexiconIndexDetails

public static void showLexiconIndexDetails(BigdataSail sail)
Shows some interesting details about the term2id index.

Parameters:
sail -

showSPOIndexDetails

public static void showSPOIndexDetails(BigdataSail sail)
Shows some interesting details about the primary index for the SPORelation.

Parameters:
sail -

main

public static void main(String[] args)
                 throws org.openrdf.sail.SailException,
                        net.jini.config.ConfigurationException,
                        IOException
Utility class.

Note: The LTS (local triple store) mode is inferred when the filename is a plain file rather than a directory. However, when the filename identifies a directory then you must specify whether the directory should be interpreted as a LocalDataServiceFederation (LDS), an EmbeddedFederation (EDS), or a JiniFederation (JDS).

Note: The namespace identifies which triple store you are accessing and defaults to kb.

Note: The timestamp identifies which commit point you are accessing and defaults to the ITx.UNISOLATED view, which can also be specified as ).

Note: The properties is a file containing property overrides to be applied to the kb.

Parameters:
args - filename ((LTS|LDS|EDS|JDS ((namespace (timestamp)))properties)
Throws:
org.openrdf.sail.SailException
net.jini.config.ConfigurationException
IOException


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.