View source: R/lib_data_loader.R
| resolve_via_ckan_search | R Documentation |
Fallback for resolve_via_ckan() when the dataset slug has changed.
Derives the CKAN portal base URL from the provenance's package_show
endpoint, runs a package_search query (from resource$search_query,
or derived from the name-match pattern), and returns the URL of the
first matching resource, preferring CSV format when specified.
resolve_via_ckan_search(provenance)
provenance |
A provenance list as returned by |
The matched resource URL as a character string, or NULL if no
query or base URL can be derived, the request fails, or nothing
matches.
# Missing fields return NULL rather than erroring:
resolve_via_ckan_search(list())
prov <- list(
dataset = list(ckan_api_endpoint = paste0(
"https://data.ontario.ca/api/3/action/package_show",
"?id=ontario-public-library-statistics")),
resource = list(name_match_pattern = "2014",
search_query = "public library statistics")
)
resolve_via_ckan_search(prov)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.