library(jsonld)
library(jsonlite)
library(magrittr)

Attaching package: 'magrittr'
The following object is masked from 'package:purrr':

    set_names
The following object is masked from 'package:tidyr':

    extract
library(codemetar)
library(purrr)
library(dplyr)
library(printr)

GENERAL

Overall, the functions are smooth and easy to use. I think the most difficult part of the package is getting your head round the concepts. There is good codemeta and JSON-LD documentation to to which codemetar documentation links to (I love Manny’s videos!). I also realise that the purpose of package documentation is mainly to demonstrate use and not necessarily educate on the background. However I feel that a small amount of extra explanation and jargon busting could really help users get their head round what’s going on and why it’s such an importnat and awesome initiative!

I would have loved a short background section in the intro that could include a few key definitions (which could then be used consistently throughout) and a touch of historical context: eg. (sorry this are probably rubbish definitions but hopefully you get the gist!)


Linked data: data that has a context which links the fields used in the data to an online agreed standard.

context: mapping between a data source fields and a schema. Usually schema.org but domain specific ones also (eg codemeta)

Main context: schema.org Additional context: codemeta

Or just describe in the historical context of 4 intiatives:


Once I got my head round the above, I felt I understood the purpose and the function of the package but without a short summary and information spread across various sources it took a little time.

None of this is of course necessary, I took special interest in the project because it really ties in with all my key interests so I might be a special case. But I almost feel that understanding these concepts could lead to better data management in general and adoption of JSON-LD more widely and for broader purposes. Let’s just say this package could act as a gateway drug to JSON-LD, it certainly has for me!

Comments on specific vignettes:

Intro

Really like ability to add through the DESCRIPTION file. See the DESCRIPTION file of the codemetar package for an example. (could be an actual link to the DESCRIPTION file)

Crosswalking

Just a note on terminology throughout the documentation, I accept it’s hard because I find myself confusing terminology trying to write about it. But it might be could for users to clarify in their heads:

eg this sentence:

Unrecognized properties are dropped, since there is no consensus context into which we can expand them. Second, the expanded terms are then compacted down into the new context (Zenodo in this case.) This time, any terms that are not part of the codemeta Zenodo context are kept, but not compacted, since they still have meaningful contexts (that is, full URIs) that can be associated with them, but not compacted:

by consensus context you mean schema + codemeta, right? maybe define this somewhere and stick with it throughout the documentation to hammer the concept through.

Validation in JSON-LD

Motivating example slightly confusing because while this sentence mentions an error being thrown up, all that is returned in r is a NULL. > However, there’s other data that is missing in our example that could potentially cause problems for our application. For instance, our first author lists no affiliation, so the following code throws an error:

Then when framing, the value to associate with the field is data missing is also NULL. I appreciate that the real value in the process is that the JSON-LD now contains and explicit field that contains a @null value but it might be worth spelling it out because the actual output in r pre & post framing are the same, ie NULL.

JSON-LD Framing allows developers to query by example and force a specific tree layout to a JSON-LD document.

By detailing how the metadata must be structured, what elements must, can, and may not be included, and what data types may be used for those elements, schema help developers consuming the data to anticipate these details and thus build applications which know how to process them. For the data creator, validation is a convenient way to catch data input errors and ensure a consistent data structure.

JSON_LD less prescriptive and allows users to validate / reshape tree through frames

codemeta <- "../assets/example/jsonlite.json"
meta <- fromJSON(codemeta, simplifyVector = FALSE) # tell fromJSON not to screw with the formatting by simplifying

#meta$author
head(meta)
$`@context`
$`@context`[[1]]
[1] "https://doi.org/doi:10.5063/schema/codemeta-2.0"

$`@context`[[2]]
[1] "http://schema.org"


$`@type`
[1] "SoftwareSourceCode"

$identifier
[1] "jsonlite"

$description
[1] "A fast JSON parser and generator optimized for statistical data\n    and the web. Started out as a fork of 'RJSONIO', but has been completely\n    rewritten in recent versions. The package offers flexible, robust, high\n    performance tools for working with JSON in R and is particularly powerful\n    for building pipelines and interacting with a web API. The implementation is\n    based on the mapping described in the vignette (Ooms, 2014). In addition to\n    converting JSON data from/to R objects, 'jsonlite' contains functions to\n    stream, validate, and prettify JSON data. The unit tests included with the\n    package verify that all edge cases are encoded and decoded consistently for\n    use with dynamic data in systems and applications."

$name
[1] "jsonlite: A Robust, High Performance JSON Parser and Generator for R"

