org.trippi
Class TripleIterator

java.lang.Object
  extended by org.trippi.TripleIterator
Direct Known Subclasses:
DistinctTripleIterator, KowariTripleIterator, LimitedTripleIterator, MPTTripleIterator, OracleTripleIterator, PoolAwareTripleIterator, RIOTripleIterator, SesameTripleIterator, SynchronizedTripleIterator, TupleBasedTripleIterator

public abstract class TripleIterator
extends java.lang.Object

An iterator over a series of Triple objects.

Author:
cwilper@cs.cornell.edu

Field Summary
static RDFFormat[] INPUT_FORMATS
          Formats supported for reading.
static RDFFormat[] OUTPUT_FORMATS
          Formats supported for writing.
 
Constructor Summary
TripleIterator()
           
 
Method Summary
 void addToGraph(org.jrdf.graph.Graph graph)
          Add all triples in the iterator to the given Graph, then close the iterator.
abstract  void close()
          Release resources held by this iterator.
 int count()
          Get the number of triples in the iterator, then close it.
 void deleteFromGraph(org.jrdf.graph.Graph graph)
          Delete all triples in the iterator from the given Graph, then close the iterator.
static TripleIterator fromStream(java.io.InputStream in, RDFFormat format)
          Get an iterator over the triples in the given stream.
static TripleIterator fromStream(java.io.InputStream in, java.lang.String baseURI, RDFFormat format)
          Get an iterator over the triples in the given stream.
abstract  boolean hasNext()
          Return true if there are any more triples.
abstract  org.jrdf.graph.Triple next()
          Return the next triple.
 void setAliasMap(java.util.Map aliases)
           
 int toStream(java.io.OutputStream out, RDFFormat format)
          Serialize to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT_FORMATS

public static final RDFFormat[] INPUT_FORMATS
Formats supported for reading.

See Also:
fromStream(InputStream, String, RDFFormat)

OUTPUT_FORMATS

public static final RDFFormat[] OUTPUT_FORMATS
Formats supported for writing.

See Also:
toStream(OutputStream, RDFFormat)
Constructor Detail

TripleIterator

public TripleIterator()
Method Detail

hasNext

public abstract boolean hasNext()
                         throws TrippiException
Return true if there are any more triples.

Throws:
TrippiException

next

public abstract org.jrdf.graph.Triple next()
                                    throws TrippiException
Return the next triple.

Throws:
TrippiException

close

public abstract void close()
                    throws TrippiException
Release resources held by this iterator.

Throws:
TrippiException

setAliasMap

public void setAliasMap(java.util.Map aliases)

count

public int count()
          throws TrippiException
Get the number of triples in the iterator, then close it.

Throws:
TrippiException

toStream

public int toStream(java.io.OutputStream out,
                    RDFFormat format)
             throws TrippiException
Serialize to the given stream. After successfully writing, the TripleIterator will be closed, but not the outputstream.

Throws:
TrippiException

fromStream

public static TripleIterator fromStream(java.io.InputStream in,
                                        java.lang.String baseURI,
                                        RDFFormat format)
                                 throws TrippiException
Get an iterator over the triples in the given stream. The baseURI is used to resolve any relative URI references. If given as null, http://localhost/ will be used.

Throws:
TrippiException

fromStream

public static TripleIterator fromStream(java.io.InputStream in,
                                        RDFFormat format)
                                 throws TrippiException
Get an iterator over the triples in the given stream.

Throws:
TrippiException

addToGraph

public void addToGraph(org.jrdf.graph.Graph graph)
                throws TrippiException
Add all triples in the iterator to the given Graph, then close the iterator.

Throws:
TrippiException

deleteFromGraph

public void deleteFromGraph(org.jrdf.graph.Graph graph)
                     throws TrippiException
Delete all triples in the iterator from the given Graph, then close the iterator.

Throws:
TrippiException