On 15/05/13 18:47, David Jordan wrote:
Andy, Please clarify something. In this reply, you state * Put the
ontology in one named graph and the individuals in another one, or
the default graph, and hence in the same database? * You can put a
single graph from TDB into a general dataset or just work with that
one graph (transactions will not work across a mixture of graphs in a
dataset).
You then reference the online docs that state: It is possible to use
just one of the graphs from the dataset. A common way of working with
one graph is to use the default graph of the dataset.
Dataset dataset = DatasetFactory.createMem() ;
Dataset tdb = TDBFactory.createDataset() ;
// Pick one graph/model out of the dataset.
Model m1 = tdb.getNamedModel("http://example/tdb/graph") ;
dataset.addNamedModel("http://example/individuals", m1) ;
// A model with completely different storage
Model m2 = ModelFactory.createDefaultModel() ;
dataset.addNamedModel("http://example/ontology", m2) ;
... a dataset with a mix of model storage implementations.
My code uses the interface com.hp.hpl.jena.query.Dataset. It allows
me to start/stop transactions and to access named models. I can
access multiple named models. Isn't a model a graph in the database?
Isn't a graph == model == graph ? You say that "transactions will not
work across a mixture of graphs in a dataset". So a given
com.hp.hpl.jena.query.Dataset object, while it can return multiple
named Models, you cannot use them in the same transaction?
then
dataset.begin(ReadWrite.READ) ;
==> exception. "Transactions not supported"
When you said "a general dataset", are you referring to the default
model/graph, which is stored in a triple table in SDB and essentially
is using the single default graph managed by TDB/SDB?
The kind of dataset returned by DatasetFactory.createMem()
Some of the wording used, both in the documentation and in your
reply, seem vague to me, with multiple interpretations. I don't
believe the single sentence "It is possible to use just one of the
graphs from the dataset." is true.
Could you suggest improvements?
Andy