$issueTracker
[1] "http://github.com/jeroen/jsonlite/issues"
https://doi.org/doi:10.5063/schema/codemeta-2.0
http://schema.org
SoftwareSourceCode
jsonlite
A fast JSON parser and generator optimized for statistical data
    and the web. Started out as a fork of 'RJSONIO', but has been completely
    rewritten in recent versions. The package offers flexible, robust, high
    performance tools for working with JSON in R and is particularly powerful
    for building pipelines and interacting with a web API. The implementation is
    based on the mapping described in the vignette (Ooms, 2014). In addition to
    converting JSON data from/to R objects, 'jsonlite' contains functions to
    stream, validate, and prettify JSON data. The unit tests included with the
    package verify that all edge cases are encoded and decoded consistently for
    use with dynamic data in systems and applications.
jsonlite: A Robust, High Performance JSON Parser and Generator for R
http://github.com/jeroen/jsonlite/issues

So straight fromJSON() returns a list

lapply(meta$author, 
                 function(author) 
                   person(given = author$given, 
                          family = author$family, 
                          email = author$email,
                          role = "aut"))
[[1]]
[1] "Jeroen Ooms [aut]"

[[2]]
[1] "Duncan Lang [aut]" "Temple Lang [aut]"

[[3]]
[1] "Lloyd Hilaiel [aut]"

Hmmm this example deosn’t work as well because of the two names and no emails but let’s see if I can adapt the frame

codemeta <- 
'
{
  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
  "@type": "SoftwareSourceCode",
  "name": "codemetar: Generate CodeMeta Metadata for R Packages",
  "datePublished":" 2017-05-20",
  "version": 1.0,
  "author": [
    {
      "@type": "Person",
      "givenName": "Carl",
      "familyName": "Boettiger",
      "email": "cboettig@gmail.com",
      "@id": "http://orcid.org/0000-0002-1642-628X"
    }],
  "maintainer":  {"@id": "http://orcid.org/0000-0002-1642-628X"}
}
'

meta <- fromJSON(codemeta, simplifyVector = FALSE) # tell fromJSON not to screw with the formatting by simplifying
meta
$`@context`
[1] "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld"

$`@type`
[1] "SoftwareSourceCode"

$name
[1] "codemetar: Generate CodeMeta Metadata for R Packages"

$datePublished
[1] " 2017-05-20"

$version
[1] 1

$author
$author[[1]]
$author[[1]]$`@type`
[1] "Person"

$author[[1]]$givenName
[1] "Carl"

$author[[1]]$familyName
[1] "Boettiger"

$author[[1]]$email
[1] "cboettig@gmail.com"

$author[[1]]$`@id`
[1] "http://orcid.org/0000-0002-1642-628X"



$maintainer
$maintainer$`@id`
[1] "http://orcid.org/0000-0002-1642-628X"
https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld
SoftwareSourceCode
codemetar: Generate CodeMeta Metadata for R Packages
 2017-05-20
Person
Carl
Boettiger
cboettig@gmail.com
http://orcid.org/0000-0002-1642-628X
http://orcid.org/0000-0002-1642-628X
lapply(meta$author, 
                 function(author) 
                   person(given = author$given, 
                          family = author$family, 
                          email = author$email,
                          role = "aut"))
[[1]]
[1] "Carl Boettiger <cboettig@gmail.com> [aut]"
frame <- '{
  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
  "@embed": "@always",
  "author": {
    "familyName": {},
    "affiliation": {"@default": "@null"}
  }
}'

frame
[1] "{\n  \"@context\": \"https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld\",\n  \"@embed\": \"@always\",\n  \"author\": {\n    \"familyName\": {},\n    \"affiliation\": {\"@default\": \"@null\"}\n  }\n}"
{
  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
  "@embed": "@always",
  "author": {
    "familyName": {},
    "affiliation": {"@default": "@null"}
  }
}

So a frame needs to be json-ld

meta <- 
  jsonld_frame(codemeta, frame) %>% 
  fromJSON(codemeta, simplifyVector = FALSE) %>%   ##  simplify messes with JSON formatting
  getElement("@graph") %>% getElement(1)            ## a piped version of [["@graph"]][[1]]
head(meta)
$id
[1] "_:b0"

$type
[1] "SoftwareSourceCode"

$author
$author[[1]]
$author[[1]]$id
[1] "http://orcid.org/0000-0002-1642-628X"

$author[[1]]$type
[1] "Person"

$author[[1]]$affiliation
NULL

$author[[1]]$email
[1] "cboettig@gmail.com"

$author[[1]]$familyName
[1] "Boettiger"

$author[[1]]$givenName
[1] "Carl"



$datePublished
[1] " 2017-05-20"

$name
[1] "codemetar: Generate CodeMeta Metadata for R Packages"

$version
[1] 1
_:b0
SoftwareSourceCode
http://orcid.org/0000-0002-1642-628X
Person
cboettig@gmail.com
Boettiger
Carl
 2017-05-20
codemetar: Generate CodeMeta Metadata for R Packages
meta$author[[1]]$familyName
[1] "Boettiger"
Boettiger
meta$author[[1]]$affiliation
NULL

