construct_filter: Construct SPARQL filter

Description Usage Arguments Details Value Examples

View source: R/construct_filter.R

Description

This query derives SPARQL filter statement using the IN syntax.

Usage

1
construct_filter(sparql_variable, filter_values, use_str = FALSE)

Arguments

sparql_variable

A character scalar to be used in IN clause, without ?.

filter_values

A vector of filter values to be verified against in the filter statement.

use_str

A logical, defaults to FALSE, if TRUE it produces str(?variable) instead of ?variable.

Details

For instance, arguments sparql_variable = "time" and filter_values = c(2011, 2012) will result in a expression FILTER (?time IN ( "2011, 2012" )).

Value

A character scalar corresponding to SPARQL filter expression.

Examples

1
2
3
4
5
6
# 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))
SmarterScotland:::construct_filter(sparql_variable = "time", use_str = TRUE,
                                   filter_values = c(2011, 2012))

konradedgar/SmarterScotland documentation built on Oct. 3, 2019, 11:46 a.m.