This function takes a component of a triple pattern as input and returns (if it exists) a corresponding human-readable label.
get_label.Rd
This function takes a component of a triple pattern as input and returns (if it exists) a corresponding human-readable label.
Arguments
- string
the string (a part of a triple pattern) to label
- language
the language in which to return the label (defaults to "en")
- endpoint
the SPARQL endpoint that is being queried (defaults to "wikidata")
- label_property
the name of the labelling property, for instance "skos:prefLabel". Defaults to "rdfs:label". If the endpoint is one of the usual glitter endpoints (see glitter::usual_endpoints) the labelling property is set accordingly.
Examples
get_label("wd:Q152088",language="en")
#> [1] "fries"
get_label("wd:Q152088",language="fr")
#> [1] "frite"
get_label(c("wdt:P31","wdt:P625","'David Bowie'","?item"), language="fr")
#> [1] "nature de l’élément" "coordonnées géographiques"
#> [3] "'David Bowie'" "?item"
get_label("hal:structure",endpoint="hal")
#> [1] "hal:structure"