WikibaseDataFetcher { public EntityDocument getEntityDocument(String entityId) throws MediaWikiApiErrorException, IOException { return getEntityDocuments(entityId).get(entityId); } WikibaseDataFetcher(ApiConnection connection, String siteUri); static WikibaseDataFetcher getWikidataDataFetcher(); static WikibaseDataFetcher getWikimediaCommonsDataFetcher(); DocumentDataFilter getFilter(); EntityDocument getEntityDocument(String entityId); Map<String, EntityDocument> getEntityDocuments(String... entityIds); Map<String, EntityDocument> getEntityDocuments(List<String> entityIds); EntityDocument getEntityDocumentByTitle(String siteKey, String title); Map<String, EntityDocument> getEntityDocumentsByTitle(
			String siteKey, String... titles); Map<String, EntityDocument> getEntityDocumentsByTitle(
			String siteKey, List<String> titles); MediaInfoIdValue getMediaInfoIdByFileName(String fileName); Map<String, MediaInfoIdValue> getMediaInfoIdsByFileName(String... fileNames); Map<String, MediaInfoIdValue> getMediaInfoIdsByFileName(List<String> fileNames); List<WbSearchEntitiesResult> searchEntities(String search); List<WbSearchEntitiesResult> searchEntities(String search, String language); List<WbSearchEntitiesResult> searchEntities(String search, Long limit); List<WbSearchEntitiesResult> searchEntities(String search, String language, Long limit); List<WbSearchEntitiesResult> searchEntities(WbGetEntitiesSearchData properties);  }
@Test public void testGetEntityDocument() throws IOException, MediaWikiApiErrorException { Map<String, String> parameters = new HashMap<>(); setStandardParameters(parameters); parameters.put("ids", "Q42"); con.setWebResourceFromPath(parameters, this.getClass(), "/wbgetentities-Q6-Q42-P31.json", CompressionType.NONE); EntityDocument result = wdf.getEntityDocument("Q42"); assertNotNull(result); }
@Test public void testGetMissingEntityDocument() throws IOException, MediaWikiApiErrorException { Map<String, String> parameters = new HashMap<>(); setStandardParameters(parameters); parameters.put("ids", "Q6"); con.setWebResourceFromPath(parameters, getClass(), "/wbgetentities-Q6-Q42-P31.json", CompressionType.NONE); EntityDocument result = wdf.getEntityDocument("Q6"); assertNull(result); }
@Test public void testWbGetMediaInfoEntityFromId() throws IOException, MediaWikiApiErrorException { Map<String, String> parameters = new HashMap<>(); this.setStandardParameters(parameters); parameters.put("ids", "M65057"); con.setWebResourceFromPath(parameters, getClass(), "/wbgetentities-RandomImage.jpg.json", CompressionType.NONE); EntityDocument result = wdf.getEntityDocument("M65057"); assertEquals("M65057", result.getEntityId().getId()); }