|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.fuberlin.wiwiss.ng4j.trix.TriXParserWithExtensions
public class TriXParserWithExtensions
A parser for TriX files (see
TriX
specification). Parsed graphs and triples are passed to a
ParserCallback for further processing.
The parser supports TriX syntactic extensions, which are XSLT stylesheets referenced using a processing instructions. The implementation loads the input document as a DOM tree, finds the processing instructions, applies the stylesheets if any are found, re-serializes the tree as XML, then parses again using a SAX parser. The reason for this waste of resources is that I didn't find a way to validate a DOM tree against an XML schema.
TODO: Implement syntactic extensions in a less braindead way
TODO: Have only one parse() method, with InputSource argument
| Constructor Summary | |
|---|---|
TriXParserWithExtensions()
|
|
| 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 |
|---|
public TriXParserWithExtensions()
| Method Detail |
|---|
public void parse(InputStream source,
URI baseURI,
ParserCallback callback)
throws IOException,
SAXException,
TransformerException
source - a stream containing a TriX filebaseURI - the URI of the input file (for resolving relative URIs)callback - receives parsed graphs and triples
SAXException - on XML parse error
IOException - on I/O error when reading from source
TransformerException - on error when applying an XSLT syntactic extension
public void parse(Reader source,
URI baseURI,
ParserCallback callback)
throws IOException,
SAXException,
TransformerException
source - a stream containing a TriX filebaseURI - the URI of the input file (for resolving relative URIs)callback - receives parsed graphs and triples
SAXException - on XML parse error
IOException - on I/O error when reading from source
TransformerException - on error when applying an XSLT syntactic extension
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||