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
public class BinaryRDFParser extends AbstractRDFParser
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bufprivate java.nio.charset.Charsetcharsetprivate Value[]declaredValuesprivate intformatVersionprivate java.io.DataInputStreamin-
Fields inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFParser
rdfHandler, valueFactory
-
-
Constructor Summary
Constructors Constructor Description BinaryRDFParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RDFFormatgetRDFFormat()Gets the RDF format that this parser can parse.voidparse(java.io.InputStream in, java.lang.String baseURI)Parses the data from the supplied InputStream, using the supplied baseURI to resolve any relative URI references.voidparse(java.io.Reader reader, java.lang.String baseURI)Parses the data from the supplied Reader, using the supplied baseURI to resolve any relative URI references.private ResourcereadBNode()protected byte[]readBytes(int length)private voidreadComment()private LiteralreadDatatypeLiteral()private intreadId()private LiteralreadLangLiteral()private voidreadNamespaceDecl()private LiteralreadPlainLiteral()private voidreadStatement()private java.lang.StringreadString()private TriplereadTriple()private IRIreadURI()private ValuereadValue()private voidreadValueDecl()private ValuereadValueRef()-
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 Detail
-
declaredValues
private Value[] declaredValues
-
in
private java.io.DataInputStream in
-
formatVersion
private int formatVersion
-
charset
private java.nio.charset.Charset charset
-
buf
private byte[] buf
-
-
Method Detail
-
getRDFFormat
public RDFFormat getRDFFormat()
Description copied from interface:RDFParserGets the RDF format that this parser can parse.
-
parse
public void parse(java.io.Reader reader, java.lang.String baseURI) throws java.io.IOException, RDFParseException, RDFHandlerExceptionDescription copied from interface:RDFParserParses 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:
java.io.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(java.io.InputStream in, java.lang.String baseURI) throws java.io.IOException, RDFParseException, RDFHandlerExceptionDescription copied from interface:RDFParserParses 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:
java.io.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
private void readNamespaceDecl() throws java.io.IOException, RDFHandlerException- Throws:
java.io.IOExceptionRDFHandlerException
-
readComment
private void readComment() throws java.io.IOException, RDFHandlerException- Throws:
java.io.IOExceptionRDFHandlerException
-
readValueDecl
private void readValueDecl() throws java.io.IOException, RDFParseException- Throws:
java.io.IOExceptionRDFParseException
-
readStatement
private void readStatement() throws RDFParseException, java.io.IOException, RDFHandlerException- Throws:
RDFParseExceptionjava.io.IOExceptionRDFHandlerException
-
readValue
private Value readValue() throws RDFParseException, java.io.IOException
- Throws:
RDFParseExceptionjava.io.IOException
-
readValueRef
private Value readValueRef() throws java.io.IOException, RDFParseException
- Throws:
java.io.IOExceptionRDFParseException
-
readURI
private IRI readURI() throws java.io.IOException, RDFParseException
- Throws:
java.io.IOExceptionRDFParseException
-
readBNode
private Resource readBNode() throws java.io.IOException, RDFParseException
- Throws:
java.io.IOExceptionRDFParseException
-
readPlainLiteral
private Literal readPlainLiteral() throws java.io.IOException, RDFParseException
- Throws:
java.io.IOExceptionRDFParseException
-
readLangLiteral
private Literal readLangLiteral() throws java.io.IOException, RDFParseException
- Throws:
java.io.IOExceptionRDFParseException
-
readDatatypeLiteral
private Literal readDatatypeLiteral() throws java.io.IOException, RDFParseException
- Throws:
java.io.IOExceptionRDFParseException
-
readTriple
private Triple readTriple() throws java.io.IOException
- Throws:
java.io.IOException
-
readId
private int readId() throws java.io.IOException- Throws:
java.io.IOException
-
readString
private java.lang.String readString() throws java.io.IOException- Throws:
java.io.IOException
-
readBytes
protected byte[] readBytes(int length) throws java.io.IOException- Throws:
java.io.IOException
-
-