Wikidata:WikiFactMine/API

The WikiFactMine API is at https://tools.wmflabs.org/wikifactmine-api/#/default. The "mined facts" can be accessed via the API. As of August 2017, there are three options: The API allows one to search for Wikidata Q number, rather than date; and for the occurrence of a pair of Q numbered items.

The "facts" or "mentions" are given with context. There are "prefix" and "post" fields showing the context to be read:

prefix term post

is schematically what appears in the paper. The paper is identified by a PMC ID (see below).

Facts by date edit

Facts by date can be accessed by typing a date in as YYYY-MM-DD format. "Response Body" will show JSON for what is mined.

Going to https://tools.wmflabs.org/wikifactmine-api/#/default and clicking on the 2item option leads to https://tools.wmflabs.org/wikifactmine-api/#!/default/item_0. Adding malaria (Q12156) and quinine (Q189522) in the fields provided and clicking on "Try it out!" gives a sampling of results, with "prefix" and "post" phrases. The relevant paper is identified by its PMC ID.

On the other hand, machine-readable JSON format can be obtained by creating the URL

https://tools.wmflabs.org/wikifactmine-api/api/2item/Q12156/Q189522

and running it.

Details of the paper will now be available on Wikidata. To look up a paper by PMCID (P932), user the Resolver tool, write P932 in the property box, PMC number without prefix, such as 5471985, in the value box, and run by clicking on "Find Wikidata item". That case resolves to War on Two Fronts: The Fight against Parasites in Korea and Vietnam (Q33802364).

Javascript edit

See Wikidata:WikiFactMine/Javascript. This tool gives a sample of the "mentions" available from the API, on the page for the relevant Wikidata item.