I am trying to learn how Jena and GenericRuleReasoner works. I took this from Apache Jena tutorial.
[transitiveRule: (?A demo:p ?B), (?B demo:p ?C) -> (?A > demo:p ?C) ]
[symmetricRule: (?Y demo:p ?X) -> (?X demo:p ?Y) ]
If I want to add another statement
[testPrintRule: (?X demo:p ?Y) -> print(?Y, "for testing")] //Print only this
Is it possible for me to only list statement in print command? The print statement is printed in console. I want to display in my UI.
This is what I am currently doing in Jena to get the triples. I am sorry if I am wrong, I am a beginner.
Property p = ReadOntology.model.getProperty(ns + "demo:p");
List rules = Rule.rulesFromURL(FileLocations.getRulesLoc());
Reasoner reasoner = new GenericRuleReasoner( rules );
InfModel infModel = ModelFactory.createInfModel( reasoner, ReadOntology.model);
StmtIterator train = infModel.listStatements(null, p, (RDFNode)null);