In this article you will learn how to find items and knowledge on Wikidata via the WikidataR functions.
Search Wikidata to see if an item exists (example: pharmaceuticals)
For cases where you don’t already know the QID of an item or the PID of a property, you can search wikidata by name. Note that some search terms will return multiple possible items. You can also specify a language (defaults to English).
find_item("Paracetamol")
#>
#> Wikidata item search
#>
#> Number of results: 10
#>
#> Results:
#> 1 paracetamol (Q57055) - chemical compound with antipyretic and pain relieving properties
#> 2 Paracetamol (Q54982056) - musical group
#> 3 paracetamol toxicity (Q2572879) - poisoning by drugs
#> 4 Paracetamol ADME (Q113000901) - An instance of the biological pathway in Homo sapiens with Reactome ID (R-HSA-9753281)
#> 5 Carla García Barber (Q20744865) - Spanish doctor, model, and beauty pageant title holder
#> 6 acetaminophen/tramadol (Q48564239) - combination drug
#> 7 Paracetamolo (Q53614484) - 2018 single by Calcutta
#> 8 acetaminophen glucuronide (Q27115028) - chemical compound
#> 9 Paracetamol for treating fever in children (Q28193258)
#> 10 Paracetamol Discontinuation in the Elderly After Long-term Consumption (Q99081663) - clinical trial
find_property("medical condition treated")
#>
#> Wikidata property search
#>
#> Number of results: 1
#>
#> Results:
#> 1 medical condition treated (P2175) - disease that this pharmaceutical drug, procedure, or therapy is used to treatWhich returns the lists:
acetaminophen (Q57055) - common drug for pain and fever
Paracetamol (Q36716177) - scientific article published on July 1980
Paracetamol (Q54982056) - musical group
...
and
medical condition treated (P2175) - disease that this pharmaceutical drug, procedure, or therapy is used to treat
Elements within those lists include basic information from wikidata (ID, description, labels). The QID or PID can then be used to get the full data for the item (see below).