Package virtuoso.jena.driver
Class VirtDataset.VirtDataSetGraph
- java.lang.Object
-
- virtuoso.jena.driver.VirtDataset.VirtDataSetGraph
-
- All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable,org.apache.jena.sparql.core.DatasetGraph,org.apache.jena.sparql.core.Transactional
- Enclosing class:
- VirtDataset
public class VirtDataset.VirtDataSetGraph extends java.lang.Object implements org.apache.jena.sparql.core.DatasetGraph
-
-
Constructor Summary
Constructors Constructor Description VirtDataSetGraph(VirtDataset vds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()Abort a transaction - finish the transaction and undo any changes (if a "write" transaction)voidadd(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Add a quadvoidadd(org.apache.jena.sparql.core.Quad quad)Add a quadvoidaddGraph(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph graph)Add the given graph to the dataset.voidbegin(org.apache.jena.query.ReadWrite readWrite)Start either a READ or WRITE transactionvoidbegin(org.apache.jena.query.TxnType txnType)voidclear()voidclose()Close the datasetvoidcommit()Commit a transaction - finish the transaction and make any changes permanent (if a "write" transaction)booleancontains(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or nullbooleancontains(org.apache.jena.sparql.core.Quad quad)Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or nullbooleancontainsGraph(org.apache.jena.graph.Node graphNode)Does the DatasetGraph contain a specific named graph? Whether a dataset contains a graph if there are no triples is not defined - see the specific implementation.voiddelete(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Delete a quadvoiddelete(org.apache.jena.sparql.core.Quad quad)Delete a quadvoiddeleteAny(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Delete any quads matching the patternvoidend()Finish the transaction - if a write transaction and commit() has not been called, then abortjava.util.Iterator<org.apache.jena.sparql.core.Quad>find()Iterate over all quads in the dataset graphjava.util.Iterator<org.apache.jena.sparql.core.Quad>find(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Find matching quads in the dataset (including default graph) - may include wildcards, Node.ANY or nulljava.util.Iterator<org.apache.jena.sparql.core.Quad>find(org.apache.jena.sparql.core.Quad quad)Find matching quads in the dataset - may include wildcards, Node.ANY or nulljava.util.Iterator<org.apache.jena.sparql.core.Quad>findNG(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Find matching quads in the dataset in named graphs only - may include wildcards, Node.ANY or nullorg.apache.jena.sparql.util.ContextgetContext()Get the context associated with this object - may be nullorg.apache.jena.graph.GraphgetDefaultGraph()Get the default graph as a Jena Graphorg.apache.jena.graph.GraphgetGraph(org.apache.jena.graph.Node graphNode)Get the graph named by graphNode : returns null when there is no such graph.protected java.util.List<org.apache.jena.graph.Node>getListGraphNodes()org.apache.jena.shared.LockgetLock()Return a lock for the dataset to help with concurrency controlorg.apache.jena.graph.GraphgetUnionGraph()Return aGraphthat is the union of all named graphs in this dataset.booleanisEmpty()Test whether the dataset is emptybooleanisInTransaction()Say whether inside a transaction.java.util.Iterator<org.apache.jena.graph.Node>listGraphNodes()Iterate over all names of named graphsorg.apache.jena.riot.system.PrefixMapprefixes()Prefixes for this DatasetGraphbooleanpromote(org.apache.jena.sparql.core.Transactional.Promote promote)voidremoveGraph(org.apache.jena.graph.Node graphName)Remove all data associated with the named graphvoidsetDefaultGraph(org.apache.jena.graph.Graph g)Set the default graph.longsize()Get the size (number of named graphs) - may be -1 for unknownbooleansupportsTransactionAbort()Declare whetherabort()is supported.booleansupportsTransactions()ADatasetGraphsupports tranactions if it providesbegin(org.apache.jena.query.TxnType)/commit()/end().org.apache.jena.query.ReadWritetransactionMode()org.apache.jena.query.TxnTypetransactionType()
-
-
-
Constructor Detail
-
VirtDataSetGraph
public VirtDataSetGraph(VirtDataset vds)
-
-
Method Detail
-
getDefaultGraph
public org.apache.jena.graph.Graph getDefaultGraph()
Get the default graph as a Jena Graph- Specified by:
getDefaultGraphin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
getGraph
public org.apache.jena.graph.Graph getGraph(org.apache.jena.graph.Node graphNode)
Get the graph named by graphNode : returns null when there is no such graph. NB Whether a dataset contains a graph if there are no triples is not defined - see the specific implementation. Some datasets are "open" - they have all graphs even if no triples.- Specified by:
getGraphin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
getUnionGraph
public org.apache.jena.graph.Graph getUnionGraph()
Return aGraphthat is the union of all named graphs in this dataset. This union graph is read-only (its prefix mapping in the current JVM may be changed but that may not persist).- Specified by:
getUnionGraphin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
containsGraph
public boolean containsGraph(org.apache.jena.graph.Node graphNode)
Does the DatasetGraph contain a specific named graph? Whether a dataset contains a graph if there are no triples is not defined - see the specific implementation. Some datasets are "open" - they have all graphs even if no triples and this returns true always.- Specified by:
containsGraphin interfaceorg.apache.jena.sparql.core.DatasetGraph- Parameters:
graphNode-- Returns:
- boolean
-
getListGraphNodes
protected java.util.List<org.apache.jena.graph.Node> getListGraphNodes()
-
listGraphNodes
public java.util.Iterator<org.apache.jena.graph.Node> listGraphNodes()
Iterate over all names of named graphs- Specified by:
listGraphNodesin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
getLock
public org.apache.jena.shared.Lock getLock()
Return a lock for the dataset to help with concurrency control- Specified by:
getLockin interfaceorg.apache.jena.sparql.core.DatasetGraph- See Also:
Lock
-
size
public long size()
Get the size (number of named graphs) - may be -1 for unknown- Specified by:
sizein interfaceorg.apache.jena.sparql.core.DatasetGraph
-
close
public void close()
Close the dataset- Specified by:
closein interfaceorg.apache.jena.atlas.lib.Closeable- Specified by:
closein interfaceorg.apache.jena.sparql.core.DatasetGraph
-
getContext
public org.apache.jena.sparql.util.Context getContext()
Get the context associated with this object - may be null- Specified by:
getContextin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
prefixes
public org.apache.jena.riot.system.PrefixMap prefixes()
Prefixes for this DatasetGraph- Specified by:
prefixesin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
setDefaultGraph
public void setDefaultGraph(org.apache.jena.graph.Graph g)
Set the default graph. Set the active graph if it was null. This replaces the contents default graph, not merge data into it. Do not assume that the same object is returned bygetDefaultGraph()- Specified by:
setDefaultGraphin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
addGraph
public void addGraph(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph graph)Add the given graph to the dataset. Replaces any existing data for the named graph; to add data, get the graph and add triples to it, or add quads to the dataset. Do not assume that the same Java object is returned bygetGraph(org.apache.jena.graph.Node)- Specified by:
addGraphin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
removeGraph
public void removeGraph(org.apache.jena.graph.Node graphName)
Remove all data associated with the named graph- Specified by:
removeGraphin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
add
public void add(org.apache.jena.sparql.core.Quad quad)
Add a quad- Specified by:
addin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
delete
public void delete(org.apache.jena.sparql.core.Quad quad)
Delete a quad- Specified by:
deletein interfaceorg.apache.jena.sparql.core.DatasetGraph
-
add
public void add(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Add a quad- Specified by:
addin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
delete
public void delete(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Delete a quad- Specified by:
deletein interfaceorg.apache.jena.sparql.core.DatasetGraph
-
deleteAny
public void deleteAny(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Delete any quads matching the pattern- Specified by:
deleteAnyin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
find
public java.util.Iterator<org.apache.jena.sparql.core.Quad> find()
Iterate over all quads in the dataset graph- Specified by:
findin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
find
public java.util.Iterator<org.apache.jena.sparql.core.Quad> find(org.apache.jena.sparql.core.Quad quad)
Find matching quads in the dataset - may include wildcards, Node.ANY or null- Specified by:
findin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
find
public java.util.Iterator<org.apache.jena.sparql.core.Quad> find(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Find matching quads in the dataset (including default graph) - may include wildcards, Node.ANY or null- Specified by:
findin interfaceorg.apache.jena.sparql.core.DatasetGraph- See Also:
Graph.find(Node, Node, Node)
-
findNG
public java.util.Iterator<org.apache.jena.sparql.core.Quad> findNG(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Find matching quads in the dataset in named graphs only - may include wildcards, Node.ANY or null- Specified by:
findNGin interfaceorg.apache.jena.sparql.core.DatasetGraph- See Also:
Graph.find(Node, Node, Node)
-
contains
public boolean contains(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or null- Specified by:
containsin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
contains
public boolean contains(org.apache.jena.sparql.core.Quad quad)
Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or null- Specified by:
containsin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
clear
public void clear()
- Specified by:
clearin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
isEmpty
public boolean isEmpty()
Test whether the dataset is empty- Specified by:
isEmptyin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
supportsTransactions
public boolean supportsTransactions()
ADatasetGraphsupports tranactions if it providesbegin(org.apache.jena.query.TxnType)/commit()/end(). There core storageDatasetGraphthat provide fully serialized transactions.DatasetGraphthat 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 provideabort().See
supportsTransactionAbort()forabort(). In addition, check details of a specific implementation.- Specified by:
supportsTransactionsin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
supportsTransactionAbort
public boolean supportsTransactionAbort()
Declare whetherabort()is supported. This goes along with clearing up after exceptions inside application transaction code.- Specified by:
supportsTransactionAbortin interfaceorg.apache.jena.sparql.core.DatasetGraph
-
isInTransaction
public boolean isInTransaction()
Say whether inside a transaction.- Specified by:
isInTransactionin interfaceorg.apache.jena.sparql.core.Transactional
-
begin
public void begin(org.apache.jena.query.TxnType txnType)
- Specified by:
beginin interfaceorg.apache.jena.sparql.core.Transactional
-
begin
public void begin(org.apache.jena.query.ReadWrite readWrite)
Start either a READ or WRITE transaction- Specified by:
beginin interfaceorg.apache.jena.sparql.core.Transactional
-
promote
public boolean promote(org.apache.jena.sparql.core.Transactional.Promote promote)
- Specified by:
promotein interfaceorg.apache.jena.sparql.core.Transactional
-
commit
public void commit()
Commit a transaction - finish the transaction and make any changes permanent (if a "write" transaction)- Specified by:
commitin interfaceorg.apache.jena.sparql.core.Transactional
-
abort
public void abort()
Abort a transaction - finish the transaction and undo any changes (if a "write" transaction)- Specified by:
abortin interfaceorg.apache.jena.sparql.core.Transactional
-
end
public void end()
Finish the transaction - if a write transaction and commit() has not been called, then abort- Specified by:
endin interfaceorg.apache.jena.sparql.core.Transactional
-
transactionMode
public org.apache.jena.query.ReadWrite transactionMode()
- Specified by:
transactionModein interfaceorg.apache.jena.sparql.core.Transactional
-
transactionType
public org.apache.jena.query.TxnType transactionType()
- Specified by:
transactionTypein interfaceorg.apache.jena.sparql.core.Transactional
-
-