WikipediaCategoryResource extends AbstractResource { public Set<Entity> getChildren(Entity entity) throws LexicalSemanticResourceException { Set<Entity> children = new HashSet<Entity>(); Category cat = null; String lexeme = WikipediaCategoryUtils.getCaseSensitiveLexeme(entity.getFirstLexeme(), isCaseSensitive); if (lexeme == null) { return children; } try { cat = wiki.getCategory(lexeme); if (cat == null) { return children; } Set<Category> childCategories = cat.getChildren(); for (Category childCategory : childCategories) { children.add(new Entity(childCategory.getTitle().getWikiStyleTitle())); } } catch (WikiApiException e) { throw new LexicalSemanticResourceException(e); } return children; } WikipediaCategoryResource(DatabaseConfiguration dbConfig);  WikipediaCategoryResource(Wikipedia wiki);  WikipediaCategoryResource(String host, String database, String user, String password, Language language); boolean containsEntity(Entity entity); boolean containsLexeme(String lexeme); Set<Entity> getEntity(String lexeme); Set<Entity> getEntity(String lexeme, PoS pos); Set<Entity> getEntity(String lexeme, PoS pos, String sense); Set<Entity> getParents(Entity entity); int getNumberOfEntities(); Iterable<Entity> getEntities(); Set<Entity> getChildren(Entity entity); String getResourceName(); String getResourceVersion(); int getShortestPathLength(Entity firstEntity, Entity secondEntity); @Override Entity getRoot(); @Override Entity getRoot(PoS pos); String getGloss(Entity entity); Set<String> getRelatedLexemes(String lexeme, PoS pos, String sense, LexicalRelation lexicalRelation); Set<Entity> getRelatedEntities(Entity entity, SemanticRelation semanticRelation); @Override Entity getMostFrequentEntity(String lexeme); @Override Entity getMostFrequentEntity(String lexeme, PoS pos);  }
@Test public void testGetChildren() throws Exception { wikiResource.setIsCaseSensitive(false); Set<Entity> children = wikiResource.getChildren(new Entity("UKP")); for (Entity e : children) { System.out.println(e); } Set<String> expectedChildren = new HashSet<String>(); expectedChildren.add("Projects_of_UKP#-|---unk"); expectedChildren.add("People_of_UKP#-|---unk"); expectedChildren.add("Publications_of_UKP#-|---unk"); assertEquals(expectedChildren.size(), children.size()); for (Entity child : children) { assertTrue(child.toString(), expectedChildren.contains(child.toString())); } assertEquals(0, wikiResource.getChildren(new Entity("Research_Staff_of_UKP")) .size()); wikiResource.setIsCaseSensitive(true); children = wikiResource.getChildren(new Entity("uKP")); assertEquals(0, children.size()); }