You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2013/10/06 16:23:29 UTC

svn commit: r1529622 - in /jena/site/trunk/content/documentation/tdb: datasets.mdtext java_api.mdtext

Author: andy
Date: Sun Oct  6 14:23:29 2013
New Revision: 1529622

URL: http://svn.apache.org/r1529622
Log:
Revise TDB documentation; use preferred styles

Modified:
    jena/site/trunk/content/documentation/tdb/datasets.mdtext
    jena/site/trunk/content/documentation/tdb/java_api.mdtext

Modified: jena/site/trunk/content/documentation/tdb/datasets.mdtext
URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/tdb/datasets.mdtext?rev=1529622&r1=1529621&r2=1529622&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/tdb/datasets.mdtext (original)
+++ jena/site/trunk/content/documentation/tdb/datasets.mdtext Sun Oct  6 14:23:29 2013
@@ -14,9 +14,10 @@ unnamed graph of the dataset is held as 
 the named graphs are held in a collection of quad indexes.
 
 Every dataset is obtained via TDBFactory.createDataset(Location)
-within a JVM is the same dataset. If a model is obtained from via
+within a JVM is the same dataset. (If a model is obtained from via
 TDBFactory.createModel(Location) there is a hidden, shared dataset
-and the appropriate model is returned.
+and the appropriate model is returned. The preferred style 
+is to create the dataset, then get a model.)
 
 ## Dataset Query
 

Modified: jena/site/trunk/content/documentation/tdb/java_api.mdtext
URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/tdb/java_api.mdtext?rev=1529622&r1=1529621&r2=1529622&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/tdb/java_api.mdtext (original)
+++ jena/site/trunk/content/documentation/tdb/java_api.mdtext Sun Oct  6 14:23:29 2013
@@ -37,17 +37,19 @@ forced to disk if they have not been wri
 
 ### Using a directory name
 
-      // Direct way: Make a TDB-backed Jena model in the named directory.
-      String directory = "MyDatabases/DB1" ;
-      Model model = TDBFactory.createModel(directory) ;
-      ...
-      model.close() ;
-
-      // Direct way: Make a TDB-backed dataset
+      // Make a TDB-backed dataset
       String directory = "MyDatabases/Dataset1" ;
       Dataset dataset = TDBFactory.createDataset(directory) ;
       ...
-      dataset.close() ;
+      dataset.begin(ReadeWrite.READ) ;
+      // Get model inside the transaction
+      Model model = dataset.getDefaultModel() ;
+      dataset.end() ;
+      ... 
+      dataset.begin(ReadeWrite.WRITE) ;
+      model = dataset.getDefaultModel() ;
+      dataset.end() ;
+      ... 
 
 ### Using an assembler file
 
@@ -56,14 +58,13 @@ forced to disk if they have not been wri
       // The assembler file is a configuration file.
       // The same assembler description will work in Fuseki.
       String assemblerFile = "Store/tdb-assembler.ttl" ;
-      Model model = TDBFactory.assembleModel(assemblerFile) ;
-      ...
-      model.close() ;
-
-      String assemblerFile = "Store/tdb-assembler.ttl" ;
       Dataset dataset = TDBFactory.assembleDataset(assemblerFile) ;
       ...
-      dataset.close() ;
+      dataset.begin(ReadeWrite.READ) ;
+      // Get model inside the transaction
+      Model model = dataset.getDefaultModel() ;
+      dataset.end() ;
+      ...
 
 See
 [the TDB assembler documentation](assembler.html)
@@ -71,7 +72,7 @@ for details.
 
 ## Bulkloader
 
-The bulkloader is a faster way to load data into an empty graph
+The bulkloader is a faster way to load data into an empty dataset
 than just using the Jena update operations.
 
 It is accessed through the command line utility `tdbloader`.
@@ -97,16 +98,12 @@ blocks. It is important to flush all cac
 consistent with the cached states because some caches are
 write-behind so unwritten changes may be held in-memory.
 
-TDB provides an explicit call for model and dataset objects for
+TDB provides an explicit call dataset objects for
 synchronization with disk:
 
-      Model model = ... ;
-      TDB.sync(model) ;
-
       Dataset dataset = ...  ;
       TDB.sync(dataset ) ;
 
 Any dataset or model can be passed to these functions - if they are
 not backed by TDB then no action is taken and the call merely
 returns without error.
-