org.trippi.impl.sesame
Class SesameSession

java.lang.Object
  extended by org.trippi.impl.sesame.SesameSession
All Implemented Interfaces:
TriplestoreSession

public class SesameSession
extends java.lang.Object
implements TriplestoreSession

A TriplestoreSession that wraps a SesameRepository.

Author:
cwilper@cs.cornell.edu

Field Summary
static java.lang.String RDQL
           
static java.lang.String RQL
           
static java.lang.String SERQL
           
static java.lang.String SPO
           
static java.lang.String[] TRIPLE_LANGUAGES
          serql, spo
static java.lang.String[] TUPLE_LANGUAGES
          serql, rdql, rql
 
Constructor Summary
SesameSession(org.openrdf.sesame.repository.SesameRepository repository, AliasManager aliasManager)
          Construct a Sesame 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()
           
static org.openrdf.model.Graph getSesameGraph(java.util.Iterator jrdfTriples)
           
static org.openrdf.model.Literal getSesameLiteral(org.jrdf.graph.Literal literal, org.openrdf.model.ValueFactory valueFactory)
           
static org.openrdf.model.Resource getSesameResource(org.jrdf.graph.SubjectNode subject, org.openrdf.model.ValueFactory valueFactory)
           
static org.openrdf.model.Statement getSesameStatement(org.jrdf.graph.Triple triple, org.openrdf.model.ValueFactory valueFactory)
           
static org.openrdf.model.URI getSesameURI(org.jrdf.graph.URIReference uriReference, org.openrdf.model.ValueFactory valueFactory)
           
static org.openrdf.model.Value getSesameValue(org.jrdf.graph.ObjectNode object, org.openrdf.model.ValueFactory valueFactory)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RDQL

public static final java.lang.String RDQL
See Also:
Constant Field Values

RQL

public static final java.lang.String RQL
See Also:
Constant Field Values

SERQL

public static final java.lang.String SERQL
See Also:
Constant Field Values

SPO

public static final java.lang.String SPO
See Also:
Constant Field Values

TUPLE_LANGUAGES

public static final java.lang.String[] TUPLE_LANGUAGES
serql, rdql, rql


TRIPLE_LANGUAGES

public static final java.lang.String[] TRIPLE_LANGUAGES
serql, spo

Constructor Detail

SesameSession

public SesameSession(org.openrdf.sesame.repository.SesameRepository repository,
                     AliasManager aliasManager)
Construct a Sesame session.

Method Detail

listTupleLanguages

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

listTripleLanguages

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

getElementFactory

public org.jrdf.graph.GraphElementFactory getElementFactory()

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

getSesameGraph

public static org.openrdf.model.Graph getSesameGraph(java.util.Iterator jrdfTriples)

getSesameStatement

public static org.openrdf.model.Statement getSesameStatement(org.jrdf.graph.Triple triple,
                                                             org.openrdf.model.ValueFactory valueFactory)

getSesameResource

public static org.openrdf.model.Resource getSesameResource(org.jrdf.graph.SubjectNode subject,
                                                           org.openrdf.model.ValueFactory valueFactory)

getSesameURI

public static org.openrdf.model.URI getSesameURI(org.jrdf.graph.URIReference uriReference,
                                                 org.openrdf.model.ValueFactory valueFactory)

getSesameValue

public static org.openrdf.model.Value getSesameValue(org.jrdf.graph.ObjectNode object,
                                                     org.openrdf.model.ValueFactory valueFactory)

getSesameLiteral

public static org.openrdf.model.Literal getSesameLiteral(org.jrdf.graph.Literal literal,
                                                         org.openrdf.model.ValueFactory valueFactory)