public abstract class RDFServiceJena extends RDFServiceImpl implements RDFService
RDFService.ModelSerializationFormat, RDFService.ResultFormat, RDFService.SPARQLQueryType| Modifier and Type | Field and Description |
|---|---|
protected boolean |
rebuildGraphURICache |
BNODE_ROOT_QUERY, defaultWriteGraphURI, registeredJenaListeners, registeredListeners| Constructor and Description |
|---|
RDFServiceJena() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyChangeSetToModel(ChangeSet changeSet,
org.apache.jena.query.Dataset dataset) |
abstract boolean |
changeSetUpdate(ChangeSet changeSet)
Performs 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.
|
long |
countTriples(org.apache.jena.rdf.model.RDFNode subject,
org.apache.jena.rdf.model.RDFNode predicate,
org.apache.jena.rdf.model.RDFNode object) |
protected org.apache.jena.query.QueryExecution |
createQueryExecution(String queryString,
org.apache.jena.query.Query q,
org.apache.jena.query.Dataset d) |
protected abstract DatasetWrapper |
getDatasetWrapper() |
void |
getGraphMetadata()
To be determined.
|
List<String> |
getGraphURIs()
Returns a list of all the graph URIs in the RDF store.
|
org.apache.jena.rdf.model.Model |
getTriples(org.apache.jena.rdf.model.RDFNode subject,
org.apache.jena.rdf.model.RDFNode predicate,
org.apache.jena.rdf.model.RDFNode object,
long limit,
long offset) |
VitroRequest |
getVitroRequest() |
protected void |
insureThatInputStreamsAreResettable(ChangeSet changeSet) |
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 void |
notifyListenersOfPostChangeEvents(ChangeSet changeSet) |
protected void |
notifyListenersOfPreChangeEvents(ChangeSet changeSet) |
protected void |
operateOnModel(org.apache.jena.rdf.model.Model model,
ModelChange modelChange,
org.apache.jena.query.Dataset dataset) |
boolean |
preferPreciseOptionals() |
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.
|
void |
setVitroRequest(VitroRequest vitroRequest)
UQAM-Bug-Correction Useful among other things to transport the linguistic context in the service
|
boolean |
sparqlAskQuery(String query)
Performs a SPARQL ASK query against the knowledge base.
|
void |
sparqlConstructQuery(String query,
org.apache.jena.rdf.model.Model model)
Performs a SPARQL construct query against the knowledge base.
|
InputStream |
sparqlConstructQuery(String query,
RDFService.ModelSerializationFormat resultFormat)
Performs a SPARQL construct query against the knowledge base.
|
InputStream |
sparqlDescribeQuery(String query,
RDFService.ModelSerializationFormat resultFormat)
Performs a SPARQL describe query against the knowledge base.
|
InputStream |
sparqlSelectQuery(String query,
RDFService.ResultFormat resultFormat)
TODO Is there a way to accomplish this without buffering the entire result?
|
void |
sparqlSelectQuery(String query,
ResultSetConsumer consumer)
Performs a SPARQL select query against the knowledge base.
|
createQuery, getDefaultWriteGraphURI, getRegisteredJenaModelChangedListeners, getRegisteredListeners, getSerializationFormatString, isPreconditionSatisfied, manufactureChangeSet, newIndividual, newIndividual, notifyListeners, notifyListenersOfChanges, notifyListenersOfEvent, pyString, registerJenaModelChangedListener, registerListener, separateStatementsWithBlankNodes, sparqlNode, sparqlNodeUpdate, sparqlSelectQueryHasResults, sparqlTriple, toString, unregisterJenaModelChangedListener, unregisterListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDefaultWriteGraphURI, manufactureChangeSet, newIndividual, newIndividual, registerJenaModelChangedListener, registerListener, unregisterJenaModelChangedListener, unregisterListenerprotected abstract DatasetWrapper getDatasetWrapper()
public abstract boolean changeSetUpdate(ChangeSet changeSet) throws RDFServiceException
RDFServicechangeSetUpdate in interface RDFServicechangeSet - - a set of changes to be performed on the RDF store.RDFServiceExceptionprotected void notifyListenersOfPreChangeEvents(ChangeSet changeSet)
protected void insureThatInputStreamsAreResettable(ChangeSet changeSet) throws IOException
IOExceptionprotected void applyChangeSetToModel(ChangeSet changeSet, org.apache.jena.query.Dataset dataset)
protected void notifyListenersOfPostChangeEvents(ChangeSet changeSet)
protected void operateOnModel(org.apache.jena.rdf.model.Model model,
ModelChange modelChange,
org.apache.jena.query.Dataset dataset)
public InputStream sparqlConstructQuery(String query, RDFService.ModelSerializationFormat resultFormat) throws RDFServiceException
RDFServicesparqlConstructQuery in interface RDFServicequery - - the SPARQL query to be executed against the RDF storeresultFormat - - type of serialization for RDF result of the SPARQL queryRDFServiceExceptionpublic void sparqlConstructQuery(String query, org.apache.jena.rdf.model.Model model) throws RDFServiceException
RDFServicesparqlConstructQuery in interface RDFServicequery - - the SPARQL query to be executed against the RDF storemodel - - the Model to add the statements toRDFServiceExceptionpublic InputStream sparqlDescribeQuery(String query, RDFService.ModelSerializationFormat resultFormat) throws RDFServiceException
RDFServicesparqlDescribeQuery in interface RDFServicequery - - the SPARQL query to be executed against the RDF storeresultFormat - - type of serialization for RDF result of the SPARQL queryRDFServiceExceptionpublic InputStream sparqlSelectQuery(String query, RDFService.ResultFormat resultFormat) throws RDFServiceException
sparqlSelectQuery in interface RDFServicequery - - the SPARQL query to be executed against the RDF storeresultFormat - - format for the result of the Select queryRDFServiceExceptionpublic void sparqlSelectQuery(String query, ResultSetConsumer consumer) throws RDFServiceException
RDFServicesparqlSelectQuery in interface RDFServicequery - - the SPARQL query to be executed against the RDF storeconsumer - - the class to consume the results of the queryRDFServiceExceptionpublic boolean sparqlAskQuery(String query) throws RDFServiceException
RDFServicesparqlAskQuery in interface RDFServicequery - - the SPARQL ASK query to be executed against the RDF storeRDFServiceExceptionpublic List<String> getGraphURIs() throws RDFServiceException
RDFServicegetGraphURIs in interface RDFServiceRDFServiceExceptionpublic void getGraphMetadata()
throws RDFServiceException
RDFServicegetGraphMetadata in interface RDFServiceRDFServiceExceptionpublic 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 long countTriples(org.apache.jena.rdf.model.RDFNode subject,
org.apache.jena.rdf.model.RDFNode predicate,
org.apache.jena.rdf.model.RDFNode object)
throws RDFServiceException
countTriples in interface RDFServicecountTriples in class RDFServiceImplRDFServiceExceptionpublic org.apache.jena.rdf.model.Model getTriples(org.apache.jena.rdf.model.RDFNode subject,
org.apache.jena.rdf.model.RDFNode predicate,
org.apache.jena.rdf.model.RDFNode object,
long limit,
long offset)
throws RDFServiceException
getTriples in interface RDFServicegetTriples in class RDFServiceImplRDFServiceExceptionpublic boolean preferPreciseOptionals()
preferPreciseOptionals in interface RDFServicepublic void close()
RDFServiceclose in interface RDFServiceprotected org.apache.jena.query.QueryExecution createQueryExecution(String queryString, org.apache.jena.query.Query q, org.apache.jena.query.Dataset d)
public void setVitroRequest(VitroRequest vitroRequest)
RDFServicesetVitroRequest in interface RDFServicesetVitroRequest in class RDFServiceImplpublic VitroRequest getVitroRequest()
getVitroRequest in interface RDFServicegetVitroRequest in class RDFServiceImplCopyright © 2021. All rights reserved.