public class NTriplesParser extends AbstractRDFParser
RDFParser.DatatypeHandling| Modifier and Type | Field and Description |
|---|---|
protected long |
lineNo |
protected org.eclipse.rdf4j.model.Value |
object |
protected org.eclipse.rdf4j.model.IRI |
predicate |
protected PushbackReader |
reader |
protected org.eclipse.rdf4j.model.Resource |
subject |
rdfHandler, valueFactory| Constructor and Description |
|---|
NTriplesParser()
Creates a new NTriplesParser that will use a
SimpleValueFactory to create object for resources, bNodes
and literals. |
NTriplesParser(org.eclipse.rdf4j.model.ValueFactory valueFactory)
Creates a new NTriplesParser that will use the supplied ValueFactory to create RDF model objects.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
assertLineTerminates(int c)
Verifies that there is only whitespace or comments until the end of the line.
|
protected void |
clear() |
protected org.eclipse.rdf4j.model.Literal |
createLiteral(String label,
String lang,
String datatype) |
protected org.eclipse.rdf4j.model.IRI |
createURI(String uri) |
RDFFormat |
getRDFFormat() |
Collection<RioSetting<?>> |
getSupportedSettings() |
void |
parse(InputStream in,
String baseURI) |
void |
parse(Reader reader,
String baseURI) |
protected int |
parseNodeID(int c,
StringBuilder name) |
protected int |
parseObject(int c) |
protected int |
parsePredicate(int c) |
protected int |
parseSubject(int c) |
protected int |
parseUriRef(int c,
StringBuilder uriRef) |
protected int |
peekCodePoint()
Peeks at the next Unicode code point without advancing the reader, and returns its value.
|
protected int |
readCodePoint()
Reads the next Unicode code point.
|
protected void |
reportError(Exception e,
RioSetting<Boolean> setting) |
protected void |
reportError(String msg,
RioSetting<Boolean> setting)
Overrides
AbstractRDFParser.reportError(String, RioSetting), adding line number information to the error. |
protected void |
reportFatalError(Exception e)
Overrides
AbstractRDFParser.reportFatalError(Exception), adding line number information to the error. |
protected void |
reportFatalError(String msg)
Overrides
AbstractRDFParser.reportFatalError(String), adding line number information to the error. |
protected void |
reportWarning(String msg)
Overrides
AbstractRDFParser.reportWarning(String), adding line number information to the error. |
protected int |
skipLine(int c) |
protected int |
skipLine(int c,
StringBuilder sb)
Reads characters from reader until the first EOL has been read.
|
protected int |
skipToEndOfLine(int c)
Reads characters from reader until the first EOL has been read.
|
protected int |
skipWhitespace(int c)
Reads characters from reader until it finds a character that is not a space or tab, and returns this last
character code point.
|
protected void |
throwEOFException() |
protected void |
unread(int codePoint)
Pushes back a single code point by copying it to the front of the buffer.
|
clearBNodeIDMap, createBNode, createBNode, createLiteral, createLiteral, createNode, createNode, createStatement, createStatement, datatypeHandling, getNamespace, getParseErrorListener, getParseLocationListener, getParserConfig, getRDFHandler, initializeNamespaceTableFromConfiguration, preserveBNodeIDs, reportError, reportError, reportError, reportFatalError, reportFatalError, reportFatalError, reportLocation, reportWarning, resolveURI, set, setBaseURI, setBaseURI, setDatatypeHandling, setNamespace, setParseErrorListener, setParseLocationListener, setParserConfig, setPreserveBNodeIDs, setRDFHandler, setStopAtFirstError, setValueFactory, setVerifyData, stopAtFirstError, verifyDataprotected PushbackReader reader
protected long lineNo
protected org.eclipse.rdf4j.model.Resource subject
protected org.eclipse.rdf4j.model.IRI predicate
protected org.eclipse.rdf4j.model.Value object
public NTriplesParser()
SimpleValueFactory to create object for resources, bNodes
and literals.public NTriplesParser(org.eclipse.rdf4j.model.ValueFactory valueFactory)
valueFactory - A ValueFactory.public RDFFormat getRDFFormat()
public void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException
public void parse(Reader reader, String baseURI) throws IOException, RDFParseException, RDFHandlerException
protected int skipWhitespace(int c)
throws IOException
IOExceptionprotected int assertLineTerminates(int c)
throws IOException,
RDFParseException
IOExceptionRDFParseExceptionprotected int skipToEndOfLine(int c)
throws IOException
IOExceptionprotected int skipLine(int c,
StringBuilder sb)
throws IOException
IOExceptionprotected int skipLine(int c)
throws IOException
IOExceptionprotected int parseSubject(int c)
throws IOException,
RDFParseException
IOExceptionRDFParseExceptionprotected int parsePredicate(int c)
throws IOException,
RDFParseException
IOExceptionRDFParseExceptionprotected int parseObject(int c)
throws IOException,
RDFParseException
IOExceptionRDFParseExceptionprotected int parseUriRef(int c,
StringBuilder uriRef)
throws IOException,
RDFParseException
IOExceptionRDFParseExceptionprotected int parseNodeID(int c,
StringBuilder name)
throws IOException,
RDFParseException
IOExceptionRDFParseExceptionprotected int peekCodePoint()
throws IOException
IOExceptionprotected void unread(int codePoint)
throws IOException
readCodePoint() will return the same code point c again.codePoint - a single Unicode code point.IOExceptionprotected org.eclipse.rdf4j.model.IRI createURI(String uri) throws RDFParseException
createURI in class AbstractRDFParserRDFParseExceptionprotected int readCodePoint()
throws IOException
IOExceptionprotected org.eclipse.rdf4j.model.Literal createLiteral(String label, String lang, String datatype) throws RDFParseException
RDFParseExceptionprotected void reportWarning(String msg)
AbstractRDFParser.reportWarning(String), adding line number information to the error.reportWarning in class AbstractRDFParserprotected void reportError(String msg, RioSetting<Boolean> setting) throws RDFParseException
AbstractRDFParser.reportError(String, RioSetting), adding line number information to the error.reportError in class AbstractRDFParserRDFParseExceptionprotected void reportError(Exception e, RioSetting<Boolean> setting) throws RDFParseException
reportError in class AbstractRDFParserRDFParseExceptionprotected void reportFatalError(String msg) throws RDFParseException
AbstractRDFParser.reportFatalError(String), adding line number information to the error.reportFatalError in class AbstractRDFParserRDFParseExceptionprotected void reportFatalError(Exception e) throws RDFParseException
AbstractRDFParser.reportFatalError(Exception), adding line number information to the error.reportFatalError in class AbstractRDFParserRDFParseExceptionprotected void throwEOFException()
throws RDFParseException
RDFParseExceptionprotected void clear()
clear in class AbstractRDFParserpublic Collection<RioSetting<?>> getSupportedSettings()
getSupportedSettings in interface RDFParsergetSupportedSettings in class AbstractRDFParserCopyright © 2015-2021 Eclipse Foundation. All Rights Reserved.