java.lang.Object
org.apache.jena.rdflink.RDFLinkDataset
- All Implemented Interfaces:
AutoCloseable
,LinkDatasetGraph
,LinkDatasetGraphAccess
,LinkSparqlQuery
,LinkSparqlUpdate
,RDFLink
,Transactional
Implement of
RDFLink
over a Graph
in the same JVM.
Multiple levels of Isolation
are provided. The default COPY
level makes a local
RDFLink
that behaves like a remote connection. This should be the normal use in
testing.
COPY
–Graph
s andDataset
s are copied. This is most like a remote connection.READONLY
– Read-only wrappers are added but changes to the underlying graph or dataset will be seen.NONE
(default) – Changes to the returnedGraph
s orDataset
s act on the original object.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
Transactional.Promote
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
void
begin()
void
void
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 a graph from the dataset.void
end()
get()
Fetch the default graph.Fetch a named graph.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 (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
loadDataset
(String file) void
loadDataset
(DatasetGraph srcDataset) newQuery()
Return aQueryExecBuilder
that is initially configured for this link setup and type.Return aUpdateExecBuilder
that is initially configured for this link setup and type.boolean
promote
(Transactional.Promote promote) void
Set the contents of the default graph of a dataset.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
putDataset
(String file) void
putDataset
(DatasetGraph dataset) Setup a SPARQL query execution.void
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, query, 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
-
Method Details
-
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
-
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
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
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
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)graphSrc
- Data.
-
load
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.
-
get
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
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
-
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
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:
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)graph
- Data.
-
delete
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
-
getDataset
Description copied from interface:LinkDatasetGraphAccess
Fetch the contents of the dataset- Specified by:
getDataset
in interfaceLinkDatasetGraphAccess
-
loadDataset
- Specified by:
loadDataset
in interfaceLinkDatasetGraph
- Specified by:
loadDataset
in interfaceRDFLink
-
loadDataset
- Specified by:
loadDataset
in interfaceLinkDatasetGraph
- Specified by:
loadDataset
in interfaceRDFLink
-
putDataset
- Specified by:
putDataset
in interfaceLinkDatasetGraph
- Specified by:
putDataset
in interfaceRDFLink
-
putDataset
- Specified by:
putDataset
in interfaceLinkDatasetGraph
- Specified by:
putDataset
in interfaceRDFLink
-
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
-
close
public void close()Description copied from interface:RDFLink
Close this connection. Use with try-resource.- 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
-
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
-
begin
public void begin()- Specified by:
begin
in interfaceTransactional
-
begin
- Specified by:
begin
in interfaceTransactional
-
begin
- Specified by:
begin
in interfaceTransactional
-
promote
- Specified by:
promote
in interfaceTransactional
-
commit
public void commit()- Specified by:
commit
in interfaceTransactional
-
abort
public void abort()- Specified by:
abort
in interfaceTransactional
-
isInTransaction
public boolean isInTransaction()- Specified by:
isInTransaction
in interfaceTransactional
-
end
public void end()- Specified by:
end
in interfaceTransactional
-
transactionMode
- Specified by:
transactionMode
in interfaceTransactional
-
transactionType
- Specified by:
transactionType
in interfaceTransactional
-