|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.rio.helpers.RDFParserBase
org.openrdf.rio.ntriples.NTriplesParser
public class NTriplesParser
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.openrdf.rio.RDFParser |
|---|
RDFParser.DatatypeHandling |
| Field Summary |
|---|
| Fields inherited from class org.openrdf.rio.helpers.RDFParserBase |
|---|
rdfHandler |
| Constructor Summary | |
|---|---|
NTriplesParser()
Creates a new NTriplesParser that will use a ValueFactoryImpl to
create object for resources, bNodes and literals. |
|
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)
Creates a URI object for the specified URI-string. |
RDFFormat |
getRDFFormat()
Gets the RDF format that this parser can parse. |
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. |
protected void |
reportError(String msg)
Overrides RDFParserBase.reportError(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 |
reportFatalError(String msg)
Overrides RDFParserBase.reportFatalError(String), adding line
number information to the error. |
protected void |
reportWarning(String msg)
Overrides RDFParserBase.reportWarning(String), adding line number
information to the error. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NTriplesParser()
ValueFactoryImpl to
create object for resources, bNodes and literals.
public NTriplesParser(ValueFactory valueFactory)
valueFactory - A ValueFactory.| Method Detail |
|---|
public final RDFFormat getRDFFormat()
RDFParser
public void parse(InputStream in,
String baseURI)
throws IOException,
RDFParseException,
RDFHandlerException
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.
IOException - If an I/O error occurred while data was read from the InputStream.
RDFParseException - If the parser has found an unrecoverable parse error.
RDFHandlerException - If the configured statement handler encountered an unrecoverable
error.
IllegalArgumentException - If the supplied input stream or base URI is null.
public void parse(Reader reader,
String baseURI)
throws IOException,
RDFParseException,
RDFHandlerException
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.
IOException - If an I/O error occurred while data was read from the InputStream.
RDFParseException - If the parser has found an unrecoverable parse error.
RDFHandlerException - If the configured statement handler encountered an unrecoverable
error.
IllegalArgumentException - If the supplied reader or base URI is null.
protected URI createURI(String uri)
throws RDFParseException
RDFParserBaseURI object for the specified URI-string.
createURI in class RDFParserBaseRDFParseException
protected Literal createLiteral(String label,
String lang,
String datatype)
throws RDFParseException
RDFParseExceptionprotected void reportWarning(String msg)
RDFParserBase.reportWarning(String), adding line number
information to the error.
reportWarning in class RDFParserBase
protected void reportError(String msg)
throws RDFParseException
RDFParserBase.reportError(String), adding line number
information to the error.
reportError in class RDFParserBaseRDFParseExceptionRDFParserBase.setStopAtFirstError(boolean)
protected void reportFatalError(String msg)
throws RDFParseException
RDFParserBase.reportFatalError(String), adding line
number information to the error.
reportFatalError in class RDFParserBaseRDFParseException
protected void reportFatalError(Exception e)
throws RDFParseException
RDFParserBase.reportFatalError(Exception), adding line
number information to the error.
reportFatalError in class RDFParserBaseRDFParseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||