use of fr.lirmm.graphik.graal.forward_chaining.BasicChase in project graal by graphik-team.
the class RdbmsStoreTest method SQLRuleApplierTest.
// /////////////////////////////////////////////////////////////////////////
// PUBLIC METHODS
// /////////////////////////////////////////////////////////////////////////
@Theory
public void SQLRuleApplierTest(RdbmsStore store) throws AtomSetException, IteratorException, ParseException {
RuleSet ruleSet = new LinkedListRuleSet();
ruleSet.add(DlgpParser.parseRule("<Q>(X,Y) :- <P>(X)."));
ruleSet.add(DlgpParser.parseRule("<R>(Y) :- <Q>(X,Y)."));
Atom a = DlgpParser.parseAtom("<P>(a).");
store.add(a);
Chase chase = new BasicChase<RdbmsStore>(ruleSet, store, new SQLRuleApplier(SqlHomomorphism.instance()));
try {
chase.execute();
} catch (ChaseException e) {
Assert.fail(e.getMessage());
}
CloseableIterator<Atom> it = store.iterator();
int count = Iterators.count(it);
Assert.assertEquals(3, count);
}
Aggregations