Let’s everyone to work at the University of Sheffield instead. (They’ll thank us)

frame <- '{
  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
  "@embed": "@always",
  "author": {
    "familyName": {},
    "affiliation": {"@default": "University of Sheffield"}
  }
}'

meta <- 
  jsonld_frame(codemeta, frame) %>% 
  fromJSON(codemeta, simplifyVector = FALSE) %>%   ##  simplify messes with JSON formatting
  getElement("@graph") %>% getElement(1)  

meta$author[[1]]$familyName
[1] "Boettiger"
Boettiger
meta$author[[1]]$affiliation
[1] "University of Sheffield"
University of Sheffield

Let’s try with another package

codemeta <- "../assets/example/jsonlite.json"
meta <- jsonld_frame(codemeta, frame) %>% 
fromJSON(codemeta, simplifyVector = FALSE)
head(meta)
$`@context`
[1] "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld"

$`@graph`
$`@graph`[[1]]
$`@graph`[[1]]$id
[1] "_:b0"

$`@graph`[[1]]$type
[1] "SoftwareSourceCode"

$`@graph`[[1]]$`schema:author`
$`@graph`[[1]]$`schema:author`[[1]]
$`@graph`[[1]]$`schema:author`[[1]]$id
[1] "_:b1"

$`@graph`[[1]]$`schema:author`[[1]]$type
[1] "Person"

$`@graph`[[1]]$`schema:author`[[1]]$familyName
[1] "Ooms"

$`@graph`[[1]]$`schema:author`[[1]]$givenName
[1] "Jeroen"


$`@graph`[[1]]$`schema:author`[[2]]
$`@graph`[[1]]$`schema:author`[[2]]$id
[1] "_:b2"

$`@graph`[[1]]$`schema:author`[[2]]$type
[1] "Person"

$`@graph`[[1]]$`schema:author`[[2]]$familyName
[1] "Lang"

$`@graph`[[1]]$`schema:author`[[2]]$givenName
$`@graph`[[1]]$`schema:author`[[2]]$givenName[[1]]
[1] "Duncan"

$`@graph`[[1]]$`schema:author`[[2]]$givenName[[2]]
[1] "Temple"



$`@graph`[[1]]$`schema:author`[[3]]
$`@graph`[[1]]$`schema:author`[[3]]$id
[1] "_:b3"

$`@graph`[[1]]$`schema:author`[[3]]$type
[1] "Person"

$`@graph`[[1]]$`schema:author`[[3]]$familyName
[1] "Hilaiel"

$`@graph`[[1]]$`schema:author`[[3]]$givenName
[1] "Lloyd"



$`@graph`[[1]]$citation
$`@graph`[[1]]$citation$id
[1] "_:b4"

$`@graph`[[1]]$citation$type
[1] "schema:ScholarlyArticle"

$`@graph`[[1]]$citation$`schema:author`
$`@graph`[[1]]$citation$`schema:author`$id
[1] "_:b5"

$`@graph`[[1]]$citation$`schema:author`$type
[1] "Person"

$`@graph`[[1]]$citation$`schema:author`$familyName
[1] "Ooms"

$`@graph`[[1]]$citation$`schema:author`$givenName
[1] "Jeroen"


$`@graph`[[1]]$citation$datePublished
[1] "2014"

$`@graph`[[1]]$citation$isPartOf
$`@graph`[[1]]$citation$isPartOf$id
[1] "_:b6"

$`@graph`[[1]]$citation$isPartOf$type
[1] "schema:PublicationIssue"

$`@graph`[[1]]$citation$isPartOf$datePublished
[1] "2014"

$`@graph`[[1]]$citation$isPartOf$isPartOf
$`@graph`[[1]]$citation$isPartOf$isPartOf$id
[1] "_:b7"

$`@graph`[[1]]$citation$isPartOf$isPartOf$type
$`@graph`[[1]]$citation$isPartOf$isPartOf$type[[1]]
[1] "schema:PublicationVolume"

$`@graph`[[1]]$citation$isPartOf$isPartOf$type[[2]]
[1] "schema:Periodical"


$`@graph`[[1]]$citation$isPartOf$isPartOf$name
[1] "arXiv:1403.2805 [stat.CO]"



$`@graph`[[1]]$citation$name
[1] "The jsonlite Package: A Practical and Consistent Mapping Between JSON Data and R Objects"

$`@graph`[[1]]$citation$url
[1] "https://arxiv.org/abs/1403.2805"


$`@graph`[[1]]$datePublished
[1] "2017-06-01 12:03:37 UTC"

