java.lang.Object
org.apache.jena.rdflink.RDFLinkModular
- All Implemented Interfaces:
AutoCloseable
,LinkDatasetGraph
,LinkDatasetGraphAccess
,LinkSparqlQuery
,LinkSparqlUpdate
,RDFLink
,org.apache.jena.sparql.core.Transactional
Implementation of
RDFLink
where the query, update and graph store
operations are given by specific implementations of the respective interfaces.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
org.apache.jena.sparql.core.Transactional.Promote
-
Constructor Summary
ConstructorDescriptionRDFLinkModular
(LinkSparqlQuery queryConnection, LinkSparqlUpdate updateConnection, LinkDatasetGraph datasetConnection) -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
void
begin()
void
begin
(org.apache.jena.query.ReadWrite mode) void
begin
(org.apache.jena.query.TxnType txnType) void
Clear the dataset - remove all named graphs, clear the default graph.void
close()
Close this connection.void
commit()
void
delete()
Remove all data from the default graph.void
delete
(org.apache.jena.graph.Node graphName) Delete a graph from the dataset.void
end()
org.apache.jena.graph.Graph
get()
Fetch the default graph.org.apache.jena.graph.Graph
get
(org.apache.jena.graph.Node graphName) Fetch a named graph.org.apache.jena.sparql.core.DatasetGraph
Fetch the contents of the datasetboolean
isClosed()
Test whether this connection is closed or notboolean
void
Send file - this merges the file RDF into the default graph of a dataset.void
load
(org.apache.jena.graph.Graph Graph) Load (add, append) RDF into the default graph of a dataset.void
Load (add, append) RDF into a named graph in a dataset.void
load
(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph Graph) Load (add, append) RDF into a named graph in a dataset.void
loadDataset
(String file) void
loadDataset
(org.apache.jena.sparql.core.DatasetGraph dataset) org.apache.jena.sparql.exec.QueryExecBuilder
newQuery()
Return aQueryExecBuilder
that is initially configured for this link setup and type.org.apache.jena.sparql.exec.UpdateExecBuilder
Return aUpdateExecBuilder
that is initially configured for this link setup and type.boolean
promote
(org.apache.jena.sparql.core.Transactional.Promote promote) void
Set the contents of the default graph of a dataset.void
put
(org.apache.jena.graph.Graph Graph) Set the contents of the default graph of a dataset.void
Set the contents of a named graph of a dataset.void
put
(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph Graph) Set the contents of a named graph of a dataset.void
putDataset
(String file) void
putDataset
(org.apache.jena.sparql.core.DatasetGraph dataset) org.apache.jena.sparql.exec.QueryExec
Setup a SPARQL query execution.org.apache.jena.sparql.exec.QueryExec
query
(org.apache.jena.query.Query query) Setup a SPARQL query execution.org.apache.jena.query.ReadWrite
org.apache.jena.query.TxnType
void
update
(org.apache.jena.update.UpdateRequest update) Execute a SPARQL Update.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jena.rdflink.RDFLink
isRemote, queryAsk, queryAsk, queryConstruct, queryConstruct, queryConstructDataset, queryConstructDataset, queryDescribe, queryDescribe, queryRowSet, queryRowSet, querySelect, querySelect, update, update
Methods inherited from interface org.apache.jena.sparql.core.Transactional
calc, calculate, calculateRead, calculateWrite, exec, execute, executeRead, executeWrite, promote
-
Constructor Details
-
RDFLinkModular
public RDFLinkModular(LinkSparqlQuery queryConnection, LinkSparqlUpdate updateConnection, LinkDatasetGraph datasetConnection)
-
-
Method Details
-
begin
public void begin()- Specified by:
begin
in interfaceorg.apache.jena.sparql.core.Transactional
-
begin
public void begin(org.apache.jena.query.TxnType txnType) - Specified by:
begin
in interfaceorg.apache.jena.sparql.core.Transactional
-
begin
public void begin(org.apache.jena.query.ReadWrite mode) - Specified by:
begin
in interfaceorg.apache.jena.sparql.core.Transactional
-
promote
public boolean promote(org.apache.jena.sparql.core.Transactional.Promote promote) - Specified by:
promote
in interfaceorg.apache.jena.sparql.core.Transactional
-
commit
public void commit()- Specified by:
commit
in interfaceorg.apache.jena.sparql.core.Transactional
-
abort
public void abort()- Specified by:
abort
in interfaceorg.apache.jena.sparql.core.Transactional
-
isInTransaction
public boolean isInTransaction()- Specified by:
isInTransaction
in interfaceorg.apache.jena.sparql.core.Transactional
-
end
public void end()- Specified by:
end
in interfaceorg.apache.jena.sparql.core.Transactional
-
transactionMode
public org.apache.jena.query.ReadWrite transactionMode()- Specified by:
transactionMode
in interfaceorg.apache.jena.sparql.core.Transactional
-
transactionType
public org.apache.jena.query.TxnType transactionType()- Specified by:
transactionType
in interfaceorg.apache.jena.sparql.core.Transactional
-
queryLink
-
updateLink
-
datasetLink
-
query
public org.apache.jena.sparql.exec.QueryExec query(org.apache.jena.query.Query query) Description copied from interface:RDFLink
Setup a SPARQL query execution. See alsoRDFLink.querySelect(Query, Consumer)
,RDFLink.queryConstruct(Query)
,RDFLink.queryDescribe(Query)
,RDFLink.queryAsk(Query)
for ways to execute queries for of a specific form.- Specified by:
query
in interfaceLinkSparqlQuery
- Specified by:
query
in interfaceRDFLink
- Returns:
- QueryExecution
-
query
Description copied from interface:RDFLink
Setup a SPARQL query execution.This is a low-level operation. Handling the
QueryExecution
should be done with try-resource. SomeQueryExecutions
, such as ones connecting to a remote server, need to be properly closed to release system resources.See also
RDFLink.querySelect(String, Consumer)
,RDFLink.queryConstruct(String)
,RDFLink.queryDescribe(String)
,RDFLink.queryAsk(String)
for ways to execute queries of a specific form.- Specified by:
query
in interfaceLinkSparqlQuery
- Specified by:
query
in interfaceRDFLink
- Returns:
- QueryExecution
-
newQuery
public org.apache.jena.sparql.exec.QueryExecBuilder newQuery()Description copied from interface:RDFLink
Return aQueryExecBuilder
that is initially configured for this link setup and type. The query built will be set to go to the same dataset/remote endpoint as the other RDFLink operations.- Specified by:
newQuery
in interfaceLinkSparqlQuery
- Specified by:
newQuery
in interfaceRDFLink
- Returns:
- QueryExecBuilder
-
newUpdate
public org.apache.jena.sparql.exec.UpdateExecBuilder newUpdate()Description copied from interface:RDFLink
Return aUpdateExecBuilder
that is initially configured for this link setup and type. The update built will be set to go to the same dataset/remote endpoint as the other RDFLink operations.- Specified by:
newUpdate
in interfaceLinkSparqlUpdate
- Specified by:
newUpdate
in interfaceRDFLink
- Returns:
- UpdateExecBuilder
-
update
public void update(org.apache.jena.update.UpdateRequest update) Description copied from interface:RDFLink
Execute a SPARQL Update.- Specified by:
update
in interfaceLinkSparqlUpdate
- Specified by:
update
in interfaceRDFLink
-
load
Description copied from interface:RDFLink
Load (add, append) RDF into a named graph in a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.If this is a remote connection:
- The file is sent as-is and not parsed in the RDFLink
- The Content-Type is determined by the filename
- Specified by:
load
in interfaceLinkDatasetGraph
- Specified by:
load
in interfaceRDFLink
- Parameters:
graphName
- Graph name (null orQuad.defaultGraphIRI
for the default graph)file
- File of the data.
-
load
Description copied from interface:RDFLink
Send file - this merges the file RDF into the default graph of a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.If this is a remote connection:
- The file is sent as-is and not parsed in the RDFLink
- The Content-Type is determined by the filename
- Specified by:
load
in interfaceLinkDatasetGraph
- Specified by:
load
in interfaceRDFLink
- Parameters:
file
- File of the data.
-
load
public void load(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph Graph) Description copied from interface:RDFLink
Load (add, append) RDF into a named graph in a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.- Specified by:
load
in interfaceLinkDatasetGraph
- Specified by:
load
in interfaceRDFLink
- Parameters:
graphName
- Graph name (null orQuad.defaultGraphIRI
for the default graph)Graph
- Data.
-
load
public void load(org.apache.jena.graph.Graph Graph) Description copied from interface:RDFLink
Load (add, append) RDF into the default graph of a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.- Specified by:
load
in interfaceLinkDatasetGraph
- Specified by:
load
in interfaceRDFLink
- Parameters:
Graph
- Data.
-
put
Description copied from interface:RDFLink
Set the contents of a named graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.- Specified by:
put
in interfaceLinkDatasetGraph
- Specified by:
put
in interfaceRDFLink
- Parameters:
graphName
- Graph name (null orQuad.defaultGraphIRI
for the default graph)file
- File of the data.
-
put
Description copied from interface:RDFLink
Set the contents of the default graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.If this is a remote connection:
- The file is sent as-is and not parsed in the RDFLink
- The Content-Type is determined by the filename
- Specified by:
put
in interfaceLinkDatasetGraph
- Specified by:
put
in interfaceRDFLink
- Parameters:
file
- File of the data.
-
put
public void put(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph Graph) Description copied from interface:RDFLink
Set the contents of a named graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.- Specified by:
put
in interfaceLinkDatasetGraph
- Specified by:
put
in interfaceRDFLink
- Parameters:
graphName
- Graph name (null orQuad.defaultGraphIRI
for the default graph)Graph
- Data.
-
put
public void put(org.apache.jena.graph.Graph Graph) Description copied from interface:RDFLink
Set the contents of the default graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.If this is a remote connection:
- The file is sent as-is and not parsed in the RDFLink
- The Content-Type is determined by the filename
- Specified by:
put
in interfaceLinkDatasetGraph
- Specified by:
put
in interfaceRDFLink
- Parameters:
Graph
- Data.
-
delete
public void delete(org.apache.jena.graph.Node graphName) Description copied from interface:RDFLink
Delete a graph from the dataset. Null orQuad.defaultGraphIRI
means the default graph, which is cleared, not removed.- Specified by:
delete
in interfaceLinkDatasetGraph
- Specified by:
delete
in interfaceRDFLink
-
delete
public void delete()Description copied from interface:RDFLink
Remove all data from the default graph.- Specified by:
delete
in interfaceLinkDatasetGraph
- Specified by:
delete
in interfaceRDFLink
-
loadDataset
- Specified by:
loadDataset
in interfaceLinkDatasetGraph
- Specified by:
loadDataset
in interfaceRDFLink
-
loadDataset
public void loadDataset(org.apache.jena.sparql.core.DatasetGraph dataset) - Specified by:
loadDataset
in interfaceLinkDatasetGraph
- Specified by:
loadDataset
in interfaceRDFLink
-
putDataset
- Specified by:
putDataset
in interfaceLinkDatasetGraph
- Specified by:
putDataset
in interfaceRDFLink
-
putDataset
public void putDataset(org.apache.jena.sparql.core.DatasetGraph dataset) - Specified by:
putDataset
in interfaceLinkDatasetGraph
- Specified by:
putDataset
in interfaceRDFLink
-
get
public org.apache.jena.graph.Graph get(org.apache.jena.graph.Node graphName) Description copied from interface:RDFLink
Fetch a named graph. This is SPARQL Graph Store Protocol HTTP GET or equivalent.- Specified by:
get
in interfaceLinkDatasetGraphAccess
- Specified by:
get
in interfaceRDFLink
- Parameters:
graphName
- URI string for the graph name (null orQuad.defaultGraphIRI
for the default graph)- Returns:
- Graph
-
get
public org.apache.jena.graph.Graph get()Description copied from interface:RDFLink
Fetch the default graph. This is SPARQL Graph Store Protocol HTTP GET or equivalent.- Specified by:
get
in interfaceLinkDatasetGraphAccess
- Specified by:
get
in interfaceRDFLink
- Returns:
- Graph
-
getDataset
public org.apache.jena.sparql.core.DatasetGraph getDataset()Description copied from interface:LinkDatasetGraphAccess
Fetch the contents of the dataset- Specified by:
getDataset
in interfaceLinkDatasetGraphAccess
-
clearDataset
public void clearDataset()Description copied from interface:RDFLink
Clear the dataset - remove all named graphs, clear the default graph.- Specified by:
clearDataset
in interfaceLinkDatasetGraph
- Specified by:
clearDataset
in interfaceRDFLink
-
isClosed
public boolean isClosed()Description copied from interface:RDFLink
Test whether this connection is closed or not- Specified by:
isClosed
in interfaceLinkDatasetGraph
- Specified by:
isClosed
in interfaceLinkDatasetGraphAccess
- Specified by:
isClosed
in interfaceRDFLink
-
close
public void close()Close this connection.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceLinkDatasetGraph
- Specified by:
close
in interfaceLinkDatasetGraphAccess
- Specified by:
close
in interfaceLinkSparqlQuery
- Specified by:
close
in interfaceLinkSparqlUpdate
- Specified by:
close
in interfaceRDFLink
-