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 void
abort()
Abort a transaction - finish the transaction and undo any changes (if a "write" transaction)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 quadvoid
add(org.apache.jena.sparql.core.Quad quad)
Add a quadvoid
addGraph(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph graph)
Add the given graph to the dataset.void
begin(org.apache.jena.query.ReadWrite readWrite)
Start either a READ or WRITE transactionvoid
begin(org.apache.jena.query.TxnType txnType)
void
clear()
void
close()
Close the datasetvoid
commit()
Commit a transaction - finish the transaction and make any changes permanent (if a "write" transaction)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 nullboolean
contains(org.apache.jena.sparql.core.Quad quad)
Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or nullboolean
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.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 quadvoid
delete(org.apache.jena.sparql.core.Quad quad)
Delete a quadvoid
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 patternvoid
end()
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.Context
getContext()
Get the context associated with this object - may be nullorg.apache.jena.graph.Graph
getDefaultGraph()
Get the default graph as a Jena Graphorg.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.protected java.util.List<org.apache.jena.graph.Node>
getListGraphNodes()
org.apache.jena.shared.Lock
getLock()
Return a lock for the dataset to help with concurrency controlorg.apache.jena.graph.Graph
getUnionGraph()
Return aGraph
that is the union of all named graphs in this dataset.boolean
isEmpty()
Test whether the dataset is emptyboolean
isInTransaction()
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.PrefixMap
prefixes()
Prefixes for this DatasetGraphboolean
promote(org.apache.jena.sparql.core.Transactional.Promote promote)
void
removeGraph(org.apache.jena.graph.Node graphName)
Remove all data associated with the named graphvoid
setDefaultGraph(org.apache.jena.graph.Graph g)
Set the default graph.long
size()
Get the size (number of named graphs) - may be -1 for unknownboolean
supportsTransactionAbort()
Declare whetherabort()
is supported.boolean
supportsTransactions()
ADatasetGraph
supports tranactions if it providesbegin(org.apache.jena.query.TxnType)
/commit()
/end()
.org.apache.jena.query.ReadWrite
transactionMode()
org.apache.jena.query.TxnType
transactionType()
-
-
-
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:
getDefaultGraph
in 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:
getGraph
in interfaceorg.apache.jena.sparql.core.DatasetGraph
-
getUnionGraph
public org.apache.jena.graph.Graph getUnionGraph()
Return aGraph
that 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:
getUnionGraph
in 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:
containsGraph
in 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:
listGraphNodes
in 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:
getLock
in 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:
size
in interfaceorg.apache.jena.sparql.core.DatasetGraph
-
close
public void close()
Close the dataset- Specified by:
close
in interfaceorg.apache.jena.atlas.lib.Closeable
- Specified by:
close
in 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:
getContext
in interfaceorg.apache.jena.sparql.core.DatasetGraph
-
prefixes
public org.apache.jena.riot.system.PrefixMap prefixes()
Prefixes for this DatasetGraph- Specified by:
prefixes
in 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:
setDefaultGraph
in 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:
addGraph
in 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:
removeGraph
in interfaceorg.apache.jena.sparql.core.DatasetGraph
-
add
public void add(org.apache.jena.sparql.core.Quad quad)
Add a quad- Specified by:
add
in interfaceorg.apache.jena.sparql.core.DatasetGraph
-
delete
public void delete(org.apache.jena.sparql.core.Quad quad)
Delete a quad- Specified by:
delete
in 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:
add
in 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:
delete
in 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:
deleteAny
in 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:
find
in 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:
find
in 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:
find
in 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:
findNG
in 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:
contains
in 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:
contains
in interfaceorg.apache.jena.sparql.core.DatasetGraph
-
clear
public void clear()
- Specified by:
clear
in interfaceorg.apache.jena.sparql.core.DatasetGraph
-
isEmpty
public boolean isEmpty()
Test whether the dataset is empty- Specified by:
isEmpty
in interfaceorg.apache.jena.sparql.core.DatasetGraph
-
supportsTransactions
public boolean supportsTransactions()
ADatasetGraph
supports tranactions if it providesbegin(org.apache.jena.query.TxnType)
/commit()
/end()
. There core storageDatasetGraph
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 provideabort()
.See
supportsTransactionAbort()
forabort()
. In addition, check details of a specific implementation.- Specified by:
supportsTransactions
in 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:
supportsTransactionAbort
in interfaceorg.apache.jena.sparql.core.DatasetGraph
-
isInTransaction
public boolean isInTransaction()
Say whether inside a transaction.- Specified by:
isInTransaction
in interfaceorg.apache.jena.sparql.core.Transactional
-
begin
public void begin(org.apache.jena.query.TxnType txnType)
- Specified by:
begin
in 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:
begin
in interfaceorg.apache.jena.sparql.core.Transactional
-
promote
public boolean promote(org.apache.jena.sparql.core.Transactional.Promote promote)
- Specified by:
promote
in 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:
commit
in 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:
abort
in 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:
end
in interfaceorg.apache.jena.sparql.core.Transactional
-
transactionMode
public org.apache.jena.query.ReadWrite transactionMode()
- Specified by:
transactionMode
in interfaceorg.apache.jena.sparql.core.Transactional
-
transactionType
public org.apache.jena.query.TxnType transactionType()
- Specified by:
transactionType
in interfaceorg.apache.jena.sparql.core.Transactional
-
-