This query derives SPARQL
filter statement using the
IN
syntax.
construct_filter(sparql_variable, filter_values, use_str = FALSE)
sparql_variable | A character scalar to be used in |
---|---|
filter_values | A vector of filter values to be verified against in the filter statement. |
use_str | A logical, defaults to |
A character scalar corresponding to SPARQL filter expression.
For instance, arguments sparql_variable = "time"
and
filter_values = c(2011, 2012)
will result in a expression
FILTER (?time IN ( "2011, 2012" ))
.
# This function is not exported from the package as it's mostly used # internally. SmarterScotland:::construct_filter(sparql_variable = "time", filter_values = c(2011, 2012))#> [1] "FILTER (?time IN ('2011', '2012'))"SmarterScotland:::construct_filter(sparql_variable = "time", use_str = TRUE, filter_values = c(2011, 2012))#> [1] "FILTER (str(?time) IN ('2011', '2012'))"