Class AbstractSPARQLJSONParser
java.lang.Object
org.eclipse.rdf4j.query.resultio.AbstractQueryResultParser
org.eclipse.rdf4j.query.resultio.sparqljson.AbstractSPARQLJSONParser
- All Implemented Interfaces:
QueryResultParser
- Direct Known Subclasses:
SPARQLBooleanJSONParser
,SPARQLJSONParserBase
,SPARQLResultsJSONParser
Abstract base class for SPARQL Results JSON Parsers. Provides a common implementation of both boolean and tuple
parsing.
- Author:
- Peter Ansell, Sebastian Schaffert
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class org.eclipse.rdf4j.query.resultio.AbstractQueryResultParser
handler, valueFactory
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
AbstractSPARQLJSONParser
(ValueFactory valueFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkTripleType
(com.fasterxml.jackson.core.JsonParser jp, String type) Collection<RioSetting<?>>
void
Parse the query results out of the givenInputStream
into the handler setup usingQueryResultParser.setQueryResultHandler(QueryResultHandler)
.protected boolean
parseQueryResultInternal
(InputStream in, boolean attemptParseBoolean, boolean attemptParseTuple) protected Triple
parseTripleValue
(com.fasterxml.jackson.core.JsonParser jp, String fieldName) protected Value
parseValue
(com.fasterxml.jackson.core.JsonParser jp, String bindingStr) Methods inherited from class org.eclipse.rdf4j.query.resultio.AbstractQueryResultParser
getParseErrorListener, getParseLocationListener, getParserConfig, set, setParseErrorListener, setParseLocationListener, setParserConfig, setQueryResultHandler, setValueFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.rdf4j.query.resultio.QueryResultParser
getQueryResultFormat
-
Field Details
-
HEAD
- See Also:
-
LINK
- See Also:
-
VARS
- See Also:
-
BOOLEAN
- See Also:
-
RESULTS
- See Also:
-
BINDINGS
- See Also:
-
TYPE
- See Also:
-
VALUE
- See Also:
-
XMLLANG
- See Also:
-
DATATYPE
- See Also:
-
LITERAL
- See Also:
-
TYPED_LITERAL
- See Also:
-
BNODE
- See Also:
-
URI
- See Also:
-
-
Constructor Details
-
AbstractSPARQLJSONParser
protected AbstractSPARQLJSONParser() -
AbstractSPARQLJSONParser
-
-
Method Details
-
parseQueryResult
public void parseQueryResult(InputStream in) throws IOException, QueryResultParseException, QueryResultHandlerException Description copied from interface:QueryResultParser
Parse the query results out of the givenInputStream
into the handler setup usingQueryResultParser.setQueryResultHandler(QueryResultHandler)
.- Parameters:
in
- TheInputStream
to parse the results from.- Throws:
IOException
- If there is an exception from the InputStream.QueryResultParseException
- If the query results are not parsable by this parser.QueryResultHandlerException
- If theQueryResultHandler
set inQueryResultParser.setQueryResultHandler(QueryResultHandler)
throws an exception.
-
parseQueryResultInternal
protected boolean parseQueryResultInternal(InputStream in, boolean attemptParseBoolean, boolean attemptParseTuple) throws IOException, QueryResultParseException, QueryResultHandlerException -
parseValue
protected Value parseValue(com.fasterxml.jackson.core.JsonParser jp, String bindingStr) throws IOException - Throws:
IOException
-
parseTripleValue
protected Triple parseTripleValue(com.fasterxml.jackson.core.JsonParser jp, String fieldName) throws IOException - Throws:
IOException
-
checkTripleType
-
getSupportedSettings
- Specified by:
getSupportedSettings
in interfaceQueryResultParser
- Overrides:
getSupportedSettings
in classAbstractQueryResultParser
- Returns:
- A collection of
RioSetting
s that are supported by this QueryResultParser.
-