There's no specific integration of TDB and inference.
The rule-based inference engines themselves run in memory but can
operate over any model, however it is stored. So there are several options.
1. Construct an InfModel over a TDB based model. When you query the
InfModel you will see both the TDB model and any inferences.
2. Load the TDB model into memory then construct an InfModel over that.
Then query the InfModel.
3. Prepare an inference closure and store that. Load the data, e.g. into
memory, construct the InfModel, query the InfModel for the patterns you
are interested in (which might be every triple) store all those results
in a TDB model. Then at run time open the closure TDB as a plain model
and query it.
4. As 3 but use TDB's high performance RDFS-subset closure.
#1 is easy to do but the inference results are stored in memory so it
doesn't enable you to scale to models that wouldn't fit in memory anyway.
#2 can be faster. Inference involves a lot of queries and query to an in
memory model is naturally faster than querying TDB. Whether the cost of
the initial load outweighs the speed of inference depends on how caching
works out, your data and your queries.
#3 gives you good query performance at the cost of an expensive slow
cycle to prepare the data. It's not suited to mutating data and requires
the preparation phase to be run on a machine with enough memory to
compute the closure, or closure subset, that you want.
#4 can cope with much larger data sets than #3 at the expense of a more
limited range of inference.
Dave
On 10/12/13 21:58, Daniel Maatari Okouya wrote:
Dear All,
If they can work together, I would like to understand a bit better the
underlying mechanics of making Jena TDB and the Jena Inference infrastructure
work together.
Hence, I have the following question:
1-Can someone have the Jena TDB act like Stardog, in the sense that if one make
a query that would include inferred triple as well ?
If that is possible, can someone explain to me the underlying mechanics that it
would imply, knowing that i understood the following from the documentation.
Inferred triples are situated in an InfGraph/InfModel(warper), which is
obtained by binding a reasoner to a base Graph/Model (understood as the one
containing the asserted triples). One can query that infGraph using the Querry
engine ( However this is happening on an InMemory models).
My guess here is that if a model is in the TDB, then for our query to include
the inferred triple, this would requires that, the querry to the model is
actually run against the InfModel/Infgraph. However i don’t know if that is
possible and how exactly TDB would do that? Indeed, that would mean choosing a
reasoner, creating the infmodel, and exposing it in lieu of the base model.
Can someone explain a bit that mechanics, that is how it works with Jena TDB,
if one wants some inference. For instance, if the actual model is RDFS or OWL ?
how to query it and obtain answer that include the inferred knowledge. Many
thanks
Best,
-M-
--
Daniel Maatari Okouya
Sent with Airmail