as_sid: Convert an input to a source property SID

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Convert an input string to the most likely source SID (equivalent to PID)

Usage

1
as_sid(x)

Arguments

x

a vector, data frame, or tibble of strings representaing wikidata source properties

Value

if the inputted string is a valid SID, return the string. If the inputted string matches a property label, return its SID If the inputted string matches multiple labels of multiple properties, return the SID of the first hit.

Examples

1
2
3
4
5
6
# if input string is a valid SID
as_pid("S854")
# if input string matches multiple item labels
as_pid("URL")
# if input string matches a single unique label
as_pid("Reference URL")

WikidataR documentation built on Nov. 16, 2021, 5:07 p.m.