public class TurtleParser extends AbstractRDFParser
RDFParser.DatatypeHandling| Modifier and Type | Field and Description |
|---|---|
protected org.eclipse.rdf4j.model.Value |
object |
protected org.eclipse.rdf4j.model.IRI |
predicate |
protected org.eclipse.rdf4j.model.Resource |
subject |
rdfHandler, valueFactory| Constructor and Description |
|---|
TurtleParser()
Creates a new TurtleParser that will use a
SimpleValueFactory to create RDF model objects. |
TurtleParser(org.eclipse.rdf4j.model.ValueFactory valueFactory)
Creates a new TurtleParser that will use the supplied ValueFactory to create RDF model objects.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
getLineNumber() |
RDFFormat |
getRDFFormat() |
Collection<RioSetting<?>> |
getSupportedSettings() |
void |
parse(InputStream in,
String baseURI) |
void |
parse(Reader reader,
String baseURI) |
protected void |
parseAnnotation() |
protected void |
parseBase() |
protected org.eclipse.rdf4j.model.Resource |
parseCollection()
Parses a collection, e.g.
|
protected void |
parseDirective(String directive) |
protected org.eclipse.rdf4j.model.Resource |
parseImplicitBlank()
Parses an implicit blank node.
|
protected String |
parseLongString(int closingCharacter)
Parses a """long string""".
|
protected org.eclipse.rdf4j.model.Resource |
parseNodeID()
Parses a blank node ID, e.g.
|
protected org.eclipse.rdf4j.model.Literal |
parseNumber() |
protected void |
parseObject()
Parse an object
|
protected void |
parseObjectList() |
protected org.eclipse.rdf4j.model.IRI |
parsePredicate() |
protected void |
parsePredicateObjectList() |
protected void |
parsePrefixID() |
protected org.eclipse.rdf4j.model.Value |
parseQNameOrBoolean()
Parses qnames and boolean values, which have equivalent starting characters.
|
protected org.eclipse.rdf4j.model.Literal |
parseQuotedLiteral()
Parses a quoted string, optionally followed by a language tag or datatype.
|
protected String |
parseQuotedString()
Parses a quoted string, which is either a "normal string" or a """long string""".
|
protected void |
parseStatement() |
protected String |
parseString(int closingCharacter)
Parses a "normal string".
|
protected void |
parseSubject() |
protected void |
parseTriples() |
protected org.eclipse.rdf4j.model.Triple |
parseTripleValue()
Parser an RDF-star triple value and returns it.
|
protected org.eclipse.rdf4j.model.IRI |
parseURI() |
protected org.eclipse.rdf4j.model.Value |
parseValue()
Parses an RDF value.
|
protected int |
peekCodePoint()
Peeks at the next Unicode code point without advancing the reader, and returns its value.
|
protected boolean |
peekIsTripleValue()
Peeks at the next two Unicode code points without advancing the reader and returns true if they indicate the
start of an RDF-star triple value.
|
protected void |
processComment()
Consumes characters from reader until the first EOL has been read.
|
protected int |
readCodePoint()
Reads the next Unicode code point.
|
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 |
reportLocation() |
protected void |
reportStatement(org.eclipse.rdf4j.model.Resource subj,
org.eclipse.rdf4j.model.IRI pred,
org.eclipse.rdf4j.model.Value obj) |
protected void |
reportWarning(String msg)
Overrides
AbstractRDFParser.reportWarning(String), adding line number information to the error. |
protected int |
skipWSC()
Consumes any white space characters (space, tab, line feed, newline) and comments (#-style) from reader.
|
protected void |
throwEOFException() |
protected void |
unread(int codePoint)
Pushes back a single code point by copying it to the front of the buffer.
|
protected void |
unread(String string)
Pushes back the supplied string by copying it to the front of the buffer.
|
protected void |
verifyCharacterOrFail(int codePoint,
String expected)
Verifies that the supplied character code point codePoint is one of the expected characters specified in
expected.
|
clear, clearBNodeIDMap, createBNode, createBNode, createLiteral, createLiteral, createNode, createNode, createStatement, createStatement, createURI, datatypeHandling, getNamespace, getParseErrorListener, getParseLocationListener, getParserConfig, getRDFHandler, initializeNamespaceTableFromConfiguration, preserveBNodeIDs, reportError, reportError, reportError, reportError, reportFatalError, reportFatalError, reportFatalError, reportLocation, reportWarning, resolveURI, set, setBaseURI, setBaseURI, setDatatypeHandling, setNamespace, setParseErrorListener, setParseLocationListener, setParserConfig, setPreserveBNodeIDs, setRDFHandler, setStopAtFirstError, setValueFactory, setVerifyData, stopAtFirstError, verifyDataprotected org.eclipse.rdf4j.model.Resource subject
protected org.eclipse.rdf4j.model.IRI predicate
protected org.eclipse.rdf4j.model.Value object
public TurtleParser()
SimpleValueFactory to create RDF model objects.public TurtleParser(org.eclipse.rdf4j.model.ValueFactory valueFactory)
valueFactory - A ValueFactory.public RDFFormat getRDFFormat()
public Collection<RioSetting<?>> getSupportedSettings()
getSupportedSettings in interface RDFParsergetSupportedSettings in class AbstractRDFParserpublic void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException
public void parse(Reader reader, String baseURI) throws IOException, RDFParseException, RDFHandlerException
protected void parseStatement()
throws IOException,
RDFParseException,
RDFHandlerException
protected void parseDirective(String directive) throws IOException, RDFParseException, RDFHandlerException
protected void parsePrefixID()
throws IOException,
RDFParseException,
RDFHandlerException
protected void parseBase()
throws IOException,
RDFParseException,
RDFHandlerException
protected void parseTriples()
throws IOException,
RDFParseException,
RDFHandlerException
protected void parsePredicateObjectList()
throws IOException,
RDFParseException,
RDFHandlerException
protected void parseObjectList()
throws IOException,
RDFParseException,
RDFHandlerException
protected void parseSubject()
throws IOException,
RDFParseException,
RDFHandlerException
protected org.eclipse.rdf4j.model.IRI parsePredicate() throws IOException, RDFParseException, RDFHandlerException
protected void parseObject()
throws IOException,
RDFParseException,
RDFHandlerException
protected org.eclipse.rdf4j.model.Resource parseCollection() throws IOException, RDFParseException, RDFHandlerException
protected org.eclipse.rdf4j.model.Resource parseImplicitBlank() throws IOException, RDFParseException, RDFHandlerException
protected org.eclipse.rdf4j.model.Value parseValue() throws IOException, RDFParseException, RDFHandlerException
protected org.eclipse.rdf4j.model.Literal parseQuotedLiteral() throws IOException, RDFParseException, RDFHandlerException
protected String parseQuotedString() throws IOException, RDFParseException
IOExceptionRDFParseExceptionprotected String parseString(int closingCharacter) throws IOException, RDFParseException
IOExceptionRDFParseExceptionprotected String parseLongString(int closingCharacter) throws IOException, RDFParseException
IOExceptionRDFParseExceptionprotected org.eclipse.rdf4j.model.Literal parseNumber() throws IOException, RDFParseException
IOExceptionRDFParseExceptionprotected org.eclipse.rdf4j.model.IRI parseURI() throws IOException, RDFParseException
IOExceptionRDFParseExceptionprotected org.eclipse.rdf4j.model.Value parseQNameOrBoolean() throws IOException, RDFParseException
IOExceptionRDFParseExceptionprotected org.eclipse.rdf4j.model.Resource parseNodeID() throws IOException, RDFParseException
IOExceptionRDFParseExceptionprotected void reportStatement(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj) throws RDFParseException, RDFHandlerException
RDFParseExceptionRDFHandlerExceptionprotected void verifyCharacterOrFail(int codePoint,
String expected)
throws RDFParseException
RDFParseExceptionprotected int skipWSC()
throws IOException,
RDFHandlerException
IOExceptionRDFHandlerExceptionprotected void processComment()
throws IOException,
RDFHandlerException
AbstractRDFParser.rdfHandler as a comment.IOExceptionRDFHandlerExceptionprotected int readCodePoint()
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 void unread(String string) throws IOException
readCodePoint() will return the code points in the supplied string again, starting at the first
in the String..string - the string to un-read.IOExceptionprotected int peekCodePoint()
throws IOException
IOExceptionprotected void reportLocation()
protected 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 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 int getLineNumber()
protected boolean peekIsTripleValue()
throws IOException
IOExceptionprotected org.eclipse.rdf4j.model.Triple parseTripleValue() throws IOException
IOExceptionprotected void parseAnnotation()
throws IOException
IOExceptionCopyright © 2015-2021 Eclipse Foundation. All Rights Reserved.