$`@graph`[[1]]$description
[1] "A fast JSON parser and generator optimized for statistical data\n    and the web. Started out as a fork of 'RJSONIO', but has been completely\n    rewritten in recent versions. The package offers flexible, robust, high\n    performance tools for working with JSON in R and is particularly powerful\n    for building pipelines and interacting with a web API. The implementation is\n    based on the mapping described in the vignette (Ooms, 2014). In addition to\n    converting JSON data from/to R objects, 'jsonlite' contains functions to\n    stream, validate, and prettify JSON data. The unit tests included with the\n    package verify that all edge cases are encoded and decoded consistently for\n    use with dynamic data in systems and applications."

$`@graph`[[1]]$identifier
[1] "jsonlite"

$`@graph`[[1]]$license
[1] "https://spdx.org/licenses/MIT"

$`@graph`[[1]]$name
[1] "jsonlite: A Robust, High Performance JSON Parser and Generator for R"

$`@graph`[[1]]$programmingLanguage
$`@graph`[[1]]$programmingLanguage$id
[1] "_:b8"

$`@graph`[[1]]$programmingLanguage$type
[1] "schema:ComputerLanguage"

$`@graph`[[1]]$programmingLanguage$name
[1] "R"

$`@graph`[[1]]$programmingLanguage$url
[1] "https://r-project.org"

$`@graph`[[1]]$programmingLanguage$version
[1] "3.4.1"


$`@graph`[[1]]$provider
$`@graph`[[1]]$provider$id
[1] "https://cran.r-project.org"

$`@graph`[[1]]$provider$type
[1] "Organization"

$`@graph`[[1]]$provider$name
[1] "Central R Archive Network (CRAN)"

$`@graph`[[1]]$provider$url
[1] "https://cran.r-project.org"


$`@graph`[[1]]$runtimePlatform
[1] "R version 3.4.1 (2017-06-30)"

$`@graph`[[1]]$softwareRequirements
$`@graph`[[1]]$softwareRequirements$id
[1] "_:b9"

$`@graph`[[1]]$softwareRequirements$type
[1] "SoftwareApplication"

$`@graph`[[1]]$softwareRequirements$identifier
[1] "methods"

$`@graph`[[1]]$softwareRequirements$name
[1] "methods"


$`@graph`[[1]]$version
[1] "1.5"

$`@graph`[[1]]$issueTracker
[1] "http://github.com/jeroen/jsonlite/issues"

$`@graph`[[1]]$maintainer
$`@graph`[[1]]$maintainer$id
[1] "_:b10"

$`@graph`[[1]]$maintainer$type
[1] "Person"

$`@graph`[[1]]$maintainer$email
[1] "jeroen@berkeley.edu"

$`@graph`[[1]]$maintainer$familyName
[1] "Ooms"

$`@graph`[[1]]$maintainer$givenName
[1] "Jeroen"


$`@graph`[[1]]$softwareSuggestions
$`@graph`[[1]]$softwareSuggestions[[1]]
$`@graph`[[1]]$softwareSuggestions[[1]]$id
[1] "_:b11"

$`@graph`[[1]]$softwareSuggestions[[1]]$type
[1] "SoftwareApplication"

$`@graph`[[1]]$softwareSuggestions[[1]]$identifier
[1] "httr"

$`@graph`[[1]]$softwareSuggestions[[1]]$name
[1] "httr"

$`@graph`[[1]]$softwareSuggestions[[1]]$provider
$`@graph`[[1]]$softwareSuggestions[[1]]$provider$id
[1] "https://cran.r-project.org"

$`@graph`[[1]]$softwareSuggestions[[1]]$provider$type
[1] "Organization"

$`@graph`[[1]]$softwareSuggestions[[1]]$provider$name
[1] "Central R Archive Network (CRAN)"

$`@graph`[[1]]$softwareSuggestions[[1]]$provider$url
[1] "https://cran.r-project.org"



$`@graph`[[1]]$softwareSuggestions[[2]]
$`@graph`[[1]]$softwareSuggestions[[2]]$id
[1] "_:b12"

$`@graph`[[1]]$softwareSuggestions[[2]]$type
[1] "SoftwareApplication"

$`@graph`[[1]]$softwareSuggestions[[2]]$identifier
[1] "curl"

$`@graph`[[1]]$softwareSuggestions[[2]]$name
[1] "curl"

$`@graph`[[1]]$softwareSuggestions[[2]]$provider
$`@graph`[[1]]$softwareSuggestions[[2]]$provider$id
[1] "https://cran.r-project.org"

$`@graph`[[1]]$softwareSuggestions[[2]]$provider$type
[1] "Organization"

$`@graph`[[1]]$softwareSuggestions[[2]]$provider$name
[1] "Central R Archive Network (CRAN)"

$`@graph`[[1]]$softwareSuggestions[[2]]$provider$url
[1] "https://cran.r-project.org"



$`@graph`[[1]]$softwareSuggestions[[3]]
$`@graph`[[1]]$softwareSuggestions[[3]]$id
[1] "_:b13"

$`@graph`[[1]]$softwareSuggestions[[3]]$type
[1] "SoftwareApplication"

