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)
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!
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
.
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
}
]
}
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:
by consensus context you mean
schema + codemeta
, right? maybe define this somewhere and stick with it throughout the documentation to hammer the concept through.