Class MediaInfoIdQueryAction

java.lang.Object
org.wikidata.wdtk.wikibaseapi.MediaInfoIdQueryAction

public class MediaInfoIdQueryAction extends Object
Action for MediaInfoId retrieval.
Author:
Lu Liu
  • Constructor Details

    • MediaInfoIdQueryAction

      public MediaInfoIdQueryAction(ApiConnection connection, String siteIri)
  • Method Details

    • getMediaInfoIds

      public Map<String,MediaInfoIdValue> getMediaInfoIds(List<String> fileNames) throws IOException, MediaWikiApiErrorException
      Fetches the MediaInfoIds of files with the given names.

      This method only works with file name (e.g. "File:Albert Einstein Head.jpg"). The "File:" prefix can be omitted, in this case, it will be automatically added during processing. For example, "Albert Einstein Head.jpg" will be processed as "File:Albert Einstein Head.jpg".

      Notice that pages other than file pages will also be fitted with the "File:" prefix. For example, "Main Page" will be processed as "File:Main Page", which doesn't exist. So always make sure you are dealing with file name.

      Parameters:
      fileNames - list of file names of the requested MediaInfoIds
      Returns:
      map from file names for which data could be found to the MediaInfoIds that were retrieved
      Throws:
      IOException
      MediaWikiApiErrorException