de.fuberlin.wiwiss.ng4j.trix
Class TriXParser

java.lang.Object
  extended by de.fuberlin.wiwiss.ng4j.trix.TriXParser

public class TriXParser
extends Object

A parser for TriX files (see TriX specification). Parsed graphs and triples are passed to a ParserCallback for further processing.

TODO: Deal with TriX XSLT syntactic extensions
TODO: Have only one parse() method, with InputSource argument

Author:
Richard Cyganiak (richard@cyganiak.de)

Constructor Summary
TriXParser()
           
 
Method Summary
 void parse(InputStream source, URI baseURI, ParserCallback callback)
          Parses a TriX file from an InputStream.
 void parse(Reader source, URI baseURI, ParserCallback callback)
          Parses a TriX file from a Reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TriXParser

public TriXParser()
Method Detail

parse

public void parse(InputStream source,
                  URI baseURI,
                  ParserCallback callback)
           throws IOException,
                  SAXException
Parses a TriX file from an InputStream. Parsed graphs and triples are passed to the callback.

Parameters:
source - a stream containing a TriX file
baseURI - the URI of the input file (for resolving relative URIs)
callback - receives parsed graphs and triples
Throws:
SAXException - on XML parse error
IOException - on I/O error when reading from source

parse

public void parse(Reader source,
                  URI baseURI,
                  ParserCallback callback)
           throws IOException,
                  SAXException
Parses a TriX file from a Reader. Parsed graphs and triples are passed to the callback.

Parameters:
source - a stream containing a TriX file
baseURI - the URI of the input file (for resolving relative URIs)
callback - receives parsed graphs and triples
Throws:
SAXException - on XML parse error
IOException - on I/O error when reading from source