| java.lang.Object org.openrdf.rio.helpers.RDFParserBase org.openrdf.rio.ntriples.NTriplesParser
NTriplesParser | public class NTriplesParser extends RDFParserBase (Code) | | RDF parser for N-Triples files. A specification of NTriples can be found in
this section of
the RDF Test Cases document. This parser is not thread-safe, therefore its
public methods are synchronized.
author: Arjohn Kampman |
Constructor Summary | |
public | NTriplesParser() Creates a new NTriplesParser that will use a
ValueFactoryImpl to
create object for resources, bNodes and literals. | public | NTriplesParser(ValueFactory valueFactory) Creates a new NTriplesParser that will use the supplied
ValueFactory to create RDF model objects. |
Method Summary | |
protected Literal | createLiteral(String label, String lang, String datatype) | protected URI | createURI(String uri) | final public RDFFormat | getRDFFormat() | public synchronized void | parse(InputStream in, String baseURI) Implementation of the parse(InputStream, String) method defined
in the RDFParser interface.
Parameters: in - The InputStream from which to read the data, must not benull. | public synchronized void | parse(Reader reader, String baseURI) Implementation of the parse(Reader, String) method defined in
the RDFParser interface. | protected void | reportError(String msg) Overrides
RDFParserBase.reportError(String) , adding line number
information to the error. | protected void | reportFatalError(String msg) Overrides
RDFParserBase.reportFatalError(String) , adding line
number information to the error. | protected void | reportFatalError(Exception e) Overrides
RDFParserBase.reportFatalError(Exception) , adding line
number information to the error. | protected void | reportWarning(String msg) Overrides
RDFParserBase.reportWarning(String) , adding line number
information to the error. |
NTriplesParser | public NTriplesParser()(Code) | | Creates a new NTriplesParser that will use a
ValueFactoryImpl to
create object for resources, bNodes and literals.
|
NTriplesParser | public NTriplesParser(ValueFactory valueFactory)(Code) | | Creates a new NTriplesParser that will use the supplied
ValueFactory to create RDF model objects.
Parameters: valueFactory - A ValueFactory. |
parse | public synchronized void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException(Code) | | Implementation of the parse(InputStream, String) method defined
in the RDFParser interface.
Parameters: in - The InputStream from which to read the data, must not benull. The InputStream is supposed to contain 7-bitUS-ASCII characters, as per the N-Triples specification. Parameters: baseURI - The URI associated with the data in the InputStream, must not benull. throws: IOException - If an I/O error occurred while data was read from the InputStream. throws: RDFParseException - If the parser has found an unrecoverable parse error. throws: RDFHandlerException - If the configured statement handler encountered an unrecoverableerror. throws: IllegalArgumentException - If the supplied input stream or base URI is null. |
parse | public synchronized void parse(Reader reader, String baseURI) throws IOException, RDFParseException, RDFHandlerException(Code) | | 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. Parameters: baseURI - The URI associated with the data in the Reader, must not benull. throws: IOException - If an I/O error occurred while data was read from the InputStream. throws: RDFParseException - If the parser has found an unrecoverable parse error. throws: RDFHandlerException - If the configured statement handler encountered an unrecoverableerror. throws: IllegalArgumentException - If the supplied reader or base URI is null. |
Methods inherited from org.openrdf.rio.helpers.RDFParserBase | protected void clear()(Code)(Java Doc) protected void clearBNodeIDMap()(Code)(Java Doc) protected BNode createBNode() throws RDFParseException(Code)(Java Doc) protected BNode createBNode(String nodeID) throws RDFParseException(Code)(Java Doc) protected Literal createLiteral(String label, String lang, URI datatype) throws RDFParseException(Code)(Java Doc) protected Statement createStatement(Resource subj, URI pred, Value obj) throws RDFParseException(Code)(Java Doc) protected Statement createStatement(Resource subj, URI pred, Value obj, Resource context) throws RDFParseException(Code)(Java Doc) protected URI createURI(String uri) throws RDFParseException(Code)(Java Doc) public DatatypeHandling datatypeHandling()(Code)(Java Doc) protected String getNamespace(String prefix)(Code)(Java Doc) public ParseErrorListener getParseErrorListener()(Code)(Java Doc) public ParseLocationListener getParseLocationListener()(Code)(Java Doc) public RDFHandler getRDFHandler()(Code)(Java Doc) public boolean preserveBNodeIDs()(Code)(Java Doc) protected void reportError(String msg) throws RDFParseException(Code)(Java Doc) protected void reportError(String msg, int lineNo, int columnNo) throws RDFParseException(Code)(Java Doc) protected void reportFatalError(String msg) throws RDFParseException(Code)(Java Doc) protected void reportFatalError(String msg, int lineNo, int columnNo) throws RDFParseException(Code)(Java Doc) protected void reportFatalError(Exception e) throws RDFParseException(Code)(Java Doc) protected void reportFatalError(Exception e, int lineNo, int columnNo) throws RDFParseException(Code)(Java Doc) protected void reportLocation(int lineNo, int columnNo)(Code)(Java Doc) protected void reportWarning(String msg)(Code)(Java Doc) protected void reportWarning(String msg, int lineNo, int columnNo)(Code)(Java Doc) protected URI resolveURI(String uriSpec) throws RDFParseException(Code)(Java Doc) protected void setBaseURI(String uriSpec)(Code)(Java Doc) protected void setBaseURI(ParsedURI baseURI)(Code)(Java Doc) public void setDatatypeHandling(DatatypeHandling datatypeHandling)(Code)(Java Doc) protected void setNamespace(String prefix, String namespace)(Code)(Java Doc) public void setParseErrorListener(ParseErrorListener el)(Code)(Java Doc) public void setParseLocationListener(ParseLocationListener el)(Code)(Java Doc) public void setPreserveBNodeIDs(boolean preserveBNodeIDs)(Code)(Java Doc) public void setRDFHandler(RDFHandler handler)(Code)(Java Doc) public void setStopAtFirstError(boolean stopAtFirstError)(Code)(Java Doc) public void setValueFactory(ValueFactory valueFactory)(Code)(Java Doc) public void setVerifyData(boolean verifyData)(Code)(Java Doc) public boolean stopAtFirstError()(Code)(Java Doc) public boolean verifyData()(Code)(Java Doc)
|
|
|