Package org.apache.jena.rdfconnection
Class RDFConnectionRemote
- java.lang.Object
-
- org.apache.jena.rdfconnection.RDFConnectionRemote
-
- All Implemented Interfaces:
java.lang.AutoCloseable,RDFConnection,RDFDatasetAccessConnection,RDFDatasetConnection,SparqlQueryConnection,SparqlUpdateConnection,Transactional
- Direct Known Subclasses:
RDFConnectionFuseki
public class RDFConnectionRemote extends java.lang.Object implements RDFConnection
Implementation of theRDFConnectioninterface using remote SPARQL operations.
-
-
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()voidbegin()voidbegin(ReadWrite mode)voidbegin(TxnType txnType)voidclose()Close this connection.voidcommit()static RDFConnectionRemoteBuildercreate()Create aRDFConnectionRemoteBuilder.static RDFConnectionRemoteBuildercreate(RDFConnectionRemote base)Create aRDFConnectionRemoteBuilderinitialized with the settings of anotherRDFConnectionRemote.voiddelete()Remove all data from the default graph.voiddelete(java.lang.String graph)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 datasetjava.lang.StringgetDestination()Return the destination URL for the connection.org.apache.http.client.HttpClientgetHttpClient()Return theHttpClientin-use.org.apache.http.protocol.HttpContextgetHttpContext()Return theHttpContextin-use.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 graph, 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)booleanpromote(Transactional.Promote promote)voidput(java.lang.String file)Set the contents of the default graph of a dataset.voidput(java.lang.String graph, 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 booleanModelqueryConstruct(java.lang.String queryString)Execute a CONSTRUCT query and return as a ModelModelqueryDescribe(java.lang.String queryString)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.voidquerySelect(java.lang.String queryString, java.util.function.Consumer<QuerySolution> rowAction)Execute a SELECT query and process the rows of the results with the handler code.ReadWritetransactionMode()TxnTypetransactionType()voidupdate(java.lang.String updateString)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
queryAsk, queryConstruct, queryDescribe, queryResultSet, querySelect, update
-
Methods inherited from interface org.apache.jena.sparql.core.Transactional
calc, calculate, calculateRead, calculateWrite, exec, execute, executeRead, executeWrite, promote
-
-
-
-
Method Detail
-
create
public static RDFConnectionRemoteBuilder create()
Create aRDFConnectionRemoteBuilder.
-
create
public static RDFConnectionRemoteBuilder create(RDFConnectionRemote base)
Create aRDFConnectionRemoteBuilderinitialized with the settings of anotherRDFConnectionRemote.
-
getHttpClient
public org.apache.http.client.HttpClient getHttpClient()
Return theHttpClientin-use.
-
getHttpContext
public org.apache.http.protocol.HttpContext getHttpContext()
Return theHttpContextin-use.
-
getDestination
public java.lang.String getDestination()
Return the destination URL for the connection.
-
queryResultSet
public void queryResultSet(java.lang.String queryString, java.util.function.Consumer<ResultSet> resultSetAction)Execute a SELECT query and process the ResultSet with the handler code.- Specified by:
queryResultSetin interfaceRDFConnection- Specified by:
queryResultSetin interfaceSparqlQueryConnection- Parameters:
queryString-resultSetAction-
-
querySelect
public void querySelect(java.lang.String queryString, java.util.function.Consumer<QuerySolution> rowAction)Execute a SELECT query and process the rows of the results with the handler code.- Specified by:
querySelectin interfaceRDFConnection- Specified by:
querySelectin interfaceSparqlQueryConnection- Parameters:
queryString-rowAction-
-
queryConstruct
public Model queryConstruct(java.lang.String queryString)
Execute a CONSTRUCT query and return as a Model- Specified by:
queryConstructin interfaceRDFConnection- Specified by:
queryConstructin interfaceSparqlQueryConnection
-
queryDescribe
public Model queryDescribe(java.lang.String queryString)
Execute a DESCRIBE query and return as a Model- Specified by:
queryDescribein interfaceRDFConnection- Specified by:
queryDescribein interfaceSparqlQueryConnection
-
queryAsk
public boolean queryAsk(java.lang.String queryString)
Execute a ASK query and return a boolean- Specified by:
queryAskin interfaceRDFConnection- Specified by:
queryAskin interfaceSparqlQueryConnection
-
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
-
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
-
update
public void update(java.lang.String updateString)
Description copied from interface:RDFConnectionExecute a SPARQL Update.- Specified by:
updatein interfaceRDFConnection- Specified by:
updatein interfaceSparqlUpdateConnection
-
update
public void update(UpdateRequest update)
Description copied from interface:RDFConnectionExecute a SPARQL Update.- Specified by:
updatein interfaceRDFConnection- Specified by:
updatein interfaceSparqlUpdateConnection
-
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
-
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
-
load
public void load(java.lang.String graph, 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:
graph- 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(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.
-
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.
-
put
public void put(java.lang.String graph, 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:
graph- 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 graph)
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
-
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
-
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
-
begin
public void begin()
- Specified by:
beginin interfaceTransactional
-
begin
public void begin(TxnType txnType)
- Specified by:
beginin interfaceTransactional
-
begin
public void begin(ReadWrite mode)
- Specified by:
beginin interfaceTransactional
-
promote
public boolean promote(Transactional.Promote promote)
- Specified by:
promotein interfaceTransactional
-
commit
public void commit()
- Specified by:
commitin interfaceTransactional
-
abort
public void abort()
- Specified by:
abortin interfaceTransactional
-
isInTransaction
public boolean isInTransaction()
- Specified by:
isInTransactionin 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
-
-