as_rdf: Coerce an object into RDF

Description Usage Arguments Examples

View source: R/as_rdf.R

Description

Coerce an object into RDF

Usage

1
2
3
4
5
6
7
8
as_rdf(
  x,
  rdf = NULL,
  prefix = NULL,
  base = getOption("rdf_base_uri", "localhost://"),
  context = NULL,
  key_column = NULL
)

Arguments

x

an object to coerce into RDF (list, list-like, or data.frame)

rdf

An existing rdf object, (by default a new object will be initialized)

prefix

A default vocabulary (URI prefix) to assume for all predicates

base

A base URI to assume for blank subject nodes

context

a named list mapping any string to a URI

key_column

name of a column which should be treated as the primary key in a table. must be unique

Examples

1
2
as_rdf(mtcars)
as_rdf(list(repo = "rdflib", owner = list("id", "ropensci")))

Example output

Warning message:
In poor_mans_nquads(df, file, ...) : prefix not declared, using df:

rdflib documentation built on Jan. 10, 2020, 9:07 a.m.