Class VirtDataset
- java.lang.Object
-
- org.apache.jena.graph.impl.GraphBase
-
- virtuoso.jena.driver.VirtGraph
-
- virtuoso.jena.driver.VirtDataset
-
- All Implemented Interfaces:
org.apache.jena.graph.Graph
,org.apache.jena.graph.impl.GraphWithPerform
,org.apache.jena.query.Dataset
,org.apache.jena.sparql.core.Transactional
public class VirtDataset extends VirtGraph implements org.apache.jena.query.Dataset
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
VirtDataset.VirtDataSetGraph
-
Field Summary
-
Fields inherited from class virtuoso.jena.driver.VirtGraph
BATCH_SIZE, batchSize, CONCUR_DEFAULT, CONCUR_OPTIMISTIC, CONCUR_PESSIMISTIC, concurencyMode, connection, DEFAULT, graphName, insertBNodeAsVirtuosoIRI, insertStringLiteralAsSimple, isXA, m_prefixMapping, macroLib, MAX_CMD_SIZE, parent_dataset, password, prefetchSize, queryTimeout, readFromAllGraphs, resetBNodesDictAfterCall, resetBNodesDictAfterCommit, roundrobin, ruleSet, S_BATCH_INSERT, sparqlPrefix, tranHandler, url_hostlist, user, useReprepare, useSameAs
-
-
Constructor Summary
Constructors Modifier Constructor Description VirtDataset()
VirtDataset(java.lang.String url_hostlist, java.lang.String user, java.lang.String password)
VirtDataset(java.lang.String _graphName, javax.sql.ConnectionPoolDataSource _ds)
VirtDataset(java.lang.String _graphName, javax.sql.DataSource _ds)
VirtDataset(java.lang.String _graphName, javax.sql.XADataSource _ds)
VirtDataset(javax.sql.ConnectionPoolDataSource _ds)
VirtDataset(javax.sql.DataSource _ds)
VirtDataset(javax.sql.XADataSource _ds)
protected
VirtDataset(VirtGraph g)
-
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)protected void
addLink(VirtGraph obj)
VirtDataset
addNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model)
Set a named graph.VirtDataset
addNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model, boolean checkExists)
Set a named graph.org.apache.jena.query.Dataset
addNamedModel(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Model model)
Add a named graph.org.apache.jena.sparql.core.DatasetGraph
asDatasetGraph()
Get the dataset in graph formvoid
begin(org.apache.jena.query.ReadWrite readWrite)
Start either a READ or WRITE transactionvoid
begin(org.apache.jena.query.TxnType txnType)
void
close()
void
commit()
Commit a transaction - finish the transaction and make any changes permanent (if a "write" transaction)boolean
containsNamedModel(java.lang.String name)
Does the dataset contain a model with the name supplied?boolean
containsNamedModel(org.apache.jena.rdf.model.Resource resource)
Does the dataset contain a model with the name supplied?void
end()
Finish the transaction - if a write transaction and commit() has not been called, then abortorg.apache.jena.sparql.util.Context
getContext()
org.apache.jena.rdf.model.Model
getDefaultModel()
Get the default graph as a Jena ModelVirtIsolationLevel
getIsolationLevel()
org.apache.jena.shared.Lock
getLock()
Get the lock for this datasetorg.apache.jena.rdf.model.Model
getNamedModel(java.lang.String name)
Get a graph by name as a Jena Modelorg.apache.jena.rdf.model.Model
getNamedModel(org.apache.jena.rdf.model.Resource resource)
Get a graph by name as a Jena Modelorg.apache.jena.rdf.model.Model
getUnionModel()
boolean
isInTransaction()
Say whether a transaction is activejava.util.Iterator<org.apache.jena.rdf.model.Resource>
listModelNames()
List the namesjava.util.Iterator<java.lang.String>
listNames()
List the namesboolean
promote(org.apache.jena.sparql.core.Transactional.Promote promote)
Attempt to promote a transaction from "read" mode to "write" and the transaction.protected void
removeLink(VirtGraph obj)
VirtDataset
removeNamedModel(java.lang.String name)
Remove a named graph.org.apache.jena.query.Dataset
removeNamedModel(org.apache.jena.rdf.model.Resource resource)
Remove a named graph.VirtDataset
replaceNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model)
Change a named graph for another uisng the same nameVirtDataset
replaceNamedModel(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Model model)
Change a named graph for another using the same nameVirtDataset
setDefaultModel(org.apache.jena.rdf.model.Model model)
Set the background graph.void
setIsolationLevel(VirtIsolationLevel level)
boolean
supportsTransactionAbort()
boolean
supportsTransactions()
boolean
supportsXATransactions()
org.apache.jena.query.ReadWrite
transactionMode()
Return the current mode of the transaction - "read" or "write".org.apache.jena.query.TxnType
transactionType()
Return the transaction type used inbegin(TxnType)
.-
Methods inherited from class virtuoso.jena.driver.VirtGraph
add, appendSparqlPrefixes, bindBatchParams, clear, clear, createBNodesDict, createRuleSet, createStatement, delete, dropBNodesDict, getBatchSize, getConcurrencyMode, getConnection, getCount, getDataSource, getFetchSize, getGraphName, getGraphPassword, getGraphUrl, getGraphUser, getInsertBNodeAsVirtuosoIRI, getInsertStringLiteralAsSimple, getJdbcConcurrency, getMacroLib, getPrefixMapping, getQueryTimeout, getReadFromAllGraphs, getResetBNodesDictAfterCall, getResetBNodesDictAfterCommit, getRuleSet, getSameAs, getSparqlPrefix, getTransactionHandler, getXAResource, graphBaseContains, graphBaseContains, graphBaseFind, graphBaseFind, graphBaseSize, md_delete_Model, Node2Str, Node2Str_add, Object2Node, performAdd, performAdd, performAdd, performDelete, performDelete, prepareStatement, read, reifierSize, reifierTriples, remove, remove, removeRuleSet, setBatchSize, setConcurrencyMode, setFetchSize, setGraphName, setInsertBNodeAsVirtuosoIRI, setInsertStringLiteralAsSimple, setMacroLib, setQueryTimeout, setReadFromAllGraphs, setResetBNodesDictAfterCall, setResetBNodesDictAfterCommit, setRuleSet, setSameAs, setSparqlPrefix, startBatchAdd, stopBatchAdd
-
Methods inherited from class org.apache.jena.graph.impl.GraphBase
add, checkOpen, contains, contains, containsByFind, createPrefixMapping, delete, dependsOn, find, find, forTestingOnly_graphBaseFind, getCapabilities, getEventManager, graphBaseFind, isClosed, isEmpty, isIsomorphicWith, notifyAdd, notifyDelete, remove, size, toString, toString
-
-
-
-
Constructor Detail
-
VirtDataset
public VirtDataset()
-
VirtDataset
public VirtDataset(java.lang.String _graphName, javax.sql.DataSource _ds)
-
VirtDataset
public VirtDataset(javax.sql.DataSource _ds)
-
VirtDataset
public VirtDataset(java.lang.String _graphName, javax.sql.ConnectionPoolDataSource _ds)
-
VirtDataset
public VirtDataset(javax.sql.ConnectionPoolDataSource _ds)
-
VirtDataset
public VirtDataset(java.lang.String _graphName, javax.sql.XADataSource _ds)
-
VirtDataset
public VirtDataset(javax.sql.XADataSource _ds)
-
VirtDataset
protected VirtDataset(VirtGraph g)
-
VirtDataset
public VirtDataset(java.lang.String url_hostlist, java.lang.String user, java.lang.String password)
-
-
Method Detail
-
getDefaultModel
public org.apache.jena.rdf.model.Model getDefaultModel()
Get the default graph as a Jena Model- Specified by:
getDefaultModel
in interfaceorg.apache.jena.query.Dataset
-
getUnionModel
public org.apache.jena.rdf.model.Model getUnionModel()
- Specified by:
getUnionModel
in interfaceorg.apache.jena.query.Dataset
-
setDefaultModel
public VirtDataset setDefaultModel(org.apache.jena.rdf.model.Model model)
Set the background graph. Can be set to null for none.- Specified by:
setDefaultModel
in interfaceorg.apache.jena.query.Dataset
-
getNamedModel
public org.apache.jena.rdf.model.Model getNamedModel(java.lang.String name)
Get a graph by name as a Jena Model- Specified by:
getNamedModel
in interfaceorg.apache.jena.query.Dataset
-
getNamedModel
public org.apache.jena.rdf.model.Model getNamedModel(org.apache.jena.rdf.model.Resource resource)
Get a graph by name as a Jena Model- Specified by:
getNamedModel
in interfaceorg.apache.jena.query.Dataset
-
containsNamedModel
public boolean containsNamedModel(java.lang.String name)
Does the dataset contain a model with the name supplied?- Specified by:
containsNamedModel
in interfaceorg.apache.jena.query.Dataset
-
containsNamedModel
public boolean containsNamedModel(org.apache.jena.rdf.model.Resource resource)
Does the dataset contain a model with the name supplied?- Specified by:
containsNamedModel
in interfaceorg.apache.jena.query.Dataset
-
addNamedModel
public VirtDataset addNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model, boolean checkExists)
Set a named graph.
-
addNamedModel
public VirtDataset addNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model)
Set a named graph.- Specified by:
addNamedModel
in interfaceorg.apache.jena.query.Dataset
-
addNamedModel
public org.apache.jena.query.Dataset addNamedModel(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Model model)
Add a named graph.- Specified by:
addNamedModel
in interfaceorg.apache.jena.query.Dataset
- Parameters:
resource
- the name of the graph to setmodel
- the graph to set- Returns:
- this
Dataset
for continued usage
-
removeNamedModel
public VirtDataset removeNamedModel(java.lang.String name)
Remove a named graph.- Specified by:
removeNamedModel
in interfaceorg.apache.jena.query.Dataset
-
removeNamedModel
public org.apache.jena.query.Dataset removeNamedModel(org.apache.jena.rdf.model.Resource resource)
Remove a named graph.- Specified by:
removeNamedModel
in interfaceorg.apache.jena.query.Dataset
- Parameters:
resource
- the name of the graph to remove- Returns:
- this
Dataset
for continued usage
-
replaceNamedModel
public VirtDataset replaceNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model)
Change a named graph for another uisng the same name- Specified by:
replaceNamedModel
in interfaceorg.apache.jena.query.Dataset
-
replaceNamedModel
public VirtDataset replaceNamedModel(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Model model)
Change a named graph for another using the same name- Specified by:
replaceNamedModel
in interfaceorg.apache.jena.query.Dataset
- Parameters:
resource
- the name of the graph to replacemodel
- the graph with which to replace it- Returns:
- this
Dataset
for continued usage
-
listNames
public java.util.Iterator<java.lang.String> listNames()
List the names- Specified by:
listNames
in interfaceorg.apache.jena.query.Dataset
-
listModelNames
public java.util.Iterator<org.apache.jena.rdf.model.Resource> listModelNames()
List the names- Specified by:
listModelNames
in interfaceorg.apache.jena.query.Dataset
-
getLock
public org.apache.jena.shared.Lock getLock()
Get the lock for this dataset- Specified by:
getLock
in interfaceorg.apache.jena.query.Dataset
-
getContext
public org.apache.jena.sparql.util.Context getContext()
- Specified by:
getContext
in interfaceorg.apache.jena.query.Dataset
-
supportsTransactions
public boolean supportsTransactions()
- Specified by:
supportsTransactions
in interfaceorg.apache.jena.query.Dataset
-
supportsXATransactions
public boolean supportsXATransactions()
-
supportsTransactionAbort
public boolean supportsTransactionAbort()
- Specified by:
supportsTransactionAbort
in interfaceorg.apache.jena.query.Dataset
-
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.query.Dataset
- Specified by:
begin
in interfaceorg.apache.jena.sparql.core.Transactional
-
promote
public boolean promote(org.apache.jena.sparql.core.Transactional.Promote promote)
Attempt to promote a transaction from "read" mode to "write" and the transaction. This method allows the form of promotion to be specified. The transaction must not have been started withREAD
, which is read-only.An argument of
READ_PROMOTE
treats the promotion as if the transaction was started withREAD_PROMOTE
(any other writer commiting since the transaction started blocks promotion) andREAD_COMMITTED_PROMOTE
treats the promotion as if the transaction was started withREAD_COMMITTED_PROMOTE
(intemediate writer commits become visible).Returns "true" if the transaction is in write mode after the call. The method always succeeds of the transaction is already "write".
This method returns true if a
READ_PROMOTE
orREAD_COMMITTED_PROMOTE
is promoted.This method returns false if a
READ_PROMOTE
can't be promoted - the transaction is still valid and in "read" mode.This method throws an exception if there is an attempt to promote a
READ
transaction.- 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.query.Dataset
- 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.query.Dataset
- Specified by:
abort
in interfaceorg.apache.jena.sparql.core.Transactional
-
isInTransaction
public boolean isInTransaction()
Say whether a transaction is active- Specified by:
isInTransaction
in interfaceorg.apache.jena.query.Dataset
- Specified by:
isInTransaction
in interfaceorg.apache.jena.sparql.core.Transactional
-
setIsolationLevel
public void setIsolationLevel(VirtIsolationLevel level)
-
getIsolationLevel
public VirtIsolationLevel getIsolationLevel()
-
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.query.Dataset
- Specified by:
end
in interfaceorg.apache.jena.sparql.core.Transactional
-
transactionMode
public org.apache.jena.query.ReadWrite transactionMode()
Return the current mode of the transaction - "read" or "write". If the caller is not in a transaction, this method returns null.- Specified by:
transactionMode
in interfaceorg.apache.jena.sparql.core.Transactional
-
transactionType
public org.apache.jena.query.TxnType transactionType()
Return the transaction type used inbegin(TxnType)
. If the caller is not in a transaction, this method returns null.- Specified by:
transactionType
in interfaceorg.apache.jena.sparql.core.Transactional
-
close
public void close()
-
addLink
protected void addLink(VirtGraph obj)
-
removeLink
protected void removeLink(VirtGraph obj)
-
asDatasetGraph
public org.apache.jena.sparql.core.DatasetGraph asDatasetGraph()
Get the dataset in graph form- Specified by:
asDatasetGraph
in interfaceorg.apache.jena.query.Dataset
-
-