Package org.eclipse.rdf4j.rio.binary
Class BinaryRDFParser
java.lang.Object
org.eclipse.rdf4j.rio.helpers.AbstractRDFParser
org.eclipse.rdf4j.rio.binary.BinaryRDFParser
- All Implemented Interfaces:
RDFParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
private Charset
private Value[]
private int
private DataInputStream
Fields inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFParser
rdfHandler, valueFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the RDF format that this parser can parse.void
parse
(InputStream in, String baseURI) Parses the data from the supplied InputStream, using the supplied baseURI to resolve any relative URI references.void
Parses the data from the supplied Reader, using the supplied baseURI to resolve any relative URI references.private Resource
protected byte[]
readBytes
(int length) private void
private Literal
private int
readId()
private Literal
private void
private Literal
private void
private String
private Triple
private IRI
readURI()
private Value
private void
private Value
Methods inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFParser
clear, clearBNodeIDMap, createBNode, createBNode, createLiteral, createLiteral, createNode, createNode, createStatement, createStatement, createURI, getNamespace, getParseErrorListener, getParseLocationListener, getParserConfig, getRDFHandler, getSupportedSettings, initializeNamespaceTableFromConfiguration, preserveBNodeIDs, reportError, reportError, reportError, reportError, reportError, reportFatalError, reportFatalError, reportFatalError, reportFatalError, reportFatalError, reportLocation, reportWarning, reportWarning, resolveURI, set, setBaseURI, setBaseURI, setNamespace, setParseErrorListener, setParseLocationListener, setParserConfig, setPreserveBNodeIDs, setRDFHandler, setValueFactory
-
Field Details
-
declaredValues
-
in
-
formatVersion
private int formatVersion -
charset
-
buf
private byte[] buf
-
-
Constructor Details
-
BinaryRDFParser
public BinaryRDFParser()
-
-
Method Details
-
getRDFFormat
Description copied from interface:RDFParser
Gets the RDF format that this parser can parse. -
parse
public void parse(Reader reader, String baseURI) throws IOException, RDFParseException, RDFHandlerException Description copied from interface:RDFParser
Parses the data from the supplied Reader, using the supplied baseURI to resolve any relative URI references.- Parameters:
reader
- The Reader from which to read the data.baseURI
- The URI associated with the data in the InputStream. May benull
. Parsers for syntax formats that do not support relative URIs will ignore this argument.Note that if the data contains an embedded base URI, that embedded base URI will overrule the value supplied here (see RFC 3986 section 5.1 for details).
- Throws:
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 has encountered an unrecoverable error.
-
parse
public void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException Description copied from interface:RDFParser
Parses the data from the supplied InputStream, using the supplied baseURI to resolve any relative URI references.- Parameters:
in
- The InputStream from which to read the data.baseURI
- The URI associated with the data in the InputStream. May benull
. Parsers for syntax formats that do not support relative URIs will ignore this argument.Note that if the data contains an embedded base URI, that embedded base URI will overrule the value supplied here (see RFC 3986 section 5.1 for details).
- Throws:
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 has encountered an unrecoverable error.
-
readNamespaceDecl
- Throws:
IOException
RDFHandlerException
-
readComment
- Throws:
IOException
RDFHandlerException
-
readValueDecl
- Throws:
IOException
RDFParseException
-
readStatement
-
readValue
- Throws:
RDFParseException
IOException
-
readValueRef
- Throws:
IOException
RDFParseException
-
readURI
- Throws:
IOException
RDFParseException
-
readBNode
- Throws:
IOException
RDFParseException
-
readPlainLiteral
- Throws:
IOException
RDFParseException
-
readLangLiteral
- Throws:
IOException
RDFParseException
-
readDatatypeLiteral
- Throws:
IOException
RDFParseException
-
readTriple
- Throws:
IOException
-
readId
- Throws:
IOException
-
readString
- Throws:
IOException
-
readBytes
- Throws:
IOException
-