-
Notifications
You must be signed in to change notification settings - Fork 1
Using Wikidata to build a list of care related Wikipedia articles
Alberto Cottica edited this page Dec 29, 2015
·
1 revision
WikiProject: Medicine keeps a list of its articles. However, that does not exhaust the list of health-related Wikipedia articles. At the very minimum, we need to account for the different Wikipedias: the list keeps track of English Wikipedia, and as such it lists "aspirin", but it does not list "aspirina", which appears in Italian Wikipedia (and redirects to "Acido Acetilsalicilico").
With help from the wonderful Maxime Lathuilière, we figured out how to use Wikidata to fetch the titles of Wikipedia articles of all languages starting from English Wikipedia's list of articles. Pseudocode:
# builds a list of WikiData IDs based on a list of titles
wikiDataIDs = []
for englishTitle in englishTitles:
WDID = wikiData identifier associated to englishTitle
wikiDataIDs.append(WDID)
# builds a list of titles based on the above list of WikiData IDs
allLanguageTitles = []
for ID in wikiDataIDs:
thisIDTitles = getItemsbyID(ID)
for title in thisIDTitles:
allLanguageTitles.append(title)