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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate static final StringBackwards compatibility with very early version of original SPARQL spec.static final Stringstatic final Stringstatic final Stringprivate final org.slf4j.Loggerprivate static final StringBackwards compatibility with very early version of original SPARQL spec.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class AbstractQueryResultParser
handler, valueFactory -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractSPARQLJSONParser(ValueFactory valueFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckTripleType(com.fasterxml.jackson.core.JsonParser jp, String type) private com.fasterxml.jackson.core.JsonFactoryGet an instance of JsonFactory configured using the settings fromAbstractQueryResultParser.getParserConfig().Collection<RioSetting<?>> voidParse the query results out of the givenInputStreaminto the handler setup usingQueryResultParser.setQueryResultHandler(QueryResultHandler).protected booleanparseQueryResultInternal(InputStream in, boolean attemptParseBoolean, boolean attemptParseTuple) private TripleparseStardogTripleValue(com.fasterxml.jackson.core.JsonParser jp, String fieldName) protected TripleparseTripleValue(com.fasterxml.jackson.core.JsonParser jp, String fieldName) protected ValueparseValue(com.fasterxml.jackson.core.JsonParser jp, String bindingStr) private ValueparseValue(String type, String value, String language, String datatype) Parse a value out of the elements for a binding.Methods inherited from class AbstractQueryResultParser
getParseErrorListener, getParseLocationListener, getParserConfig, set, setParseErrorListener, setParseLocationListener, setParserConfig, setQueryResultHandler, setValueFactoryMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface QueryResultParser
getQueryResultFormat
-
Field Details
-
logger
private final org.slf4j.Logger logger -
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:
-
DISTINCT
Backwards compatibility with very early version of original SPARQL spec.- See Also:
-
ORDERED
Backwards compatibility with very early version of original SPARQL spec.- See Also:
-
-
Constructor Details
-
AbstractSPARQLJSONParser
protected AbstractSPARQLJSONParser() -
AbstractSPARQLJSONParser
-
-
Method Details
-
parseQueryResult
public void parseQueryResult(InputStream in) throws IOException, QueryResultParseException, QueryResultHandlerException Description copied from interface:QueryResultParserParse the query results out of the givenInputStreaminto the handler setup usingQueryResultParser.setQueryResultHandler(QueryResultHandler).- Parameters:
in- TheInputStreamto 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 theQueryResultHandlerset 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
-
parseStardogTripleValue
private Triple parseStardogTripleValue(com.fasterxml.jackson.core.JsonParser jp, String fieldName) throws IOException - Throws:
IOException
-
parseTripleValue
protected Triple parseTripleValue(com.fasterxml.jackson.core.JsonParser jp, String fieldName) throws IOException - Throws:
IOException
-
checkTripleType
-
parseValue
Parse a value out of the elements for a binding.- Parameters:
type-LITERAL,TYPED_LITERAL,BNODEorURIvalue- actual value textlanguage- language tag, if applicabledatatype- datatype tag, if applicable- Returns:
- the value corresponding to the given parameters
-
getSupportedSettings
- Specified by:
getSupportedSettingsin interfaceQueryResultParser- Overrides:
getSupportedSettingsin classAbstractQueryResultParser- Returns:
- A collection of
RioSettings that are supported by this QueryResultParser.
-
configureNewJsonFactory
private com.fasterxml.jackson.core.JsonFactory configureNewJsonFactory()Get an instance of JsonFactory configured using the settings fromAbstractQueryResultParser.getParserConfig().- Returns:
- A newly configured JsonFactory based on the currently enabled settings
-