View source: R/dataset_to_triples.R
| dataset_to_triples | R Documentation |
Converts a dataset to RDF-style triples with subject, predicate, and object columns. Supports semantic expansion via variable metadata.
dataset_to_triples(x, idcol = NULL, expand_uri = TRUE, format = "data.frame")
x |
A |
idcol |
Name or index of the subject column. If NULL, defaults to
|
expand_uri |
Logical; if TRUE, expands URIs using namespaces and definitions. |
format |
Output format: |
For publishing examples, a minimal serverless scaffold is provided at https://github.com/dataobservatory-eu/dataset-template, which shows how to host CSV + RDF serialisations on GitHub Pages without any server setup.
Either a data.frame with columns s, p, and o, or a character
vector of N-Triple lines.
A simple, serverless scaffolding for publishing dataset_df objects
on the web (with HTML + RDF exports) is available at
https://github.com/dataobservatory-eu/dataset-template.
# A minimal example with just rowid and geo
data("gdp", package = "dataset")
small_geo <- dataset_df(
geo = defined(
gdp$geo[1:3],
label = "Geopolitical entity",
concept = "http://example.com/prop/geo",
namespace = "https://dd.eionet.europa.eu/vocabulary/eurostat/geo/$1"
)
)
# View as triple table
dataset_to_triples(small_geo)
# View as N-Triples
dataset_to_triples(small_geo, format = "nt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.