public class DatasetGraphMap extends DatasetGraphTriplesQuads
DatasetGraph as an extensible set of graphs.
Subclasses need to manage any implicit graph creation.
This implementation provides copy-in, copy-out for DatasetGraphTriplesQuads.addGraph(org.apache.jena.graph.Node, org.apache.jena.graph.Graph).
See DatasetGraphMapLink for a DatasetGraph
that holds graphs as provided.
DatasetGraphMapLink| Constructor and Description |
|---|
DatasetGraphMap()
DatasetGraphMap defaulting to storage in memory.
|
DatasetGraphMap(DatasetGraphFactory.GraphMaker graphMaker)
DatasetGraphMap with a specific policy for graph creation.
|
DatasetGraphMap(Graph defaultGraph,
DatasetGraphFactory.GraphMaker graphMaker) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Abort a transaction - finish the transaction and undo any changes (if a "write" transaction)
|
void |
begin(ReadWrite mode)
Start either a READ or WRITE transaction
|
void |
commit()
Commit a transaction - finish the transaction and make any changes permanent (if a "write" transaction)
|
void |
end()
Finish the transaction - if a write transaction and commit() has not been called, then abort
|
Graph |
getDefaultGraph()
Get the default graph as a Jena Graph
|
Graph |
getGraph(Node graphNode)
Get the graph named by graphNode : returns null on no graph
NB Whether a dataset contains a graph if there are no triples is not defined - see the specifc implementation.
|
boolean |
isInTransaction()
Say whether inside a transaction.
|
Iterator<Node> |
listGraphNodes()
Iterate over all names of named graphs
|
long |
size()
Get the size (number of named graphs) - may be -1 for unknown
|
boolean |
supportsTransactionAbort()
Declare whether
Transactional.abort() is supported. |
boolean |
supportsTransactions()
A
DatasetGraph supports tranactions if it provides Transactional.begin(org.apache.jena.query.ReadWrite)/
Transactional.commit()/Transactional.end(). |
add, add, addGraph, delete, delete, removeGraph, setDefaultGraphfind, findInUnionGraph, findNG, findQuadsInUnionGraphclear, close, contains, contains, containsGraph, deleteAny, find, find, getContext, getLock, isEmpty, toStringpublic DatasetGraphMap()
public DatasetGraphMap(DatasetGraphFactory.GraphMaker graphMaker)
public DatasetGraphMap(Graph defaultGraph, DatasetGraphFactory.GraphMaker graphMaker)
public void begin(ReadWrite mode)
Transactionalpublic void commit()
Transactionalpublic void abort()
Transactionalpublic boolean isInTransaction()
Transactionalpublic void end()
Transactionalpublic boolean supportsTransactions()
DatasetGraphDatasetGraph supports tranactions if it provides Transactional.begin(org.apache.jena.query.ReadWrite)/
Transactional.commit()/Transactional.end(). There core storage DatasetGraph that
provide fully serialized transactions. DatasetGraph that provide
functionality acorss independent systems can not provide such strong guarantees.
For example, they may use MRSW locking and some isolation control.
Specifically, they do not necessarily provide Transactional.abort().
See DatasetGraph.supportsTransactionAbort() for Transactional.abort().
In addition, check details of a specific implementation.
public boolean supportsTransactionAbort()
DatasetGraphTransactional.abort() is supported.
This goes along with clearing up after exceptions inside application transaction code.public Iterator<Node> listGraphNodes()
DatasetGraphpublic Graph getDefaultGraph()
DatasetGraphgetDefaultGraph in interface DatasetGraphgetDefaultGraph in class DatasetGraphBasepublic Graph getGraph(Node graphNode)
DatasetGraphgetGraph in interface DatasetGraphgetGraph in class DatasetGraphBasepublic long size()
DatasetGraphsize in interface DatasetGraphsize in class DatasetGraphBaseLicenced under the Apache License, Version 2.0