public class RDFJSONParser extends AbstractRDFParser implements RDFParser
RDFParser
implementation for the RDF/JSON formatRDFParser.DatatypeHandling
rdfHandler, valueFactory
Constructor and Description |
---|
RDFJSONParser()
Creates a parser using
RDFFormat.RDFJSON to identify the parser. |
RDFJSONParser(RDFFormat actualFormat)
Creates a parser using the given RDFFormat to self identify.
|
Modifier and Type | Method and Description |
---|---|
protected Literal |
createLiteral(String label,
String language,
IRI datatype,
com.fasterxml.jackson.core.JsonLocation currentLocation)
Creates a literal, using the current value, language, and datatype, and additionally using the given
JsonLocation to provide information about the line and column numbers in the event of a warning, error or
exception being generated by the creation of the literal. |
RDFFormat |
getRDFFormat()
Gets the RDF format that this parser can parse.
|
Collection<RioSetting<?>> |
getSupportedSettings() |
void |
parse(InputStream inputStream,
String baseUri)
Parses the data from the supplied InputStream, using the supplied baseURI to resolve any relative URI references.
|
void |
parse(Reader reader,
String baseUri)
Parses the data from the supplied Reader, using the supplied baseURI to resolve any relative URI references.
|
protected void |
reportError(String msg,
Exception e,
com.fasterxml.jackson.core.JsonLocation location,
RioSetting<Boolean> setting) |
protected void |
reportError(String msg,
com.fasterxml.jackson.core.JsonLocation location,
RioSetting<Boolean> setting) |
protected void |
reportFatalError(String msg,
Exception e,
com.fasterxml.jackson.core.JsonLocation location) |
protected void |
reportFatalError(String msg,
com.fasterxml.jackson.core.JsonLocation location) |
clear, clearBNodeIDMap, createBNode, createBNode, createLiteral, createLiteral, createNode, createNode, createStatement, createStatement, createURI, datatypeHandling, getNamespace, getParseErrorListener, getParseLocationListener, getParserConfig, getRDFHandler, initializeNamespaceTableFromConfiguration, preserveBNodeIDs, reportError, reportError, reportError, reportError, reportError, reportFatalError, reportFatalError, reportFatalError, reportFatalError, reportFatalError, reportLocation, reportWarning, reportWarning, resolveURI, set, setBaseURI, setBaseURI, setDatatypeHandling, setNamespace, setParseErrorListener, setParseLocationListener, setParserConfig, setPreserveBNodeIDs, setRDFHandler, setStopAtFirstError, setValueFactory, setVerifyData, stopAtFirstError, verifyData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParserConfig, parse, parse, set, setDatatypeHandling, setParseErrorListener, setParseLocationListener, setParserConfig, setPreserveBNodeIDs, setRDFHandler, setStopAtFirstError, setValueFactory, setVerifyData
public RDFJSONParser()
RDFFormat.RDFJSON
to identify the parser.public RDFJSONParser(RDFFormat actualFormat)
actualFormat
- public RDFFormat getRDFFormat()
RDFParser
getRDFFormat
in interface RDFParser
public void parse(InputStream inputStream, String baseUri) throws IOException, RDFParseException, RDFHandlerException
RDFParser
parse
in interface RDFParser
inputStream
- The InputStream from which to read the data.baseUri
- The URI associated with the data in the InputStream. May be null
. 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).
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.protected Literal createLiteral(String label, String language, IRI datatype, com.fasterxml.jackson.core.JsonLocation currentLocation) throws RDFParseException
JsonLocation
to provide information about the line and column numbers in the event of a warning, error or
exception being generated by the creation of the literal.label
- the literal's lexical labellanguage
- the literal's language tag. Can be null.datatype
- the literal's datatype. Can be null.currentLocation
- the current JsonLocation. May not be null.Literal
object.RDFParseException
protected void reportError(String msg, Exception e, com.fasterxml.jackson.core.JsonLocation location, RioSetting<Boolean> setting) throws RDFParseException
RDFParseException
protected void reportError(String msg, com.fasterxml.jackson.core.JsonLocation location, RioSetting<Boolean> setting) throws RDFParseException
RDFParseException
protected void reportFatalError(String msg, Exception e, com.fasterxml.jackson.core.JsonLocation location) throws RDFParseException
RDFParseException
protected void reportFatalError(String msg, com.fasterxml.jackson.core.JsonLocation location) throws RDFParseException
RDFParseException
public void parse(Reader reader, String baseUri) throws IOException, RDFParseException, RDFHandlerException
RDFParser
parse
in interface RDFParser
reader
- The Reader from which to read the data.baseUri
- The URI associated with the data in the InputStream. May be null
. 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).
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.public Collection<RioSetting<?>> getSupportedSettings()
getSupportedSettings
in interface RDFParser
getSupportedSettings
in class AbstractRDFParser
RioSetting
s that are supported by this RDFParser.Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.