org.trippi.impl.kowari
Class KowariSession

java.lang.Object
  extended by org.trippi.impl.kowari.KowariSession
All Implemented Interfaces:
TriplestoreSession

public class KowariSession
extends java.lang.Object
implements TriplestoreSession

A TriplestoreSession that wraps a Kowari session and an associated Jena Model (for RDQL query support).

Author:
cwilper@cs.cornell.edu

Constructor Summary
KowariSession(org.kowari.store.DatabaseSession dbSession, java.net.URI modelURI, java.net.URI textModelURI, com.hp.hpl.jena.rdf.model.Model jenaModel, AliasManager aliasManager)
          Construct a local Kowari session.
KowariSession(org.kowari.server.Session session, java.net.URI modelURI, java.net.URI textModelURI, com.hp.hpl.jena.rdf.model.Model jenaModel, AliasManager aliasManager)
          Construct a remote Kowari session.
 
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.
 void finalize()
          Ensure close() gets called at garbage collection time.
 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)
           
 org.jrdf.graph.GraphElementFactory getElementFactory()
           
 java.lang.String[] listTripleLanguages()
           
 java.lang.String[] listTupleLanguages()
           
 TupleIterator query(java.lang.String queryText, java.lang.String language)
          Perform a tuple query against the store.
static java.lang.String toString(org.jrdf.graph.Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KowariSession

public KowariSession(org.kowari.store.DatabaseSession dbSession,
                     java.net.URI modelURI,
                     java.net.URI textModelURI,
                     com.hp.hpl.jena.rdf.model.Model jenaModel,
                     AliasManager aliasManager)
Construct a local Kowari session.

Parameters:
jenaModel - the Jena Model to use for RDQL queries. If null, this session won't support RDQL queries.

KowariSession

public KowariSession(org.kowari.server.Session session,
                     java.net.URI modelURI,
                     java.net.URI textModelURI,
                     com.hp.hpl.jena.rdf.model.Model jenaModel,
                     AliasManager aliasManager)
Construct a remote Kowari session.

Parameters:
jenaModel - the Jena Model to use for RDQL queries. If null, this session won't support RDQL queries.
Throws:
org.jrdf.graph.GraphException
Method Detail

getElementFactory

public org.jrdf.graph.GraphElementFactory getElementFactory()
                                                     throws org.jrdf.graph.GraphException
Throws:
org.jrdf.graph.GraphException

listTupleLanguages

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

listTripleLanguages

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

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.

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

findTriples

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

query

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

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

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

finalize

public void finalize()
              throws TrippiException
Ensure close() gets called at garbage collection time.

Overrides:
finalize in class java.lang.Object
Throws:
TrippiException

toString

public static java.lang.String toString(org.jrdf.graph.Node node)