$`@graph`[[1]]$softwareSuggestions[[3]]$identifier
[1] "plyr"

$`@graph`[[1]]$softwareSuggestions[[3]]$name
[1] "plyr"

$`@graph`[[1]]$softwareSuggestions[[3]]$provider
$`@graph`[[1]]$softwareSuggestions[[3]]$provider$id
[1] "https://cran.r-project.org"

$`@graph`[[1]]$softwareSuggestions[[3]]$provider$type
[1] "Organization"

$`@graph`[[1]]$softwareSuggestions[[3]]$provider$name
[1] "Central R Archive Network (CRAN)"

$`@graph`[[1]]$softwareSuggestions[[3]]$provider$url
[1] "https://cran.r-project.org"



$`@graph`[[1]]$softwareSuggestions[[4]]
$`@graph`[[1]]$softwareSuggestions[[4]]$id
[1] "_:b14"

$`@graph`[[1]]$softwareSuggestions[[4]]$type
[1] "SoftwareApplication"

$`@graph`[[1]]$softwareSuggestions[[4]]$identifier
[1] "testthat"

$`@graph`[[1]]$softwareSuggestions[[4]]$name
[1] "testthat"

$`@graph`[[1]]$softwareSuggestions[[4]]$provider
$`@graph`[[1]]$softwareSuggestions[[4]]$provider$id
[1] "https://cran.r-project.org"

$`@graph`[[1]]$softwareSuggestions[[4]]$provider$type
[1] "Organization"

$`@graph`[[1]]$softwareSuggestions[[4]]$provider$name
[1] "Central R Archive Network (CRAN)"

$`@graph`[[1]]$softwareSuggestions[[4]]$provider$url
[1] "https://cran.r-project.org"



$`@graph`[[1]]$softwareSuggestions[[5]]
$`@graph`[[1]]$softwareSuggestions[[5]]$id
[1] "_:b15"

$`@graph`[[1]]$softwareSuggestions[[5]]$type
[1] "SoftwareApplication"

$`@graph`[[1]]$softwareSuggestions[[5]]$identifier
[1] "knitr"

$`@graph`[[1]]$softwareSuggestions[[5]]$name
[1] "knitr"

$`@graph`[[1]]$softwareSuggestions[[5]]$provider
$`@graph`[[1]]$softwareSuggestions[[5]]$provider$id
[1] "https://cran.r-project.org"

$`@graph`[[1]]$softwareSuggestions[[5]]$provider$type
[1] "Organization"

$`@graph`[[1]]$softwareSuggestions[[5]]$provider$name
[1] "Central R Archive Network (CRAN)"

$`@graph`[[1]]$softwareSuggestions[[5]]$provider$url
[1] "https://cran.r-project.org"



$`@graph`[[1]]$softwareSuggestions[[6]]
$`@graph`[[1]]$softwareSuggestions[[6]]$id
[1] "_:b16"

$`@graph`[[1]]$softwareSuggestions[[6]]$type
[1] "SoftwareApplication"

$`@graph`[[1]]$softwareSuggestions[[6]]$identifier
[1] "rmarkdown"

$`@graph`[[1]]$softwareSuggestions[[6]]$name
[1] "rmarkdown"

$`@graph`[[1]]$softwareSuggestions[[6]]$provider
$`@graph`[[1]]$softwareSuggestions[[6]]$provider$id
[1] "https://cran.r-project.org"

$`@graph`[[1]]$softwareSuggestions[[6]]$provider$type
[1] "Organization"

$`@graph`[[1]]$softwareSuggestions[[6]]$provider$name
[1] "Central R Archive Network (CRAN)"

$`@graph`[[1]]$softwareSuggestions[[6]]$provider$url
[1] "https://cran.r-project.org"



$`@graph`[[1]]$softwareSuggestions[[7]]
$`@graph`[[1]]$softwareSuggestions[[7]]$id
[1] "_:b17"

$`@graph`[[1]]$softwareSuggestions[[7]]$type
[1] "SoftwareApplication"

$`@graph`[[1]]$softwareSuggestions[[7]]$identifier
[1] "R.rsp"

$`@graph`[[1]]$softwareSuggestions[[7]]$name
[1] "R.rsp"

$`@graph`[[1]]$softwareSuggestions[[7]]$provider
$`@graph`[[1]]$softwareSuggestions[[7]]$provider$id
[1] "https://cran.r-project.org"

$`@graph`[[1]]$softwareSuggestions[[7]]$provider$type
[1] "Organization"

$`@graph`[[1]]$softwareSuggestions[[7]]$provider$name
[1] "Central R Archive Network (CRAN)"

$`@graph`[[1]]$softwareSuggestions[[7]]$provider$url
[1] "https://cran.r-project.org"



$`@graph`[[1]]$softwareSuggestions[[8]]
$`@graph`[[1]]$softwareSuggestions[[8]]$id
[1] "_:b18"

