WikipediaArticleResource extends AbstractResource { public boolean containsEntity(Entity entity) throws LexicalSemanticResourceException { return containsLexeme(entity.getFirstLexeme()); } WikipediaArticleResource(String host, String database, String user, String password, Language language);  WikipediaArticleResource(DatabaseConfiguration dbConfig);  WikipediaArticleResource(Wikipedia wiki); 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(); Set<String> getRelatedLexemes(String lexeme, PoS pos, String sense, LexicalRelation lexicalRelation); int getShortestPathLength(Entity e1, Entity e2); String getGloss(Entity entity); Set<Entity> getRelatedEntities(Entity entity, SemanticRelation semanticRelation); @Override Entity getRoot(); @Override Entity getRoot(PoS pos); @Override Entity getMostFrequentEntity(String lexeme); @Override Entity getMostFrequentEntity(String lexeme, PoS pos);  }
@Test public void testContainsEntity() throws LexicalSemanticResourceException { wikiResource.setIsCaseSensitive(false); assertTrue(wikiResource.containsEntity(new Entity("TK1"))); Entity SIR = new Entity("SIR"); System.out.println("SIR Entity: " + SIR); assertTrue(wikiResource.containsEntity(new Entity("SIR"))); assertTrue(wikiResource.containsEntity(new Entity( "Semantic Information Retrieval"))); assertTrue(wikiResource.containsEntity(new Entity("Unconnected page"))); assertFalse(wikiResource.containsEntity(new Entity("TK4"))); wikiResource.setIsCaseSensitive(true); assertTrue(wikiResource.containsEntity(new Entity("TK1"))); assertFalse(wikiResource.containsEntity(new Entity("tK1"))); assertTrue(wikiResource.containsEntity(new Entity("SIR"))); assertFalse(wikiResource.containsEntity(new Entity("sIR"))); assertTrue(wikiResource.containsEntity(new Entity( "Semantic Information Retrieval"))); assertFalse(wikiResource.containsEntity(new Entity( "semantic Information Retrieval"))); assertTrue(wikiResource.containsEntity(new Entity("Unconnected page"))); assertFalse(wikiResource.containsEntity(new Entity("unconnected page"))); assertFalse(wikiResource.containsEntity(new Entity("TK4"))); }