Hi all,  I don't think this is a bug, strictly speaking, but it's a
behavior that surprised me a bit, and I'd like to check that it's
expected.  In the Jena 2 Inference Support [1] document, there's this
description of InfModel.getDeductionsModel:

""" Some reasoners, notably the forward chaining rule engine, store
the deduced statements in a concrete form and this set of deductions
can be obtained separately by using the getDeductionsModel() call.
""""

In the description of getDeductionsModel from the InfModel Javadoc:

""" Model getDeductionsModel() --- Returns a derivations model. The
rule reasoners typically create a graph containing those triples added
to the base graph due to rule firings. In some applications it can
useful to be able to access those deductions directly, without seeing
the raw data which triggered them. In particular, this allows the
forward rules to be used as if they were rewrite transformation rules.
"""

Finally, from the description of GenericRuleReasoner [3], particular,
for filterFunctors and setFunctorFiltering,

""" public boolean filterFunctors --- Flag, if true then find results
will be filtered to remove functors and illegal RDF ...
public void setFunctorFiltering(boolean param) --- Set to true to
cause functor-valued literals to be dropped from rule output. Default
is true. """

However, it seems that while queries to an InfModel or OntModel backed
by a GenericRuleReasoner filter out functors, and functors don't
appear when an OntModel is written with OntModel.writeAll, the Model
returned by InfModel.getDeductionsModel includes the functors,
regardless of the value of filterFunctors.  I don't know whether the
Model returned by getDeductionsModel should be considered as part of
"the results" from which functors should be filtered or not, but not
filtering functors from getDeductionsModel certainly does make the use
of "forward rules ... as if they were rewrite transformation rules"
more complicated.

So, is this the expected behavior?  Is there an easy way to filter
functors from the deductions model? (I see that there is
Functor.acceptFilter, and that might be a start...)

Thanks in advance,
//JT

[1] http://openjena.org/inference/#RULEbuiltins
[2] 
http://incubator.apache.org/jena/documentation/javadoc/jena/com/hp/hpl/jena/rdf/model/InfModel.html#getDeductionsModel%28%29
[3] 
http://incubator.apache.org/jena/documentation/javadoc/jena/com/hp/hpl/jena/reasoner/rulesys/GenericRuleReasoner.html#setFunctorFiltering%28boolean%29
-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

Reply via email to