DefaultKnowledgeBase extends AbstractProfilable implements KnowledgeBase { @Override public Set<String> getRuleNames() { return this.ruleset.getRuleNames(); } DefaultKnowledgeBase(Parser<Object> parser);  DefaultKnowledgeBase(AtomSet store, Parser<Object> parser);  DefaultKnowledgeBase(AtomSet store, RuleSet ontology); @Override RuleSet getOntology(); @Override AtomSet getFacts(); GraphOfRuleDependencies getGraphOfRuleDependencies(); @Override boolean isConsistent(); @Override void saturate(); @Override void semiSaturate(); @Override CloseableIterator<Substitution> homomorphism(Query query); @Override CloseableIterator<Substitution> query(Query query); @Override CloseableIterator<Substitution> query(Query query, long timeout); @Override void close(); @Override Set<String> getRuleNames(); @Override Rule getRule(String name); @Override boolean addQuery(Query query); @Override Set<String> getQueryNames(); @Override Query getQuery(String name); @Override Approach getApproach(); @Override String toString();  }
@Test public void testGetRuleNames() throws ParseException { Rule r1 = DlgpParser.parseRule("[R1] p(x) :- q(X)."); Rule r2 = DlgpParser.parseRule("[R2] q(x) :- r(X)."); AtomSet store = new DefaultInMemoryGraphStore(); RuleSet ruleset = new LinkedListRuleSet(); ruleset.add(r1); ruleset.add(r2); KnowledgeBase kb = new DefaultKnowledgeBase(store, ruleset); Assert.assertTrue(kb.getRuleNames().contains("R1")); Assert.assertTrue(kb.getRuleNames().contains("R2")); Assert.assertEquals(r1, kb.getRule("R1")); Assert.assertEquals(r2, kb.getRule("R2")); kb.close(); }