$`@graph`[[1]]$softwareSuggestions[[8]]$type
[1] "SoftwareApplication"

$`@graph`[[1]]$softwareSuggestions[[8]]$identifier
[1] "sp"

$`@graph`[[1]]$softwareSuggestions[[8]]$name
[1] "sp"

$`@graph`[[1]]$softwareSuggestions[[8]]$provider
$`@graph`[[1]]$softwareSuggestions[[8]]$provider$id
[1] "https://cran.r-project.org"

$`@graph`[[1]]$softwareSuggestions[[8]]$provider$type
[1] "Organization"

$`@graph`[[1]]$softwareSuggestions[[8]]$provider$name
[1] "Central R Archive Network (CRAN)"

$`@graph`[[1]]$softwareSuggestions[[8]]$provider$url
[1] "https://cran.r-project.org"





$`@graph`[[2]]
$`@graph`[[2]]$id
[1] "_:b4"

$`@graph`[[2]]$type
[1] "schema:ScholarlyArticle"

$`@graph`[[2]]$`schema:author`
$`@graph`[[2]]$`schema:author`$id
[1] "_:b5"

$`@graph`[[2]]$`schema:author`$type
[1] "Person"

$`@graph`[[2]]$`schema:author`$familyName
[1] "Ooms"

$`@graph`[[2]]$`schema:author`$givenName
[1] "Jeroen"


$`@graph`[[2]]$datePublished
[1] "2014"

$`@graph`[[2]]$isPartOf
$`@graph`[[2]]$isPartOf$id
[1] "_:b6"

$`@graph`[[2]]$isPartOf$type
[1] "schema:PublicationIssue"

$`@graph`[[2]]$isPartOf$datePublished
[1] "2014"

$`@graph`[[2]]$isPartOf$isPartOf
$`@graph`[[2]]$isPartOf$isPartOf$id
[1] "_:b7"

$`@graph`[[2]]$isPartOf$isPartOf$type
$`@graph`[[2]]$isPartOf$isPartOf$type[[1]]
[1] "schema:PublicationVolume"

$`@graph`[[2]]$isPartOf$isPartOf$type[[2]]
[1] "schema:Periodical"


$`@graph`[[2]]$isPartOf$isPartOf$name
[1] "arXiv:1403.2805 [stat.CO]"



$`@graph`[[2]]$name
[1] "The jsonlite Package: A Practical and Consistent Mapping Between JSON Data and R Objects"

$`@graph`[[2]]$url
[1] "https://arxiv.org/abs/1403.2805"
https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld
_:b0
SoftwareSourceCode
_:b1
Person
Ooms
Jeroen
_:b2
Person
Lang
Duncan
Temple
_:b3
Person
Hilaiel
Lloyd
_:b4
schema:ScholarlyArticle
_:b5
Person
Ooms
Jeroen
2014
_:b6
schema:PublicationIssue
2014
_:b7
schema:PublicationVolume
schema:Periodical
arXiv:1403.2805 [stat.CO]
The jsonlite Package: A Practical and Consistent Mapping Between JSON Data and R Objects
https://arxiv.org/abs/1403.2805
2017-06-01 12:03:37 UTC
A fast JSON parser and generator optimized for statistical data
    and the web. Started out as a fork of 'RJSONIO', but has been completely
    rewritten in recent versions. The package offers flexible, robust, high
    performance tools for working with JSON in R and is particularly powerful
    for building pipelines and interacting with a web API. The implementation is
    based on the mapping described in the vignette (Ooms, 2014). In addition to
    converting JSON data from/to R objects, 'jsonlite' contains functions to
    stream, validate, and prettify JSON data. The unit tests included with the
    package verify that all edge cases are encoded and decoded consistently for
    use with dynamic data in systems and applications.
