On Wed, 2012-01-18 at 12:11 +0900, Rathachai Chawuthai wrote: > Dear, > > When I use reasoner with my rules and my ontology, the result statement > includes source RDF, ontology RDF, and newly generated statement. > How can I get only newly inferred statement?
If the reasoning is purely with your own rules then write your rules as forward rules and use getDeductionsModel to obtain the new inferences. If you are building on top of the RDFS rule set then replace that by the minimal set of RDFS forward rules as described in [1]. If you are building on top of the OWL rule sets (which use a hybrid mix of forward and backward) or need to use hybrid rules yourself then there's no neat way to get only the inferences. In that case you need to get all the inference closure and subtract out the base statements. You can do that by (a) creating a plain copying and adding/removing models to it or (b) using dynamic Differences (see com.hp.hpl.jena.graph.compose). Dave [1] http://incubator.apache.org/jena/documentation/inference/#RDFSPlusRules
