Returns a character vector of `PREFIX ...` lines used by package queries. The result always includes core vocabularies (SKOS/XKOS/RDFS/DC/RDF/XSD), and—when available—adds classification scheme namespaces discovered via `classificationList(endpoint)`. You can filter to specific schemes with the `prefix` argument.

prefixList(endpoint, prefix = NULL)

Arguments

endpoint

Character. Endpoint name (case-insensitive). Typically `"CELLAR"` or `"FAO"`. The set of supported names is defined by the package's internal endpoint registry (see `.valid_endpoints()`).

prefix

Character vector of scheme tokens to include (e.g., `c("cn2022","nace2")`). If `NULL` (default), returns all discovered schemes.

Value

A character vector of SPARQL PREFIX declarations. Use `paste(result, collapse = "\n")` to inject into a query string.

Details

- This function has no side effects and does not perform network I/O by itself. Discovery is delegated to `classificationList()`.

- If `classificationList()` is unavailable or fails, the function returns only the core vocabularies and emits a warning.

Examples

if (FALSE) { # \dontrun{
# All known scheme prefixes for the endpoint
pl <- prefixList("CELLAR")
cat(paste(pl, collapse = "\n"))

# Only include CN2022 and NACE2 if they exist
pl2 <- prefixList("CELLAR", prefix = c("cn2022", "nace2"))
} # }