ATermAppl f = TermFactory.literal("f");
AtomIVariable x = new AtomIVariable("x");
AtomDVariable y = new AtomDVariable("y");
List<RuleAtom> body = Arrays.<RuleAtom> asList(new ClassAtom(A, x),
new DatavaluedPropertyAtom(p, new AtomIConstant(b), y),
new BuiltInAtom(SWRLB + "equal", 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 DatavaluedPropertyAtom(p, new AtomIConstant(b), y),
new BuiltInAtom(SWRLB + "equal", y, new AtomDConstant(TermFactory.literal(false))));
head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(f)));
kb.addRule(new Rule(head, body));