org.trippi.io
Class RIOTripleIterator

java.lang.Object
  extended by org.trippi.TripleIterator
      extended by org.trippi.io.RIOTripleIterator
All Implemented Interfaces:
java.lang.Runnable, org.openrdf.rio.StatementHandler

public class RIOTripleIterator
extends TripleIterator
implements org.openrdf.rio.StatementHandler, java.lang.Runnable

An iterator over triples parsed by a RIO rdf parser.

Author:
cwilper@cs.cornell.edu

Field Summary
 
Fields inherited from class org.trippi.TripleIterator
INPUT_FORMATS, OUTPUT_FORMATS
 
Constructor Summary
RIOTripleIterator(java.io.InputStream in, org.openrdf.rio.Parser parser, java.lang.String baseURI)
          Initialize the iterator by starting the parsing thread.
 
Method Summary
 void close()
          Release resources held by this iterator.
 void handleStatement(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, org.openrdf.model.Value object)
          Handle a statement from the parser.
 boolean hasNext()
          Return true if there are any more triples.
static void main(java.lang.String[] args)
           
 org.jrdf.graph.Triple next()
          Return the next triple.
 void run()
          The main method of the background thread.
 
Methods inherited from class org.trippi.TripleIterator
addToGraph, count, deleteFromGraph, fromStream, fromStream, setAliasMap, toStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RIOTripleIterator

public RIOTripleIterator(java.io.InputStream in,
                         org.openrdf.rio.Parser parser,
                         java.lang.String baseURI)
                  throws TrippiException
Initialize the iterator by starting the parsing thread.

Throws:
TrippiException
Method Detail

hasNext

public boolean hasNext()
                throws TrippiException
Description copied from class: TripleIterator
Return true if there are any more triples.

Specified by:
hasNext in class TripleIterator
Throws:
TrippiException

next

public org.jrdf.graph.Triple next()
                           throws TrippiException
Description copied from class: TripleIterator
Return the next triple.

Specified by:
next in class TripleIterator
Throws:
TrippiException

close

public void close()
           throws TrippiException
Description copied from class: TripleIterator
Release resources held by this iterator.

Specified by:
close in class TripleIterator
Throws:
TrippiException

run

public void run()
The main method of the background thread. This starts the parsing and exits when an error occurs or the parsing is finished.

Specified by:
run in interface java.lang.Runnable

handleStatement

public void handleStatement(org.openrdf.model.Resource subject,
                            org.openrdf.model.URI predicate,
                            org.openrdf.model.Value object)
                     throws org.openrdf.rio.StatementHandlerException
Handle a statement from the parser.

Specified by:
handleStatement in interface org.openrdf.rio.StatementHandler
Throws:
org.openrdf.rio.StatementHandlerException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception