AtomIVariable x = new AtomIVariable("x");
AtomIVariable y = new AtomIVariable("y");
List<RuleAtom> body = Arrays.<RuleAtom> asList(new ClassAtom(A, x),
new IndividualPropertyAtom(r, y, new AtomIConstant(b)),
new DatavaluedPropertyAtom(p, y, new AtomDConstant(TermFactory.literal(true))));
List<RuleAtom> head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(t)));
kb.addRule(new Rule(head, body));
body = Arrays.<RuleAtom> asList(new ClassAtom(A, x),
new IndividualPropertyAtom(r, y, new AtomIConstant(b)),
new DatavaluedPropertyAtom(p, y, new AtomDConstant(TermFactory.literal(false))));
head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(f)));
kb.addRule(new Rule(head, body));
assertIteratorValues(kb.getDataPropertyValues(q, a).iterator(), t);