Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dataobservatory-eu/turtle
A Turtle converter for R
https://github.com/dataobservatory-eu/turtle
Last synced: 10 days ago
JSON representation
A Turtle converter for R
- Host: GitHub
- URL: https://github.com/dataobservatory-eu/turtle
- Owner: dataobservatory-eu
- License: gpl-3.0
- Created: 2024-01-27T17:35:39.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-06-11T17:20:48.000Z (6 months ago)
- Last Synced: 2024-12-08T04:42:52.505Z (15 days ago)
- Language: R
- Homepage: https://turtle.dataobservatory.eu/
- Size: 552 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codemeta: codemeta.json
Awesome Lists containing this project
README
---
output: github_document
---```{r setupknitr, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/",
out.width = "100%"
)
```[![lifecycle](https://lifecycle.r-lib.org/articles/figures/lifecycle-experimental.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Project Status: WIP](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![dataobservatory](https://img.shields.io/badge/ecosystem-dataobservatory.eu-3EA135.svg)](https://dataobservatory.eu/)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11582410.svg)](https://zenodo.org/records/10576998)The goal of tuRtle is to parse or export R data with the Turtle syntax for the Resource Description Framework (RDF). This is a very early version that is being co-developed with the [dataset](https://dataset.dataobservatory.eu/) package.
## Installation
You can install the development version of tuRtle with `remotes::install_github()`:
```{r installation, eval=FALSE}
remotes::install_github("dataobservatory-eu/tuRtle", build = FALSE)
```## Example
Let us organise statements into a table of *s* subject, *p* predicate and *o* object:
```{r tdfdef, results='asis'}
tdf <- data.frame (s = c("eg:01","eg:02", "eg:01", "eg:02", "eg:01" ),
p = c("a", "a", "eg-var:", "eg-var:", "rdfs:label"),
o = c("qb:Observation",
"qb:Observation",
"\"1\"^^",
"\"2\"^^",
'"Example observation"')
)knitr::kable(tdf)
```The Turtle serialisation is this, written into an `example_file`. The parameter `ttl_namespace = NULL` results in using the default prefixes of the dataset package.
```{r ttl_example}
library(tuRtle)
example_file<- file.path(tempdir(), "example_ttl.ttl")
ttl_write(tdf=tdf, ttl_namespace = NULL, file_path = example_file)readLines(example_file)
```## Code of Conduct
Please note that the tuRtle project is released with a [Contributor Code of Conduct](https://dataobservatory-eu.github.io/tuRtle/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.