java.lang.Object
org.apache.jena.rdflink.RDFConnectionAdapter
- All Implemented Interfaces:
AutoCloseable
,RDFConnection
,RDFDatasetAccessConnection
,RDFDatasetConnection
,SparqlQueryConnection
,SparqlUpdateConnection
,org.apache.jena.sparql.core.Transactional
- Direct Known Subclasses:
RDFConnectionFuseki.RDFConnectionFusekiImpl
Provide
RDFConnection
using a RDFLink
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
org.apache.jena.sparql.core.Transactional.Promote
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
static RDFConnection
void
begin
(org.apache.jena.query.ReadWrite readWrite) void
begin
(org.apache.jena.query.TxnType type) void
close()
Close this connection.void
commit()
void
delete()
Remove all data from the default graph.void
Delete a graph from the dataset.void
end()
org.apache.jena.rdf.model.Model
fetch()
Fetch the default graph.org.apache.jena.rdf.model.Model
Fetch a named graph.org.apache.jena.query.Dataset
Fetch the contents of the datasetgetLink()
Return theRDFLink
for this connection.boolean
isClosed()
Test whether this connection is closed or notboolean
void
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 (add, append) RDF into a named graph in a dataset.void
load
(org.apache.jena.rdf.model.Model model) Load (add, append) RDF into the default graph of a dataset.void
loadDataset
(String file) void
loadDataset
(org.apache.jena.query.Dataset dataset) org.apache.jena.query.QueryExecutionBuilder
newQuery()
Return a execution builder initialized with the RDFConnection setup.org.apache.jena.update.UpdateExecutionBuilder
Return aUpdateExecutionBuilder
that is initially configured for this link setup and type.boolean
promote
(org.apache.jena.sparql.core.Transactional.Promote mode) void
Set the contents of the default graph of a dataset.void
Set the contents of a named graph of a dataset.void
Set the contents of a named graph of a dataset.void
put
(org.apache.jena.rdf.model.Model model) Set the contents of the default graph of a dataset.void
putDataset
(String file) void
putDataset
(org.apache.jena.query.Dataset dataset) org.apache.jena.query.QueryExecution
Setup a SPARQL query execution.org.apache.jena.query.QueryExecution
query
(org.apache.jena.query.Query query) Setup a SPARQL query execution.boolean
Execute a ASK query and return a booleanboolean
queryAsk
(org.apache.jena.query.Query query) Execute a ASK query and return a booleanorg.apache.jena.rdf.model.Model
queryConstruct
(String queryString) Execute a CONSTRUCT query and return as a Modelorg.apache.jena.rdf.model.Model
queryConstruct
(org.apache.jena.query.Query query) Execute a CONSTRUCT query and return as a Modelorg.apache.jena.rdf.model.Model
queryDescribe
(String queryString) Execute a DESCRIBE query and return as a Modelorg.apache.jena.rdf.model.Model
queryDescribe
(org.apache.jena.query.Query query) Execute a DESCRIBE query and return as a Modelvoid
queryResultSet
(String queryString, Consumer<org.apache.jena.query.ResultSet> resultSetAction) Execute a SELECT query and process the ResultSet with the handler code.void
queryResultSet
(org.apache.jena.query.Query query, Consumer<org.apache.jena.query.ResultSet> resultSetAction) Execute a SELECT query and process the ResultSet with the handler code.org.apache.jena.query.ReadWrite
org.apache.jena.query.TxnType
void
Execute a SPARQL Update.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.rdfconnection.RDFConnection
querySelect, querySelect, update
Methods inherited from interface org.apache.jena.sparql.core.Transactional
begin, calc, calculate, calculateRead, calculateWrite, exec, execute, executeRead, executeWrite, promote
-
Method Details
-
adapt
-
getLink
Return theRDFLink
for this connection. -
queryResultSet
public void queryResultSet(String queryString, Consumer<org.apache.jena.query.ResultSet> resultSetAction) Description copied from interface:RDFConnection
Execute a SELECT query and process the ResultSet with the handler code.- Specified by:
queryResultSet
in interfaceRDFConnection
- Specified by:
queryResultSet
in interfaceSparqlQueryConnection
-
queryResultSet
public void queryResultSet(org.apache.jena.query.Query query, Consumer<org.apache.jena.query.ResultSet> resultSetAction) Description copied from interface:RDFConnection
Execute a SELECT query and process the ResultSet with the handler code.- Specified by:
queryResultSet
in interfaceRDFConnection
- Specified by:
queryResultSet
in interfaceSparqlQueryConnection
-
queryConstruct
Description copied from interface:RDFConnection
Execute a CONSTRUCT query and return as a Model- Specified by:
queryConstruct
in interfaceRDFConnection
- Specified by:
queryConstruct
in interfaceSparqlQueryConnection
-
queryConstruct
public org.apache.jena.rdf.model.Model queryConstruct(org.apache.jena.query.Query query) Description copied from interface:RDFConnection
Execute a CONSTRUCT query and return as a Model- Specified by:
queryConstruct
in interfaceRDFConnection
- Specified by:
queryConstruct
in interfaceSparqlQueryConnection
-
queryDescribe
Description copied from interface:RDFConnection
Execute a DESCRIBE query and return as a Model- Specified by:
queryDescribe
in interfaceRDFConnection
- Specified by:
queryDescribe
in interfaceSparqlQueryConnection
-
queryDescribe
public org.apache.jena.rdf.model.Model queryDescribe(org.apache.jena.query.Query query) Description copied from interface:RDFConnection
Execute a DESCRIBE query and return as a Model- Specified by:
queryDescribe
in interfaceRDFConnection
- Specified by:
queryDescribe
in interfaceSparqlQueryConnection
-
queryAsk
Description copied from interface:RDFConnection
Execute a ASK query and return a boolean- Specified by:
queryAsk
in interfaceRDFConnection
- Specified by:
queryAsk
in interfaceSparqlQueryConnection
-
queryAsk
public boolean queryAsk(org.apache.jena.query.Query query) Description copied from interface:RDFConnection
Execute a ASK query and return a boolean- Specified by:
queryAsk
in interfaceRDFConnection
- Specified by:
queryAsk
in interfaceSparqlQueryConnection
-
query
public org.apache.jena.query.QueryExecution query(org.apache.jena.query.Query query) Description copied from interface:RDFConnection
Setup a SPARQL query execution. See alsoRDFConnection.querySelect(Query, Consumer)
,RDFConnection.queryConstruct(Query)
,RDFConnection.queryDescribe(Query)
,RDFConnection.queryAsk(Query)
for ways to execute queries for of a specific form.- Specified by:
query
in interfaceRDFConnection
- Specified by:
query
in interfaceSparqlQueryConnection
- Returns:
- QueryExecution
-
query
Description copied from interface:RDFConnection
Setup a SPARQL query execution. This is a low-level operation. Handling theQueryExecution
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 alsoRDFConnection.querySelect(String, Consumer)
,RDFConnection.queryConstruct(String)
,RDFConnection.queryDescribe(String)
,RDFConnection.queryAsk(String)
for ways to execute queries of a specific form.- Specified by:
query
in interfaceRDFConnection
- Specified by:
query
in interfaceSparqlQueryConnection
- Returns:
- QueryExecution
-
newQuery
public org.apache.jena.query.QueryExecutionBuilder newQuery()Description copied from interface:RDFConnection
Return a execution builder initialized with the RDFConnection setup.- Specified by:
newQuery
in interfaceRDFConnection
- Specified by:
newQuery
in interfaceSparqlQueryConnection
- Returns:
- QueryExecutionBuilderCommon
-
newUpdate
public org.apache.jena.update.UpdateExecutionBuilder newUpdate()Description copied from interface:RDFConnection
Return aUpdateExecutionBuilder
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 interfaceRDFConnection
- Specified by:
newUpdate
in interfaceSparqlUpdateConnection
- Returns:
- UpdateExecBuilder
-
update
public void update(org.apache.jena.update.UpdateRequest update) Description copied from interface:RDFConnection
Execute a SPARQL Update.- Specified by:
update
in interfaceRDFConnection
- Specified by:
update
in interfaceSparqlUpdateConnection
-
update
Description copied from interface:RDFConnection
Execute a SPARQL Update.- Specified by:
update
in interfaceRDFConnection
- Specified by:
update
in interfaceSparqlUpdateConnection
-
fetch
public org.apache.jena.rdf.model.Model fetch()Description copied from interface:RDFConnection
Fetch the default graph. This is SPARQL Graph Store Protocol HTTP GET or equivalent.- Specified by:
fetch
in interfaceRDFConnection
- Specified by:
fetch
in interfaceRDFDatasetAccessConnection
- Returns:
- Model
-
fetch
Description copied from interface:RDFConnection
Fetch a named graph. This is SPARQL Graph Store Protocol HTTP GET or equivalent.- Specified by:
fetch
in interfaceRDFConnection
- Specified by:
fetch
in interfaceRDFDatasetAccessConnection
- Parameters:
graphName
- URI string for the graph name (null or "default" for the default graph)- Returns:
- Model
-
load
Description copied from interface:RDFConnection
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 interfaceRDFConnection
- Specified by:
load
in interfaceRDFDatasetConnection
- Parameters:
graphName
- Graph name (null or "default" for the default graph)file
- File of the data.
-
load
Description copied from interface:RDFConnection
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 interfaceRDFConnection
- Specified by:
load
in interfaceRDFDatasetConnection
- Parameters:
file
- File of the data.
-
load
Description copied from interface:RDFConnection
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 interfaceRDFConnection
- Specified by:
load
in interfaceRDFDatasetConnection
- Parameters:
graphName
- Graph name (null or "default" for the default graph)model
- Data.
-
load
public void load(org.apache.jena.rdf.model.Model model) Description copied from interface:RDFConnection
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 interfaceRDFConnection
- Specified by:
load
in interfaceRDFDatasetConnection
- Parameters:
model
- Data.
-
put
Description copied from interface:RDFConnection
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 interfaceRDFConnection
- Specified by:
put
in interfaceRDFDatasetConnection
- Parameters:
graphName
- Graph name (null or "default" for the default graph)file
- File of the data.
-
put
Description copied from interface:RDFConnection
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.- Specified by:
put
in interfaceRDFConnection
- Specified by:
put
in interfaceRDFDatasetConnection
- Parameters:
file
- File of the data.
-
put
Description copied from interface:RDFConnection
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 interfaceRDFConnection
- Specified by:
put
in interfaceRDFDatasetConnection
- Parameters:
graphName
- Graph name (null or "default" for the default graph)model
- Data.
-
put
public void put(org.apache.jena.rdf.model.Model model) Description copied from interface:RDFConnection
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.- Specified by:
put
in interfaceRDFConnection
- Specified by:
put
in interfaceRDFDatasetConnection
- Parameters:
model
- Data.
-
delete
Description copied from interface:RDFConnection
Delete a graph from the dataset. Null or "default" means the default graph, which is cleared, not removed.- Specified by:
delete
in interfaceRDFConnection
- Specified by:
delete
in interfaceRDFDatasetConnection
-
delete
public void delete()Description copied from interface:RDFConnection
Remove all data from the default graph.- Specified by:
delete
in interfaceRDFConnection
- Specified by:
delete
in interfaceRDFDatasetConnection
-
fetchDataset
public org.apache.jena.query.Dataset fetchDataset()Description copied from interface:RDFConnection
Fetch the contents of the dataset- Specified by:
fetchDataset
in interfaceRDFConnection
- Specified by:
fetchDataset
in interfaceRDFDatasetAccessConnection
-
loadDataset
- Specified by:
loadDataset
in interfaceRDFConnection
- Specified by:
loadDataset
in interfaceRDFDatasetConnection
-
loadDataset
public void loadDataset(org.apache.jena.query.Dataset dataset) - Specified by:
loadDataset
in interfaceRDFConnection
- Specified by:
loadDataset
in interfaceRDFDatasetConnection
-
putDataset
- Specified by:
putDataset
in interfaceRDFConnection
- Specified by:
putDataset
in interfaceRDFDatasetConnection
-
putDataset
public void putDataset(org.apache.jena.query.Dataset dataset) - Specified by:
putDataset
in interfaceRDFConnection
- Specified by:
putDataset
in interfaceRDFDatasetConnection
-
isClosed
public boolean isClosed()Description copied from interface:RDFConnection
Test whether this connection is closed or not- Specified by:
isClosed
in interfaceRDFConnection
- Specified by:
isClosed
in interfaceRDFDatasetAccessConnection
- Specified by:
isClosed
in interfaceRDFDatasetConnection
-
close
public void close()Description copied from interface:RDFConnection
Close this connection. Use with try-resource.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceRDFConnection
- Specified by:
close
in interfaceRDFDatasetAccessConnection
- Specified by:
close
in interfaceRDFDatasetConnection
- Specified by:
close
in interfaceSparqlQueryConnection
- Specified by:
close
in interfaceSparqlUpdateConnection
-
begin
public void begin(org.apache.jena.query.TxnType type) - Specified by:
begin
in interfaceorg.apache.jena.sparql.core.Transactional
-
begin
public void begin(org.apache.jena.query.ReadWrite readWrite) - Specified by:
begin
in interfaceorg.apache.jena.sparql.core.Transactional
-
promote
public boolean promote(org.apache.jena.sparql.core.Transactional.Promote mode) - 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
-
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
-
isInTransaction
public boolean isInTransaction()- Specified by:
isInTransaction
in interfaceorg.apache.jena.sparql.core.Transactional
-