You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Greg Albiston <an...@apache.org> on 2017/10/19 10:52:41 UTC
CMS diff: TDB Datasets
Clone URL (Committers only):
https://cms.apache.org/redirect?new=anonymous;action=diff;uri=http://jena.apache.org/documentation%2Ftdb%2Fdatasets.mdtext
Greg Albiston
Index: trunk/content/documentation/tdb/datasets.mdtext
===================================================================
--- trunk/content/documentation/tdb/datasets.mdtext (revision 1812597)
+++ trunk/content/documentation/tdb/datasets.mdtext (working copy)
@@ -65,5 +65,22 @@
`urn:x-arq:UnionGraph` using
`Dataset.getNamedModel("urn:x-arq:UnionGraph")` .
+## Dataset Inferencing
+Inferencing on a Model in a Dataset, using the [TDB Java API](java_api.html), follows the same pattern as an in-memory InfModel.
+The use of [TDB Transactions](tdb_transactions.html) is **strongly** recommended to avoid data corruption.
+ //Open TDB Dataset
+ String directory = ...
+ Dataset dataset = TDBFactory.createDataset(directory);
+
+ //Retrieve Named Graph from Dataset, or use Default Graph.
+ String graphURI = "http://example.org/myGraph";
+ Model model = dataset.getNamedModel(graphURI);
+
+ //Create RDFS Inference Model, or use other Reasoner e.g. OWL.
+ InfModel infModel = ModelFactory.createRDFSModel(model);
+
+ ...
+ //Perform operations on infModel.
+ ...
\ No newline at end of file