spq_mutate | R Documentation |
Create and modify variables in the results
spq_mutate(
.query,
...,
.label = NA,
.within_box = c(NA, NA),
.within_distance = c(NA, NA)
)
.query |
a list with elements of the query |
... |
variables by which to arrange
(or SPARQL strings escaped with |
.label |
|
.within_box |
if provided, rectangular bounding box for the triple query. Provided as list(southwest=c(long=...,lat=...),northeast=c(long=...,lat=...)) |
.within_distance |
if provided, circular bounding box for the triple query. Provided as list(center=c(long=...,lat=...), radius=...), with radius in kilometers. The center can also be provided as a variable (for instance, "?location") for the center coordinates to be retrieved directly from the query. |
A query object
# common name of a plant species in different languages # the triplet pattern "wd:Q331676 wdt:P1843 ?statement" # creates the variable statement # hence our writing it in reverse within the spq_mutate() function spq_init() %>% spq_mutate(statement = wdt::P1843(wd::Q331676)) %>% spq_mutate(lang = lang(statement))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.