Convert an input string to the most likely item QID.
Value
if the inputted string is a valid QID, return the string. If the inputted string matches an item label, return its QID. If the inputted string matches multiple labels of multiple items, return the QID of the first hit.
Examples
# if input string is a valid QID
as_qid("Q42")
#> # A tibble: 1 × 1
#> x
#> <chr>
#> 1 Q42
# if input string matches multiple item labels
as_qid("Douglas Adams")
#> Multiple exact matches for "Douglas Adams"
#> match 1 = (Q28421831) American environmental engineer
#> match 2 = (Q42) English science fiction writer and humorist (1952–2001)
#> match 3 = (Q21454969) British painter (1853-1920)
#> match 4 = (Q75824389) Peerage person ID=348982
#> match 5 = (Q5301194) Wikimedia disambiguation page
#> match 6 = (Q117249850) Global Co-Head of Equity Capital Markets, Citi
#> # A tibble: 1 × 1
#> x
#> <chr>
#> 1 Q28421831
# if input string matches a single unique label
as_qid("Douglas Adams and the question of arterial blood pressure in mammals")
#> # A tibble: 1 × 1
#> x
#> <chr>
#> 1 Q89525960