virtuoso

:package: Interact with Virtuoso Open Source database instances from R

https://github.com/ropensci/virtuoso

Science Score: 26.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
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (19.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

:package: Interact with Virtuoso Open Source database instances from R

Basic Info
Statistics
  • Stars: 9
  • Watchers: 2
  • Forks: 5
  • Open Issues: 2
  • Releases: 2
Created over 7 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog Contributing License Code of conduct Codemeta

README.Rmd

---
output: github_document
---


# virtuoso 

[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![Travis build status](https://travis-ci.org/ropensci/virtuoso.svg?branch=master)](https://travis-ci.org/ropensci/virtuoso)
[![Build status](https://ci.appveyor.com/api/projects/status/x5r18x1cvu6khksd/branch/master?svg=true)](https://ci.appveyor.com/project/cboettig/virtuoso/branch/master)
[![Coverage status](https://codecov.io/gh/ropensci/virtuoso/branch/master/graph/badge.svg)](https://codecov.io/github/ropensci/virtuoso?branch=master)
[![CRAN status](https://www.r-pkg.org/badges/version/virtuoso)](https://cran.r-project.org/package=virtuoso) 
[![Peer review](http://badges.ropensci.org/271_status.svg)](https://github.com/ropensci/software-review/issues/271)

 


```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```


The goal of virtuoso is to provide an easy interface to Virtuoso RDF database from R. 

## Installation

You can install the development version of virtuoso from GitHub with:

``` r
remotes::install_github("ropensci/virtuoso")
```

## Getting Started

```{r}
library(virtuoso)
```

For Mac users, `virtuoso` package includes a utility function to install and configure a local Virtuoso Open Source instance using Homebrew.  Otherwise, simply install the Virtuoso Open Source edition for your operating system. 


```{r install}
vos_install()
```

We can now start our Virtuoso server from R:

```{r}
vos_start()
```



 Once the server is running, we can connect to the database.

```{r}
con <- vos_connect()
```

Our connection is now live, and accepts SPARQL queries directly.  

```{r}
DBI::dbGetQuery(con, "SPARQL SELECT * WHERE { ?s ?p ?o } LIMIT 4")
```

## DSL

`virtuoso` also provides wrappers around some common queries to make it easier to work with Virtuoso and RDF.

The bulk loader can be used to quickly import existing sets of triples. 

```{r}
example <- system.file("extdata", "person.nq", package = "virtuoso")
vos_import(con, example)
```

Can also read in compressed formats as well.  Remember to set the pattern match appropriately.  This is convenient because N-Quads compress particularly well, often by a factor of 20 (or rather, can be particularly large when uncompressed, owing to the repeated property and subject URIs).  

```{r}
ex <- system.file("extdata", "library.nq.gz", package = "virtuoso")
vos_import(con, ex)
```

`vos_import` invisibly returns a table of the loaded files, with error message and loading times.  If a file cannot be imported, an error message is returned:

```{r error = TRUE}
bad_file <- system.file("extdata", "bad_quads.nq", package = "virtuoso")
vos_import(con, bad_file)
```

 
We can now query the imported data using SPARQL.  

```{r}
df <- vos_query(con, 
"SELECT ?p ?o 
 WHERE { ?s ?p ?o .
        ?s a 
       }")
head(df)
```

```{r}
vos_query(con, 
"SELECT ?p ?o 
 WHERE { ?s ?p ?o .
        ?s a 
       }")
```


## Server controls

We can control any `virtuoso` server started with `vos_start()` using a series of helper commands.  

```{r}
vos_status()
```

Advanced usage note: `vos_start()` invisibly returns a `processx` object which we can pass to other server control functions, or access the embedded `processx` control methods directly.  The `virtuoso` package also caches this object in an environment so that it can be accessed directly without having to keep track of an object in the global environment. Use `vos_process()` to return the `processx` object.  For example:

```{r}
library(ps)
p <- vos_process()
ps_is_running(p)
ps_cpu_times(p)
ps_suspend(p)
ps_resume(p)
```

```{r include = FALSE}
vos_kill()
```

## Going further

Please see the package vignettes for more information:

- [details on Virtuoso Installation & configuration](https://docs.ropensci.org/virtuoso/articles/installation.html)
- [The Data Lake: richer examples of RDF use](https://docs.ropensci.org/virtuoso/articles/articles/datalake.html)

---

Please note that the `virtuoso` R package is released with a [Contributor Code of Conduct](https://docs.ropensci.org/virtuoso/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.


```{r include=FALSE}
if(require(codemetar)) codemetar::write_codemeta()
```


[![ropensci_footer](https://ropensci.org/public_images/ropensci_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",
    "http://schema.org"
  ],
  "@type": "SoftwareSourceCode",
  "identifier": "virtuoso",
  "description": "Provides users with a simple and convenient\n             mechanism to manage and query a 'Virtuoso' database using the 'DBI' (DataBase Interface)\n             compatible 'ODBC' (Open Database Connectivity) interface.\n             'Virtuoso' is a high-performance \"universal server,\" which can act\n             as both a relational database, supporting standard Structured Query\n             Language ('SQL') queries, while also supporting data following the\n             Resource Description Framework ('RDF') model for Linked Data.\n             'RDF' data can be queried using 'SPARQL' ('SPARQL' Protocol and 'RDF' Query Language)\n             queries, a graph-based query that supports semantic reasoning.\n             This allows users to leverage the performance of local or remote 'Virtuoso' servers using\n             popular 'R' packages such as 'DBI' and 'dplyr', while also providing a \n             high-performance solution for working with large 'RDF' triplestores from 'R.'\n             The package also provides helper routines to install, launch, and manage\n             a 'Virtuoso' server locally on 'Mac', 'Windows' and 'Linux' platforms using\n             the standard interactive installers from the 'R' command-line.  By \n             automatically handling these setup steps, the package can make using 'Virtuoso'\n             considerably faster and easier for a most users to deploy in a local\n             environment. Managing the bulk import of triples\n             from common serializations with a single intuitive command is another key\n             feature of this package.  Bulk import performance can be tens to\n             hundreds of times faster than the comparable imports using existing 'R' tools,\n             including 'rdflib' and 'redland' packages.  ",
  "name": "virtuoso: Interface to 'Virtuoso' using 'ODBC'",
  "codeRepository": "https://github.com/ropensci/virtuoso",
  "issueTracker": "https://github.com/ropensci/virtuoso/issues",
  "license": "https://spdx.org/licenses/MIT",
  "version": "0.1.4",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.0.2 (2020-06-22)",
  "author": [
    {
      "@type": "Person",
      "givenName": "Carl",
      "familyName": "Boettiger",
      "email": "cboettig@gmail.com",
      "@id": "https://orcid.org/0000-0002-1642-628X"
    }
  ],
  "contributor": [
    {
      "@type": "Person",
      "givenName": "Bryce",
      "familyName": "Mecum",
      "email": "brycemecum@gmail.com",
      "@id": "https://orcid.org/0000-0002-0381-3766"
    }
  ],
  "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": "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": "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": "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": "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": "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"
    },
    {
      "@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"
    },
    {
      "@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": [
    {
      "@type": "SoftwareApplication",
      "identifier": "odbc",
      "name": "odbc",
      "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=odbc"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "processx",
      "name": "processx",
      "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=processx"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "DBI",
      "name": "DBI",
      "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=DBI"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "utils",
      "name": "utils"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "ini",
      "name": "ini",
      "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=ini"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rappdirs",
      "name": "rappdirs",
      "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=rappdirs"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "curl",
      "name": "curl",
      "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=curl"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "fs",
      "name": "fs",
      "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=fs"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "digest",
      "name": "digest",
      "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=digest"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "ps",
      "name": "ps",
      "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=ps"
    }
  ],
  "readme": "https://github.com/ropensci/virtuoso/blob/master/README.md",
  "fileSize": "2152.89KB",
  "contIntegration": [
    "https://travis-ci.org/ropensci/virtuoso",
    "https://ci.appveyor.com/project/cboettig/virtuoso/branch/master",
    "https://codecov.io/github/ropensci/virtuoso?branch=master"
  ],
  "developmentStatus": "https://www.tidyverse.org/lifecycle/#maturing",
  "provider": {
    "@id": "https://cran.r-project.org",
    "@type": "Organization",
    "name": "Comprehensive R Archive Network (CRAN)",
    "url": "https://cran.r-project.org"
  },
  "funder": {},
  "review": {
    "@type": "Review",
    "url": "https://github.com/ropensci/software-review/issues/271",
    "provider": "https://ropensci.org"
  },
  "relatedLink": "https://CRAN.R-project.org/package=virtuoso"
}

GitHub Events

Total
  • Issue comment event: 1
  • Push event: 2
  • Pull request event: 1
  • Create event: 1
Last Year
  • Issue comment event: 1
  • Push event: 2
  • Pull request event: 1
  • Create event: 1

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 167
  • Total Committers: 2
  • Avg Commits per committer: 83.5
  • Development Distribution Score (DDS): 0.012
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 165
Jeroen Ooms j****s@g****m 2

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 15
  • Total pull requests: 28
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 1 day
  • Total issue authors: 5
  • Total pull request authors: 4
  • Average comments per issue: 2.27
  • Average comments per pull request: 0.18
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 minutes
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • cboettig (9)
  • maelle (3)
  • lddurbin (1)
  • allenbaron (1)
  • jeroen (1)
Pull Request Authors
  • cboettig (25)
  • Rekyt (2)
  • maelle (1)
  • amoeba (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 163 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 6
  • Total maintainers: 1
cran.r-project.org: virtuoso

Interface to 'Virtuoso' using 'ODBC'

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 163 Last month
Rankings
Forks count: 14.9%
Stargazers count: 17.9%
Dependent packages count: 29.8%
Average: 33.2%
Dependent repos count: 35.5%
Downloads: 68.0%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • DBI * imports
  • curl * imports
  • digest * imports
  • fs * imports
  • ini * imports
  • odbc * imports
  • processx * imports
  • ps * imports
  • rappdirs * imports
  • utils * imports
  • covr * suggests
  • dplyr * suggests
  • jsonld * suggests
  • knitr * suggests
  • nycflights13 * suggests
  • rmarkdown * suggests
  • spelling * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/check-r-package v1 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite