org.trippi.impl.mpt
Class MPTSession

java.lang.Object
  extended by org.trippi.impl.mpt.MPTSession
All Implemented Interfaces:
TriplestoreSession

public class MPTSession
extends java.lang.Object
implements TriplestoreSession


Field Summary
static java.lang.String[] TRIPLE_LANGUAGES
           
static java.lang.String[] TUPLE_LANGUAGES
           
 
Constructor Summary
MPTSession(org.apache.commons.dbcp.BasicDataSource dbPool, org.nsdl.mptstore.core.DatabaseAdaptor adaptor, int fetchSize)
           
 
Method Summary
 void add(java.util.Set triples)
          Add the given triples to the store.
 void close()
          Close the session, releasing any resources.
 void delete(java.util.Set triples)
          Delete the given triples from the store.
 TripleIterator findTriples(java.lang.String lang, java.lang.String queryText)
           
 TripleIterator findTriples(org.jrdf.graph.SubjectNode subject, org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object)
           
protected static org.nsdl.mptstore.rdf.Node jrdfToMPT(org.jrdf.graph.Node jrdfNode)
           
protected static java.util.Set jrdfToMPT(java.util.Set jrdfTriples)
          Convert the given set of JRDF Triple objects to MPT Triple objects.
 java.lang.String[] listTripleLanguages()
           
 java.lang.String[] listTupleLanguages()
           
 TupleIterator query(java.lang.String query, java.lang.String lang)
          Perform a tuple query against the store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRIPLE_LANGUAGES

public static final java.lang.String[] TRIPLE_LANGUAGES

TUPLE_LANGUAGES

public static final java.lang.String[] TUPLE_LANGUAGES
Constructor Detail

MPTSession

public MPTSession(org.apache.commons.dbcp.BasicDataSource dbPool,
                  org.nsdl.mptstore.core.DatabaseAdaptor adaptor,
                  int fetchSize)
Method Detail

listTripleLanguages

public java.lang.String[] listTripleLanguages()
Specified by:
listTripleLanguages in interface TriplestoreSession

listTupleLanguages

public java.lang.String[] listTupleLanguages()
Specified by:
listTupleLanguages in interface TriplestoreSession

findTriples

public TripleIterator findTriples(java.lang.String lang,
                                  java.lang.String queryText)
                           throws TrippiException
Specified by:
findTriples in interface TriplestoreSession
Throws:
TrippiException

findTriples

public TripleIterator findTriples(org.jrdf.graph.SubjectNode subject,
                                  org.jrdf.graph.PredicateNode predicate,
                                  org.jrdf.graph.ObjectNode object)
                           throws TrippiException
Specified by:
findTriples in interface TriplestoreSession
Throws:
TrippiException

query

public TupleIterator query(java.lang.String query,
                           java.lang.String lang)
                    throws TrippiException
Description copied from interface: TriplestoreSession
Perform a tuple query against the store.

Specified by:
query in interface TriplestoreSession
Parameters:
query - the text of the query
lang - the query language
Throws:
TrippiException

add

public void add(java.util.Set triples)
         throws TrippiException
Description copied from interface: TriplestoreSession
Add the given triples to the store.

Specified by:
add in interface TriplestoreSession
Parameters:
triples - a Set of Triple objects.
Throws:
TrippiException - if adding to the store otherwise failed.

delete

public void delete(java.util.Set triples)
            throws TrippiException
Description copied from interface: TriplestoreSession
Delete the given triples from the store.

Specified by:
delete in interface TriplestoreSession
Parameters:
triples - a Set of Triple objects.
Throws:
TrippiException - if deleting from the store failed.

jrdfToMPT

protected static java.util.Set jrdfToMPT(java.util.Set jrdfTriples)
Convert the given set of JRDF Triple objects to MPT Triple objects.


jrdfToMPT

protected static org.nsdl.mptstore.rdf.Node jrdfToMPT(org.jrdf.graph.Node jrdfNode)

close

public void close()
           throws TrippiException
Description copied from interface: TriplestoreSession
Close the session, releasing any resources.

Specified by:
close in interface TriplestoreSession
Throws:
TrippiException