Class RDFServiceSparqlHttp
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceImpl
-
- edu.cornell.mannlib.vitro.webapp.rdfservice.impl.sparql.RDFServiceSparql
-
- edu.cornell.mannlib.vitro.webapp.rdfservice.impl.sparql.RDFServiceSparqlHttp
-
- All Implemented Interfaces:
RDFService
public class RDFServiceSparqlHttp extends RDFServiceSparql
This is a RDFService that passes SPARQL queries to the SPARQL endpoint unaltered and without parsing them. This is useful if the endpoint accepts syntax that does not pass the ARQ SPARQL 1.1 parser. The disadvantage of this is that it currently returns no useful debugging messages when there is a syntax error.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
RDFService.ModelSerializationFormat, RDFService.ResultFormat, RDFService.SPARQLQueryType
-
-
Field Summary
-
Fields inherited from class edu.cornell.mannlib.vitro.webapp.rdfservice.impl.sparql.RDFServiceSparql
httpClient, readEndpointURI, rebuildGraphURICache, updateEndpointURI
-
Fields inherited from class edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceImpl
defaultWriteGraphURI, registeredJenaListeners, registeredListeners
-
-
Constructor Summary
Constructors Constructor Description RDFServiceSparqlHttp(String endpointURI)RDFServiceSparqlHttp(String readEndpointURI, String updateEndpointURI)RDFServiceSparqlHttp(String readEndpointURI, String updateEndpointURI, String defaultWriteGraphURI)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleansparqlAskQuery(String queryStr)Performs a SPARQL ASK query against the knowledge base.InputStreamsparqlConstructQuery(String queryStr, RDFService.ModelSerializationFormat resultFormat)Performs a SPARQL construct query against the knowledge base.voidsparqlConstructQuery(String queryStr, org.apache.jena.rdf.model.Model model)Performs a SPARQL construct query against the knowledge base.InputStreamsparqlDescribeQuery(String queryStr, RDFService.ModelSerializationFormat resultFormat)Performs a SPARQL describe query against the knowledge base.InputStreamsparqlSelectQuery(String queryStr, RDFService.ResultFormat resultFormat)Performs a SPARQL select query against the knowledge base.voidsparqlSelectQuery(String queryStr, ResultSetConsumer consumer)Performs a SPARQL select query against the knowledge base.-
Methods inherited from class edu.cornell.mannlib.vitro.webapp.rdfservice.impl.sparql.RDFServiceSparql
changeSetUpdate, close, executeUpdate, getContext, getCredentials, getDefaultWriteGraphURI, getGraphMetadata, getGraphURIs, getReadEndpointURI, getUpdateEndpointURI, isEquivalentGraph, isEquivalentGraph, isPreconditionSatisfied, manufactureChangeSet, preferPreciseOptionals, registerListener, serializeAll, serializeGraph, sparqlSelectQueryHasResults, testConnection, unregisterListener
-
Methods inherited from class edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceImpl
countTriples, createQuery, getRegisteredJenaModelChangedListeners, getRegisteredListeners, getSerializationFormatString, getTriples, getVitroRequest, newIndividual, newIndividual, notifyListeners, notifyListenersOfChanges, notifyListenersOfEvent, pyString, registerJenaModelChangedListener, separateStatementsWithBlankNodes, setVitroRequest, sparqlNode, sparqlNodeUpdate, sparqlTriple, toString, unregisterJenaModelChangedListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
countTriples, getTriples, getVitroRequest, newIndividual, newIndividual, registerJenaModelChangedListener, setVitroRequest, unregisterJenaModelChangedListener
-
-
-
-
Constructor Detail
-
RDFServiceSparqlHttp
public RDFServiceSparqlHttp(String endpointURI)
-
-
Method Detail
-
sparqlConstructQuery
public InputStream sparqlConstructQuery(String queryStr, RDFService.ModelSerializationFormat resultFormat) throws RDFServiceException
Performs a SPARQL construct query against the knowledge base. The query may have an embedded graph identifier.- Specified by:
sparqlConstructQueryin interfaceRDFService- Overrides:
sparqlConstructQueryin classRDFServiceSparql- Parameters:
queryStr- - the SPARQL query to be executed against the RDF storeresultFormat- - type of serialization for RDF result of the SPARQL query- Returns:
- InputStream - the result of the query
- Throws:
RDFServiceException
-
sparqlConstructQuery
public void sparqlConstructQuery(String queryStr, org.apache.jena.rdf.model.Model model) throws RDFServiceException
Description copied from interface:RDFServicePerforms a SPARQL construct query against the knowledge base. The query may have an embedded graph identifier. If the query does not contain a graph identifier the query is executed against the union of all named and unnamed graphs in the store.- Specified by:
sparqlConstructQueryin interfaceRDFService- Overrides:
sparqlConstructQueryin classRDFServiceSparql- Parameters:
queryStr- - the SPARQL query to be executed against the RDF storemodel- - the Model to add the statements to- Throws:
RDFServiceException
-
sparqlDescribeQuery
public InputStream sparqlDescribeQuery(String queryStr, RDFService.ModelSerializationFormat resultFormat) throws RDFServiceException
Performs a SPARQL describe query against the knowledge base. The query may have an embedded graph identifier.- Specified by:
sparqlDescribeQueryin interfaceRDFService- Overrides:
sparqlDescribeQueryin classRDFServiceSparql- Parameters:
queryStr- - the SPARQL query to be executed against the RDF storeresultFormat- - type of serialization for RDF result of the SPARQL query- Returns:
- InputStream - the result of the query
- Throws:
RDFServiceException
-
sparqlSelectQuery
public InputStream sparqlSelectQuery(String queryStr, RDFService.ResultFormat resultFormat) throws RDFServiceException
Performs a SPARQL select query against the knowledge base. The query may have an embedded graph identifier.- Specified by:
sparqlSelectQueryin interfaceRDFService- Overrides:
sparqlSelectQueryin classRDFServiceSparql- Parameters:
queryStr- - the SPARQL query to be executed against the RDF storeresultFormat- - format for the result of the Select query- Returns:
- InputStream - the result of the query
- Throws:
RDFServiceException
-
sparqlSelectQuery
public void sparqlSelectQuery(String queryStr, ResultSetConsumer consumer) throws RDFServiceException
Description copied from interface:RDFServicePerforms a SPARQL select query against the knowledge base. The query may have an embedded graph identifier. If the query does not contain a graph identifier the query is executed against the union of all named and unnamed graphs in the store.- Specified by:
sparqlSelectQueryin interfaceRDFService- Overrides:
sparqlSelectQueryin classRDFServiceSparql- Parameters:
queryStr- - the SPARQL query to be executed against the RDF storeconsumer- - the class to consume the results of the query- Throws:
RDFServiceException
-
sparqlAskQuery
public boolean sparqlAskQuery(String queryStr) throws RDFServiceException
Performs a SPARQL ASK query against the knowledge base. The query may have an embedded graph identifier.- Specified by:
sparqlAskQueryin interfaceRDFService- Overrides:
sparqlAskQueryin classRDFServiceSparql- Parameters:
queryStr- - the SPARQL query to be executed against the RDF store- Returns:
- boolean - the result of the SPARQL query
- Throws:
RDFServiceException
-
-