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 classVirtDataset.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)protectedVirtDataset(VirtGraph g)
-
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)protected voidaddLink(VirtGraph obj)VirtDatasetaddNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model)Set a named graph.VirtDatasetaddNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model, boolean checkExists)Set a named graph.org.apache.jena.sparql.core.DatasetGraphasDatasetGraph()Get the dataset in graph formvoidbegin(org.apache.jena.query.ReadWrite readWrite)Start either a READ or WRITE transactionvoidbegin(org.apache.jena.query.TxnType txnType)voidclose()voidcommit()Commit a transaction - finish the transaction and make any changes permanent (if a "write" transaction)booleancontainsNamedModel(java.lang.String name)Does the dataset contain a model with the name supplied?voidend()Finish the transaction - if a write transaction and commit() has not been called, then abortorg.apache.jena.sparql.util.ContextgetContext()org.apache.jena.rdf.model.ModelgetDefaultModel()Get the default graph as a Jena ModelVirtIsolationLevelgetIsolationLevel()org.apache.jena.shared.LockgetLock()Get the lock for this datasetorg.apache.jena.rdf.model.ModelgetNamedModel(java.lang.String name)Get a graph by name as a Jena Modelorg.apache.jena.rdf.model.ModelgetUnionModel()booleanisInTransaction()Say whether a transaction is activejava.util.Iterator<java.lang.String>listNames()List the namesbooleanpromote(org.apache.jena.sparql.core.Transactional.Promote promote)Attempt to promote a transaction from "read" mode to "write" and the transaction.protected voidremoveLink(VirtGraph obj)VirtDatasetremoveNamedModel(java.lang.String name)Remove a named graph.VirtDatasetreplaceNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model)Change a named graph for another uisng the same nameVirtDatasetsetDefaultModel(org.apache.jena.rdf.model.Model model)Set the background graph.voidsetIsolationLevel(VirtIsolationLevel level)booleansupportsTransactionAbort()booleansupportsTransactions()booleansupportsXATransactions()org.apache.jena.query.ReadWritetransactionMode()Return the current mode of the transaction - "read" or "write".org.apache.jena.query.TxnTypetransactionType()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, createStatisticsHandler, delete, dependsOn, find, find, forTestingOnly_graphBaseFind, getCapabilities, getEventManager, getStatisticsHandler, 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:
getDefaultModelin interfaceorg.apache.jena.query.Dataset
-
getUnionModel
public org.apache.jena.rdf.model.Model getUnionModel()
- Specified by:
getUnionModelin 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:
setDefaultModelin 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:
getNamedModelin 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:
containsNamedModelin interfaceorg.apache.jena.query.Dataset
-
addNamedModel
public VirtDataset addNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model, boolean checkExists) throws org.apache.jena.query.LabelExistsException
Set a named graph.- Throws:
org.apache.jena.query.LabelExistsException
-
addNamedModel
public VirtDataset addNamedModel(java.lang.String name, org.apache.jena.rdf.model.Model model) throws org.apache.jena.query.LabelExistsException
Set a named graph.- Specified by:
addNamedModelin interfaceorg.apache.jena.query.Dataset- Throws:
org.apache.jena.query.LabelExistsException
-
removeNamedModel
public VirtDataset removeNamedModel(java.lang.String name)
Remove a named graph.- Specified by:
removeNamedModelin interfaceorg.apache.jena.query.Dataset
-
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:
replaceNamedModelin interfaceorg.apache.jena.query.Dataset
-
listNames
public java.util.Iterator<java.lang.String> listNames()
List the names- Specified by:
listNamesin interfaceorg.apache.jena.query.Dataset
-
getLock
public org.apache.jena.shared.Lock getLock()
Get the lock for this dataset- Specified by:
getLockin interfaceorg.apache.jena.query.Dataset
-
getContext
public org.apache.jena.sparql.util.Context getContext()
- Specified by:
getContextin interfaceorg.apache.jena.query.Dataset
-
supportsTransactions
public boolean supportsTransactions()
- Specified by:
supportsTransactionsin interfaceorg.apache.jena.query.Dataset
-
supportsXATransactions
public boolean supportsXATransactions()
-
supportsTransactionAbort
public boolean supportsTransactionAbort()
- Specified by:
supportsTransactionAbortin interfaceorg.apache.jena.query.Dataset
-
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.query.Dataset- Specified by:
beginin 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_PROMOTEtreats the promotion as if the transaction was started withREAD_PROMOTE(any other writer commiting since the transaction started blocks promotion) andREAD_COMMITTED_PROMOTEtreats 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_PROMOTEorREAD_COMMITTED_PROMOTEis promoted.This method returns false if a
READ_PROMOTEcan'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
READtransaction.- 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.query.Dataset- 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.query.Dataset- Specified by:
abortin interfaceorg.apache.jena.sparql.core.Transactional
-
isInTransaction
public boolean isInTransaction()
Say whether a transaction is active- Specified by:
isInTransactionin interfaceorg.apache.jena.query.Dataset- Specified by:
isInTransactionin 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:
endin interfaceorg.apache.jena.query.Dataset- Specified by:
endin 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:
transactionModein 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:
transactionTypein 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:
asDatasetGraphin interfaceorg.apache.jena.query.Dataset
-
-