- java.lang.Object
-
- org.apache.jena.rdflink.RDFConnectionAdapter
-
- All Implemented Interfaces:
java.lang.AutoCloseable,RDFConnection,RDFDatasetAccessConnection,RDFDatasetConnection,SparqlQueryConnection,SparqlUpdateConnection,Transactional
- Direct Known Subclasses:
RDFConnectionFuseki.RDFConnectionFusekiImpl
public class RDFConnectionAdapter extends java.lang.Object implements RDFConnection
ProvideRDFConnectionusing aRDFLink
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
Transactional.Promote
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()static RDFConnectionadapt(RDFLink link)voidbegin(ReadWrite readWrite)voidbegin(TxnType type)voidclose()Close this connection.voidcommit()voiddelete()Remove all data from the default graph.voiddelete(java.lang.String graphName)Delete a graph from the dataset.voidend()Modelfetch()Fetch the default graph.Modelfetch(java.lang.String graphName)Fetch a named graph.DatasetfetchDataset()Fetch the contents of the datasetRDFLinkgetLink()Return theRDFLinkfor this connection.booleanisClosed()Test whether this connection is closed or notbooleanisInTransaction()voidload(java.lang.String file)Load (add, append) RDF into the default graph of a dataset.voidload(java.lang.String graphName, java.lang.String file)Load (add, append) RDF into a named graph in a dataset.voidload(java.lang.String graphName, Model model)Load (add, append) RDF into a named graph in a dataset.voidload(Model model)Load (add, append) RDF into the default graph of a dataset.voidloadDataset(java.lang.String file)voidloadDataset(Dataset dataset)QueryExecutionBuildernewQuery()Return a execution builder initialized with the RDFConnection setup.booleanpromote(Transactional.Promote mode)voidput(java.lang.String file)Set the contents of the default graph of a dataset.voidput(java.lang.String graphName, java.lang.String file)Set the contents of a named graph of a dataset.voidput(java.lang.String graphName, Model model)Set the contents of a named graph of a dataset.voidput(Model model)Set the contents of the default graph of a dataset.voidputDataset(java.lang.String file)voidputDataset(Dataset dataset)QueryExecutionquery(java.lang.String queryString)Setup a SPARQL query execution.QueryExecutionquery(Query query)Setup a SPARQL query execution.booleanqueryAsk(java.lang.String queryString)Execute a ASK query and return a booleanbooleanqueryAsk(Query query)Execute a ASK query and return a booleanModelqueryConstruct(java.lang.String queryString)Execute a CONSTRUCT query and return as a ModelModelqueryConstruct(Query query)Execute a CONSTRUCT query and return as a ModelModelqueryDescribe(java.lang.String queryString)Execute a DESCRIBE query and return as a ModelModelqueryDescribe(Query query)Execute a DESCRIBE query and return as a ModelvoidqueryResultSet(java.lang.String queryString, java.util.function.Consumer<ResultSet> resultSetAction)Execute a SELECT query and process the ResultSet with the handler code.voidqueryResultSet(Query query, java.util.function.Consumer<ResultSet> resultSetAction)Execute a SELECT query and process the ResultSet with the handler code.ReadWritetransactionMode()TxnTypetransactionType()voidupdate(java.lang.String update)Execute a SPARQL Update.voidupdate(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 Detail
-
adapt
public static RDFConnection adapt(RDFLink link)
-
queryResultSet
public void queryResultSet(java.lang.String queryString, java.util.function.Consumer<ResultSet> resultSetAction)Description copied from interface:RDFConnectionExecute a SELECT query and process the ResultSet with the handler code.- Specified by:
queryResultSetin interfaceRDFConnection- Specified by:
queryResultSetin interfaceSparqlQueryConnection
-
queryResultSet
public void queryResultSet(Query query, java.util.function.Consumer<ResultSet> resultSetAction)
Description copied from interface:RDFConnectionExecute a SELECT query and process the ResultSet with the handler code.- Specified by:
queryResultSetin interfaceRDFConnection- Specified by:
queryResultSetin interfaceSparqlQueryConnection
-
queryConstruct
public Model queryConstruct(java.lang.String queryString)
Description copied from interface:RDFConnectionExecute a CONSTRUCT query and return as a Model- Specified by:
queryConstructin interfaceRDFConnection- Specified by:
queryConstructin interfaceSparqlQueryConnection
-
queryConstruct
public Model queryConstruct(Query query)
Description copied from interface:RDFConnectionExecute a CONSTRUCT query and return as a Model- Specified by:
queryConstructin interfaceRDFConnection- Specified by:
queryConstructin interfaceSparqlQueryConnection
-
queryDescribe
public Model queryDescribe(java.lang.String queryString)
Description copied from interface:RDFConnectionExecute a DESCRIBE query and return as a Model- Specified by:
queryDescribein interfaceRDFConnection- Specified by:
queryDescribein interfaceSparqlQueryConnection
-
queryDescribe
public Model queryDescribe(Query query)
Description copied from interface:RDFConnectionExecute a DESCRIBE query and return as a Model- Specified by:
queryDescribein interfaceRDFConnection- Specified by:
queryDescribein interfaceSparqlQueryConnection
-
queryAsk
public boolean queryAsk(java.lang.String queryString)
Description copied from interface:RDFConnectionExecute a ASK query and return a boolean- Specified by:
queryAskin interfaceRDFConnection- Specified by:
queryAskin interfaceSparqlQueryConnection
-
queryAsk
public boolean queryAsk(Query query)
Description copied from interface:RDFConnectionExecute a ASK query and return a boolean- Specified by:
queryAskin interfaceRDFConnection- Specified by:
queryAskin interfaceSparqlQueryConnection
-
query
public QueryExecution query(Query query)
Description copied from interface:RDFConnectionSetup 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:
queryin interfaceRDFConnection- Specified by:
queryin interfaceSparqlQueryConnection- Returns:
- QueryExecution
-
query
public QueryExecution query(java.lang.String queryString)
Description copied from interface:RDFConnectionSetup a SPARQL query execution. This is a low-level operation. Handling theQueryExecutionshould 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:
queryin interfaceRDFConnection- Specified by:
queryin interfaceSparqlQueryConnection- Returns:
- QueryExecution
-
newQuery
public QueryExecutionBuilder newQuery()
Description copied from interface:RDFConnectionReturn a execution builder initialized with the RDFConnection setup.- Specified by:
newQueryin interfaceRDFConnection- Specified by:
newQueryin interfaceSparqlQueryConnection- Returns:
- QueryExecutionBuilderCommon
-
update
public void update(UpdateRequest update)
Description copied from interface:RDFConnectionExecute a SPARQL Update.- Specified by:
updatein interfaceRDFConnection- Specified by:
updatein interfaceSparqlUpdateConnection
-
update
public void update(java.lang.String update)
Description copied from interface:RDFConnectionExecute a SPARQL Update.- Specified by:
updatein interfaceRDFConnection- Specified by:
updatein interfaceSparqlUpdateConnection
-
fetch
public Model fetch()
Description copied from interface:RDFConnectionFetch the default graph. This is SPARQL Graph Store Protocol HTTP GET or equivalent.- Specified by:
fetchin interfaceRDFConnection- Specified by:
fetchin interfaceRDFDatasetAccessConnection- Returns:
- Model
-
fetch
public Model fetch(java.lang.String graphName)
Description copied from interface:RDFConnectionFetch a named graph. This is SPARQL Graph Store Protocol HTTP GET or equivalent.- Specified by:
fetchin interfaceRDFConnection- Specified by:
fetchin interfaceRDFDatasetAccessConnection- Parameters:
graphName- URI string for the graph name (null or "default" for the default graph)- Returns:
- Model
-
load
public void load(java.lang.String graphName, java.lang.String file)Description copied from interface:RDFConnectionLoad (add, append) RDF into a named graph in a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.- Specified by:
loadin interfaceRDFConnection- Specified by:
loadin interfaceRDFDatasetConnection- Parameters:
graphName- Graph name (null or "default" for the default graph)file- File of the data.
-
load
public void load(java.lang.String file)
Description copied from interface:RDFConnectionLoad (add, append) RDF into the default graph of a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.- Specified by:
loadin interfaceRDFConnection- Specified by:
loadin interfaceRDFDatasetConnection- Parameters:
file- File of the data.
-
load
public void load(java.lang.String graphName, Model model)Description copied from interface:RDFConnectionLoad (add, append) RDF into a named graph in a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.- Specified by:
loadin interfaceRDFConnection- Specified by:
loadin interfaceRDFDatasetConnection- Parameters:
graphName- Graph name (null or "default" for the default graph)model- Data.
-
load
public void load(Model model)
Description copied from interface:RDFConnectionLoad (add, append) RDF into the default graph of a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.- Specified by:
loadin interfaceRDFConnection- Specified by:
loadin interfaceRDFDatasetConnection- Parameters:
model- Data.
-
put
public void put(java.lang.String graphName, java.lang.String file)Description copied from interface:RDFConnectionSet 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:
putin interfaceRDFConnection- Specified by:
putin interfaceRDFDatasetConnection- Parameters:
graphName- Graph name (null or "default" for the default graph)file- File of the data.
-
put
public void put(java.lang.String file)
Description copied from interface:RDFConnectionSet 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:
putin interfaceRDFConnection- Specified by:
putin interfaceRDFDatasetConnection- Parameters:
file- File of the data.
-
put
public void put(java.lang.String graphName, Model model)Description copied from interface:RDFConnectionSet 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:
putin interfaceRDFConnection- Specified by:
putin interfaceRDFDatasetConnection- Parameters:
graphName- Graph name (null or "default" for the default graph)model- Data.
-
put
public void put(Model model)
Description copied from interface:RDFConnectionSet 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:
putin interfaceRDFConnection- Specified by:
putin interfaceRDFDatasetConnection- Parameters:
model- Data.
-
delete
public void delete(java.lang.String graphName)
Description copied from interface:RDFConnectionDelete a graph from the dataset. Null or "default" means the default graph, which is cleared, not removed.- Specified by:
deletein interfaceRDFConnection- Specified by:
deletein interfaceRDFDatasetConnection
-
delete
public void delete()
Description copied from interface:RDFConnectionRemove all data from the default graph.- Specified by:
deletein interfaceRDFConnection- Specified by:
deletein interfaceRDFDatasetConnection
-
fetchDataset
public Dataset fetchDataset()
Description copied from interface:RDFConnectionFetch the contents of the dataset- Specified by:
fetchDatasetin interfaceRDFConnection- Specified by:
fetchDatasetin interfaceRDFDatasetAccessConnection
-
loadDataset
public void loadDataset(java.lang.String file)
- Specified by:
loadDatasetin interfaceRDFConnection- Specified by:
loadDatasetin interfaceRDFDatasetConnection
-
loadDataset
public void loadDataset(Dataset dataset)
- Specified by:
loadDatasetin interfaceRDFConnection- Specified by:
loadDatasetin interfaceRDFDatasetConnection
-
putDataset
public void putDataset(java.lang.String file)
- Specified by:
putDatasetin interfaceRDFConnection- Specified by:
putDatasetin interfaceRDFDatasetConnection
-
putDataset
public void putDataset(Dataset dataset)
- Specified by:
putDatasetin interfaceRDFConnection- Specified by:
putDatasetin interfaceRDFDatasetConnection
-
isClosed
public boolean isClosed()
Description copied from interface:RDFConnectionTest whether this connection is closed or not- Specified by:
isClosedin interfaceRDFConnection- Specified by:
isClosedin interfaceRDFDatasetAccessConnection- Specified by:
isClosedin interfaceRDFDatasetConnection
-
close
public void close()
Description copied from interface:RDFConnectionClose this connection. Use with try-resource.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceRDFConnection- Specified by:
closein interfaceRDFDatasetAccessConnection- Specified by:
closein interfaceRDFDatasetConnection- Specified by:
closein interfaceSparqlQueryConnection- Specified by:
closein interfaceSparqlUpdateConnection
-
begin
public void begin(TxnType type)
- Specified by:
beginin interfaceTransactional
-
begin
public void begin(ReadWrite readWrite)
- Specified by:
beginin interfaceTransactional
-
promote
public boolean promote(Transactional.Promote mode)
- Specified by:
promotein interfaceTransactional
-
commit
public void commit()
- Specified by:
commitin interfaceTransactional
-
abort
public void abort()
- Specified by:
abortin interfaceTransactional
-
end
public void end()
- Specified by:
endin interfaceTransactional
-
transactionMode
public ReadWrite transactionMode()
- Specified by:
transactionModein interfaceTransactional
-
transactionType
public TxnType transactionType()
- Specified by:
transactionTypein interfaceTransactional
-
isInTransaction
public boolean isInTransaction()
- Specified by:
isInTransactionin interfaceTransactional
-
-