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
public abstract class AbstractSPARQLJSONParser extends AbstractQueryResultParser
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
Fields Modifier and Type Field Description static StringBINDINGSstatic StringBNODEstatic StringBOOLEANstatic StringDATATYPEstatic StringHEADstatic StringLINKstatic StringLITERALstatic StringRESULTSstatic StringTYPEstatic StringTYPED_LITERALstatic StringURIstatic StringVALUEstatic StringVARSstatic StringXMLLANG-
Fields inherited from class org.eclipse.rdf4j.query.resultio.AbstractQueryResultParser
handler, valueFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSPARQLJSONParser()protectedAbstractSPARQLJSONParser(ValueFactory valueFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckTripleType(com.fasterxml.jackson.core.JsonParser jp, String type)Collection<RioSetting<?>>getSupportedSettings()voidparseQueryResult(InputStream in)Parse the query results out of the givenInputStreaminto the handler setup usingQueryResultParser.setQueryResultHandler(QueryResultHandler).protected booleanparseQueryResultInternal(InputStream in, boolean attemptParseBoolean, boolean attemptParseTuple)protected TripleparseTripleValue(com.fasterxml.jackson.core.JsonParser jp, String fieldName)protected ValueparseValue(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 Detail
-
HEAD
public static final String HEAD
- See Also:
- Constant Field Values
-
LINK
public static final String LINK
- See Also:
- Constant Field Values
-
VARS
public static final String VARS
- See Also:
- Constant Field Values
-
BOOLEAN
public static final String BOOLEAN
- See Also:
- Constant Field Values
-
RESULTS
public static final String RESULTS
- See Also:
- Constant Field Values
-
BINDINGS
public static final String BINDINGS
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
VALUE
public static final String VALUE
- See Also:
- Constant Field Values
-
XMLLANG
public static final String XMLLANG
- See Also:
- Constant Field Values
-
DATATYPE
public static final String DATATYPE
- See Also:
- Constant Field Values
-
LITERAL
public static final String LITERAL
- See Also:
- Constant Field Values
-
TYPED_LITERAL
public static final String TYPED_LITERAL
- See Also:
- Constant Field Values
-
BNODE
public static final String BNODE
- See Also:
- Constant Field Values
-
URI
public static final String URI
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractSPARQLJSONParser
protected AbstractSPARQLJSONParser()
-
AbstractSPARQLJSONParser
protected AbstractSPARQLJSONParser(ValueFactory valueFactory)
-
-
Method Detail
-
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
-
parseTripleValue
protected Triple parseTripleValue(com.fasterxml.jackson.core.JsonParser jp, String fieldName) throws IOException
- Throws:
IOException
-
checkTripleType
protected boolean checkTripleType(com.fasterxml.jackson.core.JsonParser jp, String type)
-
getSupportedSettings
public Collection<RioSetting<?>> getSupportedSettings()
- Specified by:
getSupportedSettingsin interfaceQueryResultParser- Overrides:
getSupportedSettingsin classAbstractQueryResultParser- Returns:
- A collection of
RioSettings that are supported by this QueryResultParser.
-
-