jsonlite
https://spdx.org/licenses/MIT
jsonlite: A Robust, High Performance JSON Parser and Generator for R
_:b8
schema:ComputerLanguage
R
https://r-project.org
3.4.1
https://cran.r-project.org
Organization
Central R Archive Network (CRAN)
https://cran.r-project.org
R version 3.4.1 (2017-06-30)
_:b9
SoftwareApplication
methods
methods
1.5
http://github.com/jeroen/jsonlite/issues
_:b10
Person
jeroen@berkeley.edu
Ooms
Jeroen
_:b11
SoftwareApplication
httr
httr
https://cran.r-project.org
Organization
Central R Archive Network (CRAN)
https://cran.r-project.org
_:b12
SoftwareApplication
curl
curl
https://cran.r-project.org
Organization
Central R Archive Network (CRAN)
https://cran.r-project.org
_:b13
SoftwareApplication
plyr
plyr
https://cran.r-project.org
Organization
Central R Archive Network (CRAN)
https://cran.r-project.org
_:b14
SoftwareApplication
testthat
testthat
https://cran.r-project.org
Organization
Central R Archive Network (CRAN)
https://cran.r-project.org
_:b15
SoftwareApplication
knitr
knitr
https://cran.r-project.org
Organization
Central R Archive Network (CRAN)
https://cran.r-project.org
_:b16
SoftwareApplication
rmarkdown
rmarkdown
https://cran.r-project.org
Organization
Central R Archive Network (CRAN)
https://cran.r-project.org
_:b17
SoftwareApplication
R.rsp
R.rsp
https://cran.r-project.org
Organization
Central R Archive Network (CRAN)
https://cran.r-project.org
_:b18
SoftwareApplication
sp
sp
https://cran.r-project.org
Organization
Central R Archive Network (CRAN)
https://cran.r-project.org
_:b4
schema:ScholarlyArticle
_:b5
Person
Ooms
Jeroen
2014
_:b6
schema:PublicationIssue
2014
_:b7
schema:PublicationVolume
schema:Periodical
arXiv:1403.2805 [stat.CO]
The jsonlite Package: A Practical and Consistent Mapping Between JSON Data and R Objects
https://arxiv.org/abs/1403.2805
write_codemeta("codemetar", "codemeta.json")
frame <- system.file("schema/frame_schema.json", package="codemetar")

meta <- jsonld_frame("codemeta.json", frame) %>%
  fromJSON(FALSE) %>% getElement("@graph") %>% getElement(1)
jsonld_frame("codemeta.json", frame)
{
  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
  "@graph": [
    {
      "id": "_:b0",
      "type": "SoftwareSourceCode",
      "applicationCategory": null,
      "applicationSubCategory": null,
      "schema:author": {
        "id": "http://orcid.org/0000-0002-1642-628X"
      },
      "citation": {
        "id": "_:b1",
        "type": "SoftwareSourceCode",
        "schema:author": {
          "id": "http://orcid.org/0000-0002-1642-628X"
        },
        "description": "R package version 0.1.0",
        "name": "codemetar: Generate CodeMeta Metadata for R Packages",
        "url": "https://github.com/codemeta/codemetar"
      },
      "codeRepository": null,
      "contributor": null,
      "copyrightHolder": {
        "id": "http://orcid.org/0000-0002-1642-628X"
      },
      "copyrightYear": null,
      "creator": null,
      "schema:dateCreated": null,
      "schema:dateModified": null,
      "schema:datePublished": null,
      "description": "Codemeta defines a 'JSON-LD' format for describing software metadata.\n    This package provides utilities to generate, parse, and modify codemeta.jsonld\n    files automatically for R packages.",
      "downloadUrl": null,
      "editor": null,
      "encoding": null,
      "fileFormat": null,
      "fileSize": null,
      "funder": null,
      "identifier": "codemetar",
      "installUrl": null,
      "keywords": [
        "metadata",
        "codemeta",
        "ropensci",
        "citation",
        "credit"
      ],
      "license": "https://spdx.org/licenses/MIT",
      "memoryRequirements": null,
      "name": "codemetar: Generate CodeMeta Metadata for R Packages",
      "operatingSystem": null,
      "permissions": null,
      "processorRequirements": null,
      "producer": null,
      "programmingLanguage": {
        "id": "_:b2",
        "type": "schema:ComputerLanguage",
        "name": "R",
        "url": "https://r-project.org",
        "version": "3.4.1"
      },
      "provider": null,
      "publisher": null,
      "releaseNotes": null,
      "runtimePlatform": "R version 3.4.1 (2017-06-30)",
      "sameAs": null,
      "softwareHelp": null,
      "softwareRequirements": [
        {
          "id": "_:b3",
          "type": "SoftwareApplication",
          "identifier": "jsonlite",
          "name": "jsonlite",
          "provider": {
            "id": "https://cran.r-project.org"
          },
          "version": "1.3"
        },
        {
          "id": "_:b4",
          "type": "SoftwareApplication",
          "identifier": "jsonld",
          "name": "jsonld",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b5",
          "type": "SoftwareApplication",
          "identifier": "git2r",
          "name": "git2r",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b6",
          "type": "SoftwareApplication",
          "identifier": "devtools",
          "name": "devtools",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b7",
          "type": "SoftwareApplication",
          "identifier": "methods",
          "name": "methods"
        },
        {
          "id": "_:b8",
          "type": "SoftwareApplication",
          "identifier": "stats",
          "name": "stats"
        },
        {
          "id": "_:b9",
          "type": "SoftwareApplication",
          "identifier": "stringi",
          "name": "stringi",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b10",
          "type": "SoftwareApplication",
          "identifier": "readr",
          "name": "readr",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b11",
          "type": "SoftwareApplication",
          "identifier": "R",
          "name": "R",
          "version": "3.0.0"
        }
      ],
      "softwareVersion": null,
      "sponsor": null,
      "storageRequirements": null,
      "supportingData": null,
      "targetProduct": null,
      "url": null,
      "version": "0.1.0",
      "buildInstructions": null,
      "contIntegration": null,
      "developmentStatus": null,
      "codemeta:embargoDate": null,
      "funding": null,
      "issueTracker": "https://github.com/codemeta/codemetar/issues",
      "maintainer": {
        "id": "http://orcid.org/0000-0002-1642-628X",
        "type": "Person",
        "email": "cboettig@gmail.com",
        "familyName": "Boettiger"
      },
      "readme": null,
      "referencePublication": null,
      "softwareSuggestions": [
        {
          "id": "_:b12",
          "type": "SoftwareApplication",
          "identifier": "testthat",
          "name": "testthat",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b13",
          "type": "SoftwareApplication",
          "identifier": "jsonvalidate",
          "name": "jsonvalidate",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b14",
          "type": "SoftwareApplication",
          "identifier": "covr",
          "name": "covr",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b15",
          "type": "SoftwareApplication",
          "identifier": "knitr",
          "name": "knitr",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b16",
          "type": "SoftwareApplication",
          "identifier": "rmarkdown",
          "name": "rmarkdown",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b17",
          "type": "SoftwareApplication",
          "identifier": "httr",
          "name": "httr",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b18",
          "type": "SoftwareApplication",
          "identifier": "magrittr",
          "name": "magrittr",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b19",
          "type": "SoftwareApplication",
          "identifier": "xml2",
          "name": "xml2",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b20",
          "type": "SoftwareApplication",
          "identifier": "dplyr",
          "name": "dplyr",
          "provider": {
            "id": "https://cran.r-project.org"
          },
          "version": "0.7.0"
        },
        {
          "id": "_:b21",
          "type": "SoftwareApplication",
          "identifier": "purrr",
          "name": "purrr",
          "provider": {
            "id": "https://cran.r-project.org"
          }
        },
        {
          "id": "_:b22",
          "type": "SoftwareApplication",
          "identifier": "printr",
          "name": "printr",
          "provider": {
            "id": "https://cran.r-project.org",
            "type": "Organization",
            "name": "Central R Archive Network (CRAN)",
            "url": "https://cran.r-project.org"
          }
        }
      ]
    },
    {
      "id": "_:b1",
      "type": "SoftwareSourceCode",
      "applicationCategory": null,
      "applicationSubCategory": null,
      "schema:author": {
        "id": "http://orcid.org/0000-0002-1642-628X",
        "type": "Person",
        "email": "cboettig@gmail.com",
        "familyName": "Boettiger",
        "givenName": "Carl"
      },
      "citation": null,
      "codeRepository": null,
      "contributor": null,
      "copyrightHolder": null,
      "copyrightYear": null,
      "creator": null,
      "schema:dateCreated": null,
      "schema:dateModified": null,
      "schema:datePublished": null,
      "description": "R package version 0.1.0",
      "downloadUrl": null,
      "editor": null,
      "encoding": null,
      "fileFormat": null,
      "fileSize": null,
      "funder": null,
      "identifier": null,
      "installUrl": null,
      "keywords": null,
      "license": null,
      "memoryRequirements": null,
      "name": "codemetar: Generate CodeMeta Metadata for R Packages",
      "operatingSystem": null,
      "permissions": null,
      "processorRequirements": null,
      "producer": null,
      "programmingLanguage": null,
      "provider": null,
      "publisher": null,
      "releaseNotes": null,
      "runtimePlatform": null,
      "sameAs": null,
      "softwareHelp": null,
      "softwareRequirements": null,
      "softwareVersion": null,
      "sponsor": null,
      "storageRequirements": null,
      "supportingData": null,
      "targetProduct": null,
      "url": "https://github.com/codemeta/codemetar",
      "version": null,
      "buildInstructions": null,
      "contIntegration": null,
      "developmentStatus": null,
      "codemeta:embargoDate": null,
      "funding": null,
      "issueTracker": null,
      "maintainer": null,
      "readme": null,
      "referencePublication": null,
      "softwareSuggestions": null
    }
  ]
} 
LS0tCnRpdGxlOiAiVmlnbmV0dGUgcmV2aWV3IgpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sKLS0tCgpgYGB7cn0KbGlicmFyeShqc29ubGQpCmxpYnJhcnkoanNvbmxpdGUpCmxpYnJhcnkobWFncml0dHIpCmxpYnJhcnkoY29kZW1ldGFyKQpsaWJyYXJ5KHB1cnJyKQpsaWJyYXJ5KGRwbHlyKQpsaWJyYXJ5KHByaW50cikKYGBgCgoKIyMgR0VORVJBTAoKT3ZlcmFsbCwgdGhlIGZ1bmN0aW9ucyBhcmUgc21vb3RoIGFuZCBlYXN5IHRvIHVzZS4gSSB0aGluayB0aGUgbW9zdCBkaWZmaWN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