Class SparqlQueryApiAskExecutor
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.controller.api.sparqlquery.SparqlQueryApiExecutor
-
- edu.cornell.mannlib.vitro.webapp.controller.api.sparqlquery.SparqlQueryApiAskExecutor
-
public class SparqlQueryApiAskExecutor extends SparqlQueryApiExecutor
Process ASK queries.
-
-
Field Summary
Fields Modifier and Type Field Description protected ResultSetMediaTypemediaType-
Fields inherited from class edu.cornell.mannlib.vitro.webapp.controller.api.sparqlquery.SparqlQueryApiExecutor
queryString, rdfService
-
-
Constructor Summary
Constructors Constructor Description SparqlQueryApiAskExecutor(RDFService rdfService, String queryString, String acceptHeader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteAndFormat(OutputStream out)Execute the query and write it to the output stream, in the selected format.StringgetMediaType()What media type was selected, based on the Accept header?protected InputStreamgetRawResultStream()The RDFService returns a boolean from an ASK query, without regard to a requested format.-
Methods inherited from class edu.cornell.mannlib.vitro.webapp.controller.api.sparqlquery.SparqlQueryApiExecutor
instance
-
-
-
-
Field Detail
-
mediaType
protected final ResultSetMediaType mediaType
-
-
Constructor Detail
-
SparqlQueryApiAskExecutor
public SparqlQueryApiAskExecutor(RDFService rdfService, String queryString, String acceptHeader) throws AcceptHeaderParsingException, NotAcceptableException
-
-
Method Detail
-
getRawResultStream
protected InputStream getRawResultStream() throws RDFServiceException
The RDFService returns a boolean from an ASK query, without regard to a requested format. For TEXT, CSV and TSV, we can simple return the String value of the boolean as an InputStream. For XML and JSON, however, the W3C documents require something a bit more fancy.- Throws:
RDFServiceException
-
getMediaType
public String getMediaType()
Description copied from class:SparqlQueryApiExecutorWhat media type was selected, based on the Accept header?- Specified by:
getMediaTypein classSparqlQueryApiExecutor
-
executeAndFormat
public void executeAndFormat(OutputStream out) throws RDFServiceException, IOException
Description copied from class:SparqlQueryApiExecutorExecute the query and write it to the output stream, in the selected format.- Specified by:
executeAndFormatin classSparqlQueryApiExecutor- Throws:
RDFServiceExceptionIOException
-
-