Skip to contents

Write a dataset into a Turtle serialisation.

Usage

dataset_ttl_write(
  tdf,
  ttl_namespace = NULL,
  file_path = NULL,
  overwrite = TRUE
)

Arguments

tdf

A dataset in exactly three columns.

ttl_namespace

The namespace definitions of the dataset.

file_path

The path to the file that should be written or appended.

overwrite

If the file exists, overwrite it? Defaults to TRUE.

Value

A text file with the prefix and the observation serialisations.

Examples

testtdf <- data.frame (s = c("eg:o1", "eg:01", "eg:02"),
                       p = c("a", "eg-var:", "eg-var"),
                       o = c("qb:Observation",
                             "\"1\"^^<xs:decimal>",
                             "\"2\"^^<xs:decimal>"))

examplefile <- file.path(tempdir(), "ttl_dataset_write.ttl")

dataset_ttl_write(tdf=testtdf, file_path = examplefile)
#> Error in ttl_observations_write(tdf, file_path): could not find function "ttl_observations_write"

readLines(examplefile)
#> [1] "@prefix  owl:        <http://www.w3.org/2002/07/owl#> ."             
#> [2] "@prefix  qb:         <http://purl.org/linked-data/cube#> ."          
#> [3] "@prefix  rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ."
#> [4] "@prefix  rdfs:       <http://www.w3.org/2000/01/rdf-schema#> ."      
#> [5] "@prefix  xsd:        <http://www.w3.org/2001/XMLSchema#> ."