write_nquads: write object out as nquads

Description Usage Arguments Examples

View source: R/write_nquads.R

Description

write object out as nquads

Usage

1
2
write_nquads(x, file, prefix = NULL, compress = grepl("[.]gz$", file),
  ...)

Arguments

x

an object that can be represented as nquads

file

output filename

prefix

URI prefix that should be used to identify column names. Can be of the form "http://schema.org/", or "iris:".

compress

Compress nquads with gzip? (Very effective for large files. Note that Virtuoso and other parsers can read compressed files directly.)

...

additional parameters, see examples

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
iris_file <- tempfile(fileext = ".nq.gz")
library(datasets)
write_nquads(iris, iris_file)

# Use key_column to indicate that a column should be treated
# as the primary key.  This column is then prefixed (if not
# already a URI) and used as the subject for the corresponding
# rows.
car_file <- tempfile(fileext = ".nq")
mtcars$model <- rownames(mtcars)
mtcars$car_id <- 1:length(mtcars[[1]])
write_nquads(mtcars,
             car_file,
             prefix = "mtcars",
             key_column = "car_id")

cboettig/rdftools documentation built on May 6, 2019, 1:35 a.m.