Franz Inc, AllegroGraph

com.franz.openrdf.rio.nquads
Class NQuadsParser

java.lang.Object
  extended by org.openrdf.rio.helpers.RDFParserBase
      extended by com.franz.openrdf.rio.nquads.NQuadsParser
All Implemented Interfaces:
org.openrdf.rio.RDFParser

public class NQuadsParser
extends org.openrdf.rio.helpers.RDFParserBase

RDF parser for N-Quads files. A specification of NQuads can be found here. This parser is not thread-safe, therefore its public methods are synchronized. Modified from openrdf's NTriplesParser.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.openrdf.rio.RDFParser
org.openrdf.rio.RDFParser.DatatypeHandling
 
Constructor Summary
NQuadsParser()
          Creates a new NQuadsParser that will use a ValueFactoryImpl to create object for resources, bNodes and literals.
NQuadsParser(org.openrdf.model.ValueFactory valueFactory)
          Creates a new NQuadsParser that will use the supplied ValueFactory to create RDF model objects.
 
Method Summary
 org.openrdf.rio.RDFFormat getRDFFormat()
           
 void parse(InputStream in, String baseURI)
          Implementation of the parse(InputStream, String) method defined in the RDFParser interface.
 void parse(Reader reader, String baseURI)
          Implementation of the parse(Reader, String) method defined in the RDFParser interface.
 
Methods inherited from class org.openrdf.rio.helpers.RDFParserBase
datatypeHandling, getParseErrorListener, getParseLocationListener, getParserConfig, getRDFHandler, preserveBNodeIDs, setDatatypeHandling, setParseErrorListener, setParseLocationListener, setParserConfig, setPreserveBNodeIDs, setRDFHandler, setStopAtFirstError, setValueFactory, setVerifyData, stopAtFirstError, verifyData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NQuadsParser

public NQuadsParser()
Creates a new NQuadsParser that will use a ValueFactoryImpl to create object for resources, bNodes and literals.


NQuadsParser

public NQuadsParser(org.openrdf.model.ValueFactory valueFactory)
Creates a new NQuadsParser that will use the supplied ValueFactory to create RDF model objects.

Parameters:
valueFactory - A ValueFactory.
Method Detail

getRDFFormat

public final org.openrdf.rio.RDFFormat getRDFFormat()

parse

public void parse(InputStream in,
                  String baseURI)
           throws IOException,
                  org.openrdf.rio.RDFParseException,
                  org.openrdf.rio.RDFHandlerException
Implementation of the parse(InputStream, String) method defined in the RDFParser interface.

Parameters:
in - The InputStream from which to read the data, must not be null. The InputStream is supposed to contain 7-bit US-ASCII characters, as per the N-Triples specification.
baseURI - The URI associated with the data in the InputStream, must not be null.
Throws:
IOException - If an I/O error occurred while data was read from the InputStream.
org.openrdf.rio.RDFParseException - If the parser has found an unrecoverable parse error.
org.openrdf.rio.RDFHandlerException - If the configured statement handler encountered an unrecoverable error.
IllegalArgumentException - If the supplied input stream or base URI is null.

parse

public void parse(Reader reader,
                  String baseURI)
           throws IOException,
                  org.openrdf.rio.RDFParseException,
                  org.openrdf.rio.RDFHandlerException
Implementation of the parse(Reader, String) method defined in the RDFParser interface.

Parameters:
reader - The Reader from which to read the data, must not be null.
baseURI - The URI associated with the data in the Reader, must not be null.
Throws:
IOException - If an I/O error occurred while data was read from the InputStream.
org.openrdf.rio.RDFParseException - If the parser has found an unrecoverable parse error.
org.openrdf.rio.RDFHandlerException - If the configured statement handler encountered an unrecoverable error.
IllegalArgumentException - If the supplied reader or base URI is null.

Copyright © 2008-2012 Franz Inc.