public class RDFServiceSparql extends RDFServiceImpl implements RDFService
RDFService.ModelSerializationFormat, RDFService.ResultFormat, RDFService.SPARQLQueryType| Modifier and Type | Field and Description |
|---|---|
protected org.apache.http.client.HttpClient |
httpClient |
protected String |
readEndpointURI |
protected boolean |
rebuildGraphURICache |
protected String |
updateEndpointURI |
BNODE_ROOT_QUERY, defaultWriteGraphURI, registeredJenaListeners, registeredListeners| Constructor and Description |
|---|
RDFServiceSparql(String endpointURI)
Returns an RDFService for a remote repository
|
RDFServiceSparql(String readEndpointURI,
String updateEndpointURI)
Returns an RDFService for a remote repository
|
RDFServiceSparql(String readEndpointURI,
String updateEndpointURI,
String defaultWriteGraphURI)
Returns an RDFService for a remote repository
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
changeSetUpdate(ChangeSet changeSet)
Perform a series of additions to and or removals from specified graphs
in the RDF store.
|
void |
close()
Frees any resources held by this RDFService object
The implementation of this method should be idempotent so that
multiple invocations do not cause an error.
|
protected void |
executeUpdate(String updateString) |
protected org.apache.http.protocol.HttpContext |
getContext(org.apache.http.client.methods.HttpRequestBase request) |
protected org.apache.http.auth.UsernamePasswordCredentials |
getCredentials() |
String |
getDefaultWriteGraphURI()
Get the URI of the default write graph
|
void |
getGraphMetadata()
To be determined.
|
List<String> |
getGraphURIs()
Get a list of all the graph URIs in the RDF store.
|
protected String |
getReadEndpointURI() |
protected String |
getUpdateEndpointURI() |
boolean |
isEquivalentGraph(String graphURI,
InputStream serializedGraph,
RDFService.ModelSerializationFormat serializationFormat)
The basic version.
|
boolean |
isEquivalentGraph(String graphURI,
org.apache.jena.rdf.model.Model graph)
The basic version.
|
protected boolean |
isPreconditionSatisfied(String query,
RDFService.SPARQLQueryType queryType) |
ChangeSet |
manufactureChangeSet()
Create a ChangeSet object
|
boolean |
preferPreciseOptionals() |
void |
registerListener(ChangeListener changeListener)
Register a listener to listen to changes in any graph in
the RDF store.
|
void |
serializeAll(OutputStream outputStream)
Serializes the union of all named and unnamed graphs in the store to the
supplied OutputStream, in N-Quads format.
|
void |
serializeGraph(String graphURI,
OutputStream outputStream)
Serializes the contents of the named graph to the supplied OutputStream,
in N-Triples format.
|
boolean |
sparqlAskQuery(String queryStr)
Performs a SPARQL ASK query against the knowledge base.
|
void |
sparqlConstructQuery(String queryStr,
org.apache.jena.rdf.model.Model model)
Performs a SPARQL construct query against the knowledge base.
|
InputStream |
sparqlConstructQuery(String queryStr,
RDFService.ModelSerializationFormat resultFormat)
Performs a SPARQL construct query against the knowledge base.
|
InputStream |
sparqlDescribeQuery(String queryStr,
RDFService.ModelSerializationFormat resultFormat)
Performs a SPARQL describe query against the knowledge base.
|
InputStream |
sparqlSelectQuery(String queryStr,
RDFService.ResultFormat resultFormat)
Performs a SPARQL select query against the knowledge base.
|
void |
sparqlSelectQuery(String queryStr,
ResultSetConsumer consumer)
Performs a SPARQL select query against the knowledge base.
|
protected boolean |
sparqlSelectQueryHasResults(String queryStr) |
protected void |
testConnection() |
void |
unregisterListener(ChangeListener changeListener)
Unregister a listener from listening to changes in any graph
in the RDF store.
|
countTriples, createQuery, getRegisteredJenaModelChangedListeners, getRegisteredListeners, getSerializationFormatString, getTriples, getVitroRequest, newIndividual, newIndividual, notifyListeners, notifyListenersOfChanges, notifyListenersOfEvent, pyString, registerJenaModelChangedListener, separateStatementsWithBlankNodes, setVitroRequest, sparqlNode, sparqlNodeUpdate, sparqlTriple, toString, unregisterJenaModelChangedListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcountTriples, getTriples, getVitroRequest, newIndividual, newIndividual, registerJenaModelChangedListener, setVitroRequest, unregisterJenaModelChangedListenerprotected String readEndpointURI
protected String updateEndpointURI
protected org.apache.http.client.HttpClient httpClient
protected boolean rebuildGraphURICache
public RDFServiceSparql(String readEndpointURI, String updateEndpointURI, String defaultWriteGraphURI)
readEndpointURI - - URI of the read SPARQL endpoint for the knowledge baseupdateEndpointURI - - URI of the update SPARQL endpoint for the knowledge basedefaultWriteGraphURI - - URI of the default write graph within the knowledge base.
this is the graph that will be written to when a graph
is not explicitly specified.
The default read graph is the union of all graphs in the
knowledge basepublic RDFServiceSparql(String readEndpointURI, String updateEndpointURI)
readEndpointURI - - URI of the read SPARQL endpoint for the knowledge baseupdateEndpointURI - - URI of the update SPARQL endpoint for the knowledge base
The default read graph is the union of all graphs in the
knowledge basepublic RDFServiceSparql(String endpointURI)
endpointURI - - URI of the read and update SPARQL endpoint for the knowledge base
The default read graph is the union of all graphs in the
knowledge baseprotected void testConnection()
public void close()
RDFServiceclose in interface RDFServicepublic boolean changeSetUpdate(ChangeSet changeSet) throws RDFServiceException
changeSetUpdate in interface RDFServicechangeSet - - a set of changes to be performed on the RDF store.RDFServiceExceptionpublic InputStream sparqlConstructQuery(String queryStr, RDFService.ModelSerializationFormat resultFormat) throws RDFServiceException
sparqlConstructQuery in interface RDFServicequeryStr - - the SPARQL query to be executed against the RDF storeresultFormat - - type of serialization for RDF result of the SPARQL queryRDFServiceExceptionpublic void sparqlConstructQuery(String queryStr, org.apache.jena.rdf.model.Model model) throws RDFServiceException
RDFServicesparqlConstructQuery in interface RDFServicequeryStr - - the SPARQL query to be executed against the RDF storemodel - - the Model to add the statements toRDFServiceExceptionpublic InputStream sparqlDescribeQuery(String queryStr, RDFService.ModelSerializationFormat resultFormat) throws RDFServiceException
sparqlDescribeQuery in interface RDFServicequeryStr - - the SPARQL query to be executed against the RDF storeresultFormat - - type of serialization for RDF result of the SPARQL queryRDFServiceExceptionpublic InputStream sparqlSelectQuery(String queryStr, RDFService.ResultFormat resultFormat) throws RDFServiceException
sparqlSelectQuery in interface RDFServicequeryStr - - the SPARQL query to be executed against the RDF storeresultFormat - - format for the result of the Select queryRDFServiceExceptionpublic void sparqlSelectQuery(String queryStr, ResultSetConsumer consumer) throws RDFServiceException
RDFServicesparqlSelectQuery in interface RDFServicequeryStr - - the SPARQL query to be executed against the RDF storeconsumer - - the class to consume the results of the queryRDFServiceExceptionpublic boolean sparqlAskQuery(String queryStr) throws RDFServiceException
sparqlAskQuery in interface RDFServicequeryStr - - the SPARQL query to be executed against the RDF storeRDFServiceExceptionpublic List<String> getGraphURIs() throws RDFServiceException
getGraphURIs in interface RDFServiceRDFServiceExceptionpublic void getGraphMetadata()
throws RDFServiceException
RDFServicegetGraphMetadata in interface RDFServiceRDFServiceExceptionpublic String getDefaultWriteGraphURI() throws RDFServiceException
getDefaultWriteGraphURI in interface RDFServicegetDefaultWriteGraphURI in class RDFServiceImplRDFServiceExceptionpublic void registerListener(ChangeListener changeListener) throws RDFServiceException
registerListener in interface RDFServiceregisterListener in class RDFServiceImplchangeListener - - the change listenerRDFServiceExceptionpublic void unregisterListener(ChangeListener changeListener) throws RDFServiceException
unregisterListener in interface RDFServiceunregisterListener in class RDFServiceImplchangeListener - - the change listenerRDFServiceExceptionpublic ChangeSet manufactureChangeSet()
manufactureChangeSet in interface RDFServicemanufactureChangeSet in class RDFServiceImplprotected String getReadEndpointURI()
protected String getUpdateEndpointURI()
protected void executeUpdate(String updateString) throws RDFServiceException
RDFServiceExceptionprotected boolean isPreconditionSatisfied(String query, RDFService.SPARQLQueryType queryType) throws RDFServiceException
isPreconditionSatisfied in class RDFServiceImplRDFServiceExceptionprotected boolean sparqlSelectQueryHasResults(String queryStr) throws RDFServiceException
sparqlSelectQueryHasResults in class RDFServiceImplRDFServiceExceptionpublic void serializeAll(OutputStream outputStream) throws RDFServiceException
RDFServiceserializeAll in interface RDFServiceoutputStream - - receives the serialized result.RDFServiceExceptionpublic void serializeGraph(String graphURI, OutputStream outputStream) throws RDFServiceException
RDFServiceserializeGraph in interface RDFServicegraphURI - - the URI of the desired graph. May not be null.outputStream - - receives the serialized result.RDFServiceExceptionpublic boolean isEquivalentGraph(String graphURI, InputStream serializedGraph, RDFService.ModelSerializationFormat serializationFormat) throws RDFServiceException
isEquivalentGraph in interface RDFServicegraphURI - - the URI of the graph to test against. May not be null.serializedGraph - - the contents to be compared with the existing graph. May not be null.serializationFormat - - May not be null.RDFServiceExceptionpublic boolean isEquivalentGraph(String graphURI, org.apache.jena.rdf.model.Model graph) throws RDFServiceException
isEquivalentGraph in interface RDFServicegraphURI - - the URI of the graph to test against. May not be null.graph - - the contents to be compared with the existing graph. May not be null.RDFServiceExceptionpublic boolean preferPreciseOptionals()
preferPreciseOptionals in interface RDFServiceprotected org.apache.http.protocol.HttpContext getContext(org.apache.http.client.methods.HttpRequestBase request)
protected org.apache.http.auth.UsernamePasswordCredentials getCredentials()
Copyright © 2021. All rights reserved.