KBBuilder { public void setOntology(RuleSet rules) { this.ontology = rules; }  KnowledgeBase build(); void setStore(Store store); void setOntology(RuleSet rules); void addAll(CloseableIterator<?> it); void add(Rule rule); void add(Rule rule, Mapper mapper); void addRules(CloseableIterator<?> it); void addRules(CloseableIterator<?> it, Mapper mapper); void add(Atom atom); void add(Atom atom, Mapper mapper); void addAtoms(CloseableIterator<?> it); void addAtoms(CloseableIterator<?> it, Mapper mapper); void setApproach(Approach approach);  }
@Test public void testSetOntology() throws ParseException { KBBuilder kbb = new KBBuilder(); Ontology ontology = new DefaultOntology(); Rule r1 = DlgpParser.parseRule("[R1] p(X) :- q(X)."); ontology.add(r1); kbb.setOntology(ontology); KnowledgeBase kb = kbb.build(); Assert.assertEquals(r1, kb.getRule("R1")); Assert.assertEquals(1, kb.getOntology().size()); }