diff --git a/R/spq_select.R b/R/spq_select.R index 693276b..518e784 100644 --- a/R/spq_select.R +++ b/R/spq_select.R @@ -6,8 +6,19 @@ #' @export #' @examples #' -#' query = spq_init() -#' spq_select(query, count = n (human), eyecolor_label, haircolor_label) +#' spq_init() |> +#' spq_prefix(prefixes = c(dct = "http://purl.org/dc/terms/")) |> +#' spq_add(spq('?lexemeId dct:language wd:Q1860')) |> +#' spq_mutate(lemma = wikibase::lemma(lexemeId)) |> +#' spq_filter(str_detect(lemma, '^pota.*')) |> +#' spq_select(- lemma) +#' +#' spq_init() |> +#' spq_prefix(prefixes = c(dct = "http://purl.org/dc/terms/")) |> +#' spq_add(spq('?lexemeId dct:language wd:Q1860')) |> +#' spq_mutate(lemma = wikibase::lemma(lexemeId)) |> +#' spq_filter(str_detect(lemma, '^pota.*')) |> +#' spq_select(lemma) spq_select = function(.query = NULL, ..., .spq_duplicate = NULL){ if (!is.null(.spq_duplicate)) { original_spq_duplicate = .spq_duplicate diff --git a/man/spq_select.Rd b/man/spq_select.Rd index 858dc57..d0a19ab 100644 --- a/man/spq_select.Rd +++ b/man/spq_select.Rd @@ -23,6 +23,17 @@ Select (and create) particular variables } \examples{ -query = spq_init() -spq_select(query, count = n (human), eyecolor_label, haircolor_label) +spq_init() |> + spq_prefix(prefixes = c(dct = "http://purl.org/dc/terms/")) |> + spq_add(spq('?lexemeId dct:language wd:Q1860')) |> + spq_mutate(lemma = wikibase::lemma(lexemeId)) |> + spq_filter(str_detect(lemma, '^pota.*')) |> + spq_select(- lemma) + +spq_init() |> + spq_prefix(prefixes = c(dct = "http://purl.org/dc/terms/")) |> + spq_add(spq('?lexemeId dct:language wd:Q1860')) |> + spq_mutate(lemma = wikibase::lemma(lexemeId)) |> + spq_filter(str_detect(lemma, '^pota.*')) |> + spq_select(lemma) }