rdflib

:package: High level wrapper around the redland package for common rdf applications

https://github.com/ropensci/rdflib

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (21.4%) to scientific vocabulary

Keywords

peer-reviewed r r-package rstats

Keywords from Contributors

pandoc rmarkdown data-store git-lfs archiving dbi json-ld codemeta genome phylogenetics
Last synced: 9 months ago · JSON representation

Repository

:package: High level wrapper around the redland package for common rdf applications

Basic Info
Statistics
  • Stars: 59
  • Watchers: 9
  • Forks: 10
  • Open Issues: 12
  • Releases: 9
Topics
peer-reviewed r r-package rstats
Created almost 9 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog License Codemeta

README.Rmd

---
output: github_document
---

# rdflib 

 
  [![R-CMD-check](https://github.com/ropensci/rdflib/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/rdflib/actions)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/rdflib)](https://cran.r-project.org/package=rdflib)
[![](http://badges.ropensci.org/169_status.svg)](https://github.com/ropensci/software-review/issues/169)
[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/rdflib)](https://CRAN.R-project.org/package=rdflib)
[![DOI](https://zenodo.org/badge/100521776.svg)](https://zenodo.org/badge/latestdoi/100521776)
  



```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
```



A friendly and consise user interface for performing common
tasks on rdf data, such as parsing and converting between
formats including rdfxml, turtle, nquads, ntriples,
and trig, creating rdf graphs, and performing SPARQL
queries. This package wraps the redland R package which
provides direct bindings to the redland C library. Additionally,
the package supports parsing and serialization of rdf
into json-ld through the json-ld package, which binds
the official json-ld javascript API. The package
interface takes inspiration from the Python rdflib library.

## Installation

You can install rdflib from GitHub with:

```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("ropensci/rdflib")
```


## Basic use

While not required, `rdflib` is designed to play nicely with `%>%` pipes, so we will load the `magrittr` package as well:

```{r, message=FALSE}
library(magrittr)
library(rdflib)
```

Parse a file and serialize into a different format:

```{r parse}
system.file("extdata/dc.rdf", package="redland") %>%
  rdf_parse() %>%
  rdf_serialize("test.nquads", "nquads")
```


Perform SPARQL queries:

```{r sparql}
sparql <-
 'PREFIX dc: 
  SELECT ?a ?c
  WHERE { ?a dc:creator ?c . }'

system.file("extdata/dc.rdf", package="redland") %>%
rdf_parse() %>%
rdf_query(sparql)
```

Initialize graph a new object or add triples statements to an existing graph:

```{r}
x <- rdf()
x <- rdf_add(x, 
    subject="http://www.dajobe.org/",
    predicate="http://purl.org/dc/elements/1.1/language",
    object="en")
x
```

Change the default display format (`nquads`) for graph objects:

```{r}
options(rdf_print_format = "jsonld")
x
```


## JSON-LD

We can also work with the JSON-LD format through additional functions provided in the 
R package, `jsonld`. 

```{r}
out <- tempfile()
rdf_serialize(x, out, "jsonld")
rdf_parse(out, format = "jsonld")
```

For more information on the JSON-LD RDF API, see .

```{r include=FALSE}
unlink("test.nquads")
unlink(out)
rdf_free(x)
```


## Advanced Use

See [articles](https://docs.ropensci.org/rdflib/articles/) from the documentation for advanced use including applications to large triplestores, example SPARQL queries, and information about additional database backends.  


----

## Citing rdflib


Please also cite the underlying `redland` library when citing `rdflib`

```{r results="asis", warning=FALSE, echo=FALSE}
print(citation("rdflib"), "textVersion")
```

```{r results="asis", warning=FALSE, echo=FALSE}
print(citation("redland"), "text")
```

```{r include=FALSE}
codemeta::write_codemeta()
```


[![rofooter](https://ropensci.org//public_images/github_footer.png)](https://ropensci.org/)

Owner

  • Name: rOpenSci
  • Login: ropensci
  • Kind: organization
  • Email: info@ropensci.org
  • Location: Berkeley, CA

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "identifier": "rdflib",
  "description": "The Resource Description Framework, or 'RDF' is a widely used data representation model that forms the cornerstone of the Semantic Web. 'RDF' represents data as a graph rather than the familiar data table or rectangle of relational databases. The 'rdflib' package provides a friendly and concise user interface for performing common tasks on 'RDF' data, such as reading, writing and converting between the various serializations of 'RDF' data, including 'rdfxml', 'turtle', 'nquads', 'ntriples', and 'json-ld'; creating new 'RDF' graphs, and performing graph queries using 'SPARQL'. This package wraps the low level 'redland' R package which provides direct bindings to the 'redland' C library. Additionally, the package supports the newer and more developer friendly 'JSON-LD' format through the 'jsonld' package. The package interface takes inspiration from the Python 'rdflib' library.",
  "name": "rdflib: Tools to Manipulate and Query Semantic Data",
  "codeRepository": "https://github.com/ropensci/rdflib",
  "issueTracker": "https://github.com/ropensci/rdflib/issues",
  "license": "https://spdx.org/licenses/MIT",
  "version": "0.2.6",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.2.2 (2022-10-31)",
  "provider": {
    "@id": "https://cran.r-project.org",
    "@type": "Organization",
    "name": "Comprehensive R Archive Network (CRAN)",
    "url": "https://cran.r-project.org"
  },
  "author": [
    {
      "@type": "Person",
      "givenName": "Carl",
      "familyName": "Boettiger",
      "email": "cboettig@gmail.com",
      "@id": "https://orcid.org/0000-0002-1642-628X"
    }
  ],
  "contributor": [
    {
      "@type": "Person",
      "givenName": "Viktor",
      "familyName": "Senderov",
      "email": "vsenderov@gmail.com",
      "@id": "https://orcid.org/0000-0003-3340-5963"
    }
  ],
  "copyrightHolder": [
    {
      "@type": "Person",
      "givenName": "Carl",
      "familyName": "Boettiger",
      "email": "cboettig@gmail.com",
      "@id": "https://orcid.org/0000-0002-1642-628X"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "Carl",
      "familyName": "Boettiger",
      "email": "cboettig@gmail.com",
      "@id": "https://orcid.org/0000-0002-1642-628X"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "magrittr",
      "name": "magrittr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=magrittr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "covr",
      "name": "covr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=covr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "testthat",
      "name": "testthat",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=testthat"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "knitr",
      "name": "knitr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=knitr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rmarkdown",
      "name": "rmarkdown",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rmarkdown"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "jqr",
      "name": "jqr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=jqr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "DT",
      "name": "DT",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=DT"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "tibble",
      "name": "tibble",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=tibble"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "purrr",
      "name": "purrr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=purrr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "lubridate",
      "name": "lubridate",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=lubridate"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "httr",
      "name": "httr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=httr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "xml2",
      "name": "xml2",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=xml2"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "jsonlite",
      "name": "jsonlite",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=jsonlite"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "repurrrsive",
      "name": "repurrrsive",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=repurrrsive"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "nycflights13",
      "name": "nycflights13",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=nycflights13"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "spelling",
      "name": "spelling",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=spelling"
    }
  ],
  "softwareRequirements": {
    "1": {
      "@type": "SoftwareApplication",
      "identifier": "redland",
      "name": "redland",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=redland"
    },
    "2": {
      "@type": "SoftwareApplication",
      "identifier": "jsonld",
      "name": "jsonld",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=jsonld"
    },
    "3": {
      "@type": "SoftwareApplication",
      "identifier": "methods",
      "name": "methods"
    },
    "4": {
      "@type": "SoftwareApplication",
      "identifier": "utils",
      "name": "utils"
    },
    "5": {
      "@type": "SoftwareApplication",
      "identifier": "stringi",
      "name": "stringi",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=stringi"
    },
    "6": {
      "@type": "SoftwareApplication",
      "identifier": "readr",
      "name": "readr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=readr"
    },
    "7": {
      "@type": "SoftwareApplication",
      "identifier": "dplyr",
      "name": "dplyr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=dplyr"
    },
    "8": {
      "@type": "SoftwareApplication",
      "identifier": "tidyr",
      "name": "tidyr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=tidyr"
    },
    "SystemRequirements": null
  },
  "fileSize": "345.68KB",
  "citation": [
    {
      "@type": "SoftwareSourceCode",
      "datePublished": "2018",
      "author": [
        {
          "@type": "Person",
          "givenName": "Carl",
          "familyName": "Boettiger",
          "email": "cboettig@gmail.com"
        }
      ],
      "name": "rdflib: A high level wrapper around the redland package for common rdf applications",
      "identifier": "10.5281/zenodo.1098478",
      "url": "https://doi.org/10.5281/zenodo.1098478",
      "@id": "https://doi.org/10.5281/zenodo.1098478",
      "sameAs": "https://doi.org/10.5281/zenodo.1098478"
    }
  ]
}

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 223
  • Total Committers: 8
  • Avg Commits per committer: 27.875
  • Development Distribution Score (DDS): 0.049
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Carl Boettiger c****g@g****m 212
Carl Boettiger c****g@g****m 3
mark padgham m****m@e****m 2
Jeroen Ooms j****s@g****m 2
pdatascience d****e@p****t 1
olivroy 5****y 1
Katrin Leinweber 9****r 1
Jim Hester j****r@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 38
  • Total pull requests: 11
  • Average time to close issues: 3 months
  • Average time to close pull requests: 1 day
  • Total issue authors: 16
  • Total pull request authors: 6
  • Average comments per issue: 2.26
  • Average comments per pull request: 1.18
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • cboettig (17)
  • James-G-Hill (3)
  • maelle (3)
  • sckott (3)
  • salvafern (1)
  • GerardTromp (1)
  • noamross (1)
  • barracuda156 (1)
  • ostroganov (1)
  • amoeba (1)
  • sergeitarasov (1)
  • th5 (1)
  • pdatascience (1)
  • fedormyskin (1)
  • nicholsn (1)
Pull Request Authors
  • cboettig (5)
  • mpadge (2)
  • pdatascience (1)
  • katrinleinweber (1)
  • jimhester (1)
  • olivroy (1)
Top Labels
Issue Labels
bug (1) wontfix (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 1,690 last-month
  • Total docker downloads: 130,589
  • Total dependent packages: 5
  • Total dependent repositories: 14
  • Total versions: 11
  • Total maintainers: 1
cran.r-project.org: rdflib

Tools to Manipulate and Query Semantic Data

  • Versions: 11
  • Dependent Packages: 5
  • Dependent Repositories: 14
  • Downloads: 1,690 Last month
  • Docker Downloads: 130,589
Rankings
Docker downloads count: 0.0%
Stargazers count: 6.4%
Average: 7.3%
Forks count: 7.3%
Dependent repos count: 7.7%
Dependent packages count: 8.2%
Downloads: 14.3%
Maintainers (1)
Last synced: 9 months ago

Dependencies

DESCRIPTION cran
  • dplyr * imports
  • jsonld * imports
  • methods * imports
  • readr * imports
  • redland * imports
  • stringi * imports
  • tidyr * imports
  • utils * imports
  • DT * suggests
  • covr * suggests
  • httr * suggests
  • jqr * suggests
  • jsonlite * suggests
  • knitr * suggests
  • lubridate * suggests
  • magrittr * suggests
  • nycflights13 * suggests
  • purrr * suggests
  • repurrrsive * suggests
  • rmarkdown * suggests
  • spelling * suggests
  • testthat * suggests
  • tibble * suggests
  • xml2 * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
docker-compose.yml docker
  • mariadb latest
  • postgres latest
  • ropensci/rdflib latest
inst/docker/Dockerfile docker
  • rocker/tidyverse latest build
inst/docker/cli/Dockerfile docker
  • rocker/r-ver latest build
inst/docker/docker-compose.yml docker
  • mariadb latest
  • postgres latest
  • ropensci/rdflib latest
  • tenforce/virtuoso 1.3.1-virtuoso7.2.2
inst/docker/virtuoso/Dockerfile docker
  • debian stretch build