From 75aae8dd277ac1a319aba150ad24a54150a50ba4 Mon Sep 17 00:00:00 2001 From: Carl Boettiger Date: Wed, 17 May 2017 23:56:06 +0000 Subject: [PATCH] update pkgdown site --- README.md | 31 +- codemeta.json | 162 ++++++++- docs/LICENSE | 2 + docs/articles/index.html | 15 +- docs/articles/translating.html | 490 ++++++++++++++++++++++++++++ docs/authors.html | 15 +- docs/codemeta.json | 136 ++++++++ docs/index.html | 183 ++++++++++- docs/pkgdown.css | 91 ++++-- docs/reference/codemeta.json | 166 +++++++--- docs/reference/create_codemeta.html | 145 ++++++++ docs/reference/crosswalk.html | 185 +++++++++++ docs/reference/index.html | 61 +++- docs/reference/write_codemeta.html | 61 +++- 14 files changed, 1628 insertions(+), 115 deletions(-) create mode 100644 docs/LICENSE create mode 100644 docs/articles/translating.html create mode 100644 docs/codemeta.json create mode 100644 docs/reference/create_codemeta.html create mode 100644 docs/reference/crosswalk.html diff --git a/README.md b/README.md index 141a28d9..4c87732b 100644 --- a/README.md +++ b/README.md @@ -138,9 +138,29 @@ write_codemeta(".") "name": "Central R Archive Network (CRAN)", "url": "https://cran.r-project.org" } + }, + { + "@type": "SoftwareApplication", + "name": "httr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "tidyverse", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } } ], - "depends": [ + "softwareRequirements": [ { "@type": "SoftwareApplication", "name": "jsonlite", @@ -159,6 +179,15 @@ write_codemeta(".") { "@type": "SoftwareApplication", "name": "methods" + }, + { + "@type": "SoftwareApplication", + "name": "stats" + }, + { + "@type": "SoftwareApplication", + "name": "R", + "version": "3.0.0)" } ], "contIntegration": "https://travis-ci.org/codemeta/codemetar", diff --git a/codemeta.json b/codemeta.json index 88c25e25..602fd480 100644 --- a/codemeta.json +++ b/codemeta.json @@ -1 +1,161 @@ -{"identifier":["codemetar"],"@context":["https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld"],"@type":["SoftwareSourceCode"],"title":["Generate CodeMeta Metadata for R Packages"],"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."],"name":["codemetar"],"codeRepository":["https://github.com/codemeta/codemetar"],"issueTracker":["https://github.com/codemeta/codemetar/issues"],"licenseId":["MIT + file LICENSE"],"version":["0.1.0"],"programmingLanguage":{"name":["R"],"version":["3.4.0"],"URL":["https://r-project.org"]},"agents":[{"@id":{},"@type":["person"],"name":["Carl Boettiger"],"email":["cboettig@gmail.com"],"isMaintainer":[true],"role":["aut","cre","cph"]}],"suggests":[{"identifier":{},"name":["testthat"],"version":[null],"packageSystem":["http://cran.r-project.org"]},{"identifier":{},"name":[" jsonvalidate"],"version":[null],"packageSystem":["http://cran.r-project.org"]},{"identifier":{},"name":[" jsonld"],"version":[null],"packageSystem":["http://cran.r-project.org"]},{"identifier":{},"name":[" covr"],"version":[null],"packageSystem":["http://cran.r-project.org"]},{"identifier":{},"name":[" knitr"],"version":[null],"packageSystem":["http://cran.r-project.org"]},{"identifier":{},"name":[" rmarkdown"],"version":[null],"packageSystem":["http://cran.r-project.org"]}],"depends":[{"identifier":{},"name":["jsonlite"],"version":["1.3"],"packageSystem":["http://cran.r-project.org"]},{"identifier":{},"name":[" utils"],"version":[null],"packageSystem":["http://cran.r-project.org"]},{"identifier":{},"name":[" methods"],"version":[null],"packageSystem":["http://cran.r-project.org"]}]} +{ + "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld", + "@type": "SoftwareSourceCode", + "identifier": "codemetar", + "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.", + "name": "codemetar: Generate CodeMeta Metadata for R Packages", + "codeRepository": "https://github.com/codemeta/codemetar", + "issueTracker": "https://github.com/codemeta/codemetar/issues", + "licenseId": "MIT + file LICENSE", + "version": "0.1.0", + "programmingLanguage": { + "@type": "ComputerLanguage", + "name": "R", + "version": "3.4.0", + "url": "https://r-project.org" + }, + "runtimePlatform": "R version 3.4.0 (2017-04-21)", + "author": [ + { + "@type": "Person", + "givenName": "Carl", + "familyName": "Boettiger", + "email": "cboettig@gmail.com", + "@id": "http://orcid.org/0000-0002-1642-628X" + } + ], + "copyrightHolder": [ + { + "@type": "Person", + "givenName": "Carl", + "familyName": "Boettiger", + "email": "cboettig@gmail.com", + "@id": "http://orcid.org/0000-0002-1642-628X" + } + ], + "maintainer": { + "@type": "Person", + "givenName": "Carl", + "familyName": "Boettiger", + "email": "cboettig@gmail.com", + "@id": "http://orcid.org/0000-0002-1642-628X" + }, + "suggests": [ + { + "@type": "SoftwareApplication", + "name": "testthat", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "jsonvalidate", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "jsonld", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "covr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "knitr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "rmarkdown", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "httr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "tidyverse", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + } + ], + "softwareRequirements": [ + { + "@type": "SoftwareApplication", + "name": "jsonlite", + "version": "1.3", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "utils" + }, + { + "@type": "SoftwareApplication", + "name": "methods" + }, + { + "@type": "SoftwareApplication", + "name": "stats" + }, + { + "@type": "SoftwareApplication", + "name": "R", + "version": "3.0.0)" + } + ], + "contIntegration": "https://travis-ci.org/codemeta/codemetar", + "developmentStatus": "wip", + "keywords": [ + "metadata", + "ropensci" + ] +} diff --git a/docs/LICENSE b/docs/LICENSE new file mode 100644 index 00000000..43bc93ef --- /dev/null +++ b/docs/LICENSE @@ -0,0 +1,2 @@ +YEAR: 2017 +COPYRIGHT HOLDER: Carl Boettiger diff --git a/docs/articles/index.html b/docs/articles/index.html index 84105a7c..0cf129df 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -25,12 +25,14 @@ - + + + @@ -57,7 +59,12 @@ @@ -67,7 +74,7 @@
@@ -77,7 +84,7 @@

All vignettes

diff --git a/docs/articles/translating.html b/docs/articles/translating.html new file mode 100644 index 00000000..41ff79ee --- /dev/null +++ b/docs/articles/translating.html @@ -0,0 +1,490 @@ + + + + + + + +Translating between schema using JSON-LD • codemetar + + + + + + +
+
+ + + +
+
+ + + + +
+
library("codemetar")
+library("tidyverse")
+library("jsonlite")
+library("jsonld")
+library("httr")
+

One of the central motivations of JSON-LD is making it easy to translate between different representations of what are fundamentally the same data types. Doing so uses the two core algorithms of JSON-LD: expansion and compaction, as this excellent short video by JSON-LD creator Manu Sporny describes.

+

Here’s how we would use JSON-LD (from R) to translate between the two examples of JSON data from different providers as shown in the video. First, the JSON from the original provider:

+
ex <-
+'{
+"@context":{
+  "shouter": "http://schema.org/name",
+  "txt": "http://schema.org/commentText"
+},
+"shouter": "Jim",
+"txt": "Hello World!"
+}'
+

Next, we need the context of the second data provider. This will let us translate the JSON format used by provider one (“Shouttr”) to the second (“BigHash”):

+
bighash_context <- 
+'{
+"@context":{
+  "user": "http://schema.org/name",
+  "comment": "http://schema.org/commentText"
+}
+}'
+

With this in place, we simply expand the original JSON and then compact using the new context:

+
jsonld_expand(ex) %>%
+  jsonld_compact(context = bighash_context)
+
{
+  "@context": {
+    "user": "http://schema.org/name",
+    "comment": "http://schema.org/commentText"
+  },
+  "comment": "Hello World!",
+  "user": "Jim"
+} 
+
+

+Crosswalk contexts

+

The CodeMeta Crosswalk table seeks to accomplish a very similar goal. The crosswalk table provides a human-readable mapping of different software metadata providers into the codemeta context (an extension of schema.org).

+

We’ll start with the actual crosswalk table itself:

+
crosswalk <- "https://github.com/codemeta/codemeta/raw/master/crosswalk.csv"
+cw <- read_csv(crosswalk)
+
+
+

+DataCite

+

We can illustrate using the expansion and compaction process to crosswalk DataCite’s metadata schema into other formats, such as the native codemeta format or the Zenodo format. First, let’s start with some DataCite metadata:

+
datacite_ex <- "https://raw.githubusercontent.com/codemeta/codemetar/master/inst/examples/datacite-xml.json"
+cat(readLines(datacite_ex), sep="\n")
+
{
+  "identifier": "10.5281/zenodo.573741",
+  "creators": [
+    { "givenName": "Jouni",
+      "familyName": "Helske"
+    },
+    {
+      "givenName": "Matti",
+      "familyName": "Vihola"
+    }
+  ],
+  "title": "Bayesian Inference Of State Space Models With The Bssm Package",
+  "publisher": "Zenodo",
+  "publicationYear": "2017",
+  "resourceType": "Software",
+  "date": "2017-05-10",
+  "rights": "Open Access",
+  "description": [
+      "Efficient methods for Bayesian inference of state space models via particle Markov chain Monte Carlo and importance sampling type corrected Markov chain Monte Carlo. Currently supports models with Gaussian, Poisson, binomial, or negative binomial observation densities and Gaussian state dynamics, as well as general non-linear Gaussian models.",
+      "Funded by Academy of Finland grant 284513, \"Exact approximate Monte Carlo methods for complex Bayesian inference\"."
+  ]
+}
+

Note this example uses a JSON-ified representation of DataCite’s internal schema, which is XML-based. So far, this is just plain JSON, with no context. We will use the crosswalk table to define the DataCite context with reference to codemeta:

+
## read the file
+datacite_list <- read_json(datacite_ex)
+
+## add context using the codemeta crosswalk function on the current crosswalk table
+datacite_list$`@context` <- codemetar::crosswalk("DataCite", cw)
+
+## serialize as JSON
+datacite_json <-
+datacite_list %>% 
+  toJSON(auto_unbox=TRUE, pretty=TRUE)
+

We can now expand this json in terms of DataCite context we just derived from the table, and then compact it into the CodeMeta native context:

+
datacite_cm <-
+  jsonld_expand(datacite_json) %>% 
+  jsonld_compact(context = "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta-v2.jsonld") 
+datacite_cm
+
{
+  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta-v2.jsonld",
+  "author": [
+    {
+      "familyName": "Helske",
+      "givenName": "Jouni"
+    },
+    {
+      "familyName": "Vihola",
+      "givenName": "Matti"
+    }
+  ],
+  "dateCreated": "2017-05-10",
+  "datePublished": "2017",
+  "description": [
+    "Efficient methods for Bayesian inference of state space models via particle Markov chain Monte Carlo and importance sampling type corrected Markov chain Monte Carlo. Currently supports models with Gaussian, Poisson, binomial, or negative binomial observation densities and Gaussian state dynamics, as well as general non-linear Gaussian models.",
+    "Funded by Academy of Finland grant 284513, \"Exact approximate Monte Carlo methods for complex Bayesian inference\"."
+  ],
+  "identifier": "10.5281/zenodo.573741",
+  "license": "Open Access",
+  "publisher": "Zenodo"
+} 
+

The result should be a valid codemeta.json document.

+
+
+

+Comparison to native schema.org translation:

+

DataCite actually returns data directly in JSON-LD format using exclusively the schema.org context. We can query that data directly:

+
library("httr")
+resp <- GET("https://doi.org/10.5281/zenodo.573741", add_headers(Accept="application/vnd.schemaorg.ld+json"))
+datacite_jsonld <- content(resp, type="application/json")
+

This time we have no need to invoke the crosswalk context, since the data is already in schema.org context (which codemeta also uses):

+
datacite_cm <- 
+  datacite_jsonld %>% 
+  toJSON(pretty = TRUE, auto_unbox = TRUE) %>%
+  jsonld_expand() %>% 
+  jsonld_compact(context = "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta-v2.jsonld") 
+
+datacite_cm
+
{
+  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta-v2.jsonld",
+  "@id": "https://doi.org/10.5281/zenodo.573741",
+  "@type": "SoftwareSourceCode",
+  "schema:additionalType": {
+    "@id": "Software"
+  },
+  "author": [
+    {
+      "@type": "Person",
+      "familyName": "Helske",
+      "givenName": "Jouni",
+      "name": "Jouni Helske"
+    },
+    {
+      "@type": "Person",
+      "familyName": "Vihola",
+      "givenName": "Matti",
+      "name": "Matti Vihola"
+    }
+  ],
+  "datePublished": {
+    "@type": "schema:Date",
+    "@value": "2017-05-10"
+  },
+  "description": [
+    "Efficient methods for Bayesian inference of state space models via particle Markov chain Monte Carlo and importance sampling type corrected Markov chain Monte Carlo. Currently supports models with Gaussian, Poisson, binomial, or negative binomial observation densities and Gaussian state dynamics, as well as general non-linear Gaussian models.",
+    "Funded by Academy of Finland grant 284513, \"Exact approximate Monte Carlo methods for complex Bayesian inference\"."
+  ],
+  "name": "Bayesian Inference Of State Space Models With The Bssm Package",
+  "provider": {
+    "@type": "Organization",
+    "name": "DataCite"
+  },
+  "publisher": {
+    "@type": "Organization",
+    "name": "Zenodo"
+  },
+  "schema:schemaVersion": {
+    "@id": "http://datacite.org/schema/kernel-3"
+  }
+} 
+

This is very close to the codemeta document we got by translating the DataCite XML using the crosswalk table.

+
+
+

+Transforming into other column schema

+

Note that we can also use this approach to crosswalk into another standard by compacting into the context for the given column. For instance, here we translate our datacite record into a zenodo record. First we get the context from the crosswalk:

+
zenodo_context <- 
+  list("@context" = crosswalk("Zenodo", cw)) %>% 
+  toJSON(pretty = TRUE, auto_unbox = TRUE)
+

then apply it as before:

+
  jsonld_expand(datacite_cm) %>% 
+  jsonld_compact(context = zenodo_context) 
+
{
+  "@context": {
+    "schema": "http://schema.org/",
+    "codemeta": "https://codemeta.github.io/terms/",
+    "relatedLink": "schema:codeRepository",
+    "communities": "schema:applicationCategory",
+    "creators": "schema:author",
+    "date_published": "schema:datePublished",
+    "contributors": "schema:funder",
+    "keywords": "schema:keywords",
+    "license": "schema:license",
+    "description": "schema:description",
+    "id": "schema:identifier",
+    "title": "schema:name",
+    "affiliation": "schema:affiliation",
+    "ORCID": "schema:identifier",
+    "name": "schema:name"
+  },
+  "@id": "https://doi.org/10.5281/zenodo.573741",
+  "@type": "schema:SoftwareSourceCode",
+  "schema:additionalType": {
+    "@id": "Software"
+  },
+  "creators": [
+    {
+      "@type": "schema:Person",
+      "schema:familyName": "Helske",
+      "schema:givenName": "Jouni",
+      "name": "Jouni Helske"
+    },
+    {
+      "@type": "schema:Person",
+      "schema:familyName": "Vihola",
+      "schema:givenName": "Matti",
+      "name": "Matti Vihola"
+    }
+  ],
+  "date_published": {
+    "@type": "schema:Date",
+    "@value": "2017-05-10"
+  },
+  "description": [
+    "Efficient methods for Bayesian inference of state space models via particle Markov chain Monte Carlo and importance sampling type corrected Markov chain Monte Carlo. Currently supports models with Gaussian, Poisson, binomial, or negative binomial observation densities and Gaussian state dynamics, as well as general non-linear Gaussian models.",
+    "Funded by Academy of Finland grant 284513, \"Exact approximate Monte Carlo methods for complex Bayesian inference\"."
+  ],
+  "name": "Bayesian Inference Of State Space Models With The Bssm Package",
+  "schema:provider": {
+    "@type": "schema:Organization",
+    "name": "DataCite"
+  },
+  "schema:publisher": {
+    "@type": "schema:Organization",
+    "name": "Zenodo"
+  },
+  "schema:schemaVersion": {
+    "@id": "http://datacite.org/schema/kernel-3"
+  }
+} 
+

This data should be now use valid Zenodo terms (e.g. using creators for schema:author). Note that we also see explicitly the context that codemeta::crosswalk produced as zenodo_context, since we passed this information as a json file and not a URL. This provides a nice illustration of what the crosswalk is returning when asked for a context of a given column.

+

Note that data that many of the fields could not be directly crosswalked into Zenodo terms, because (at least according to the crosswalk table) they have no analog in Zenodo, such as schema:dateCreated. Instead of dropping this data, the JSON-LD has retained the information using the original prefix schema:, indicating that the term is part of the schema.org context but not recognized in the context of Zenodo.

+

Note this also happens if properties do not have a 1:1 map, since JSON-LD doesn’t provide a convenient way to map two separate properties like givenName, familyName into a single property, name either. JSON-LD will also refuse to map a term that has a potentially different type in the new context (since type coercion can also lead to data loss). In this way, compaction is very conservative.

+
+
+

+Codemeta

+

We can use a similar crosswalk strategy to translate from a JSON-LD file writing using v1 of the codemeta context into the current, v2 context:

+
codemetav1 <- crosswalk("codemeta-V1", cw)
+
+## Add some altered Type definitions from v1
+codemetav1 <- c(codemetav1,
+                    person = "schema:Person",
+                    organization = "schema:Organization",
+                    SoftwareSoureCode = "schema:SoftwareSourceCode")
+

To crosswalk a vocabulary, we must use the context the CrossWalk table defines for that vocabulary. Most vocabularies are not already ontologies with their own base URLs, in which case this is relatively intuitive. But we also need to use the CrossWalk context even when the data originates in another context (SoftwareOntology, DOAP, codemeta-v1), since otherwise those terms will stay in their original space (e.g dcterms:identifer will remain a different kind of property from a schema:identifer, etc)

+
v1 <- "https://raw.githubusercontent.com/codemeta/codemetar/master/inst/examples/codemeta-v1.json"
+#v1 <- "../examples/codemeta-v1.json" ## or local path
+v1_obj <- jsonlite::read_json(v1)
+v1_obj$`@context` <- codemetav1
+v1_json <- toJSON(v1_obj, pretty=TRUE, auto_unbox = TRUE)
+
+#write_json(v1_obj, "v1.json", pretty=TRUE, auto_unbox = TRUE)
+

With a JSON object in place, along with a context file that defines how that vocabulary is expressed in the context of schema.org / codemeta, we can now perform the exansion and compaction routine as before. Expansion uses the native context from the file, compaction uses the new context of codemeta terms.

+
v2_json <- 
+jsonld_expand(v1_json) %>%
+  jsonld_compact(context = "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta-v2.jsonld") 
+v2_json
+
{
+  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta-v2.jsonld",
+  "@type": "SoftwareSourceCode",
+  "author": [
+    {
+      "@id": "http://orcid.org/0000-0002-2192-403X",
+      "@type": "Person",
+      "affiliation": "NCEAS",
+      "email": "slaughter@nceas.ucsb.edu",
+      "name": "Peter Slaughter"
+    },
+    {
+      "@id": "http://orcid.org/0000-0002-3957-2474",
+      "@type": "Organization",
+      "email": "info@ucop.edu",
+      "name": "University of California, Santa Barbara"
+    }
+  ],
+  "citation": "https://github.com/codemeta/codemeta-paper",
+  "codeRepository": "https://github.com/codemeta/codemeta",
+  "dateModified": "2014-08-15",
+  "datePublished": "2014-09-06",
+  "description": "Codemeta is a metadata content standard for software.  It includes schemas in JSON-LD and XML Schema for providing semantics and validation.",
+  "downloadUrl": "https://github.com/codemeta/codemeta/releases/codemeta_2.1.0-rc.2.tar.gz",
+  "identifier": "http://dx.doi.org/10.6084/m9.figshare.828487",
+  "keywords": [
+    "software",
+    "metadata"
+  ],
+  "license": "Apache-2.0",
+  "name": "codemeta",
+  "programmingLanguage": {
+    "name": "ruby",
+    "url": "https://www.ruby-lang.org/en/",
+    "version": "2.3.1"
+  },
+  "publisher": "figshare",
+  "schema:softwareRequirements": [
+    {
+      "identifier": "http://doi.org/10.xxxx/A324566",
+      "name": "export_fig",
+      "version": "1.99"
+    },
+    {
+      "identifier": "89766228838383883",
+      "name": "npplus",
+      "operatingSystem": [
+        "MacOS",
+        "Linux"
+      ],
+      "version": "0.9.4"
+    },
+    {
+      "identifier": "7777575757757-389349843-90898",
+      "name": "popbio",
+      "operatingSystem": [
+        "Windows",
+        "OS X Mavericks"
+      ],
+      "version": "1.3.4"
+    }
+  ],
+  "version": "2.1.0-rc.2",
+  "buildInstructions": "https://github.com/codemeta/codemeta/buildInstructions",
+  "contIntegration": "https://github.com/codemeta/codemeta/minitest",
+  "developmentStatus": "active",
+  "embargoDate": "2014-08-06T10:00:01Z",
+  "funding": "National Science Foundation grant #012345678",
+  "issueTracker": "https://github.com/codemeta/codemeta/issues",
+  "codemeta:maintainer": {
+    "@id": "http://orcid.org/0000-0002-2192-403X",
+    "@type": "Person",
+    "email": "slaughter@nceas.ucsb.edu",
+    "name": "Peter Slaughter"
+  },
+  "readme": "https://github.com/codemeta/codemeta/README.md",
+  "referencePublication": [
+    "DOI:10.1177/0165551504045850",
+    "DOI:10.1145/2815833.2816955"
+  ],
+  "codemeta:suggests": {
+    "name": "tokenizertools",
+    "operatingSystem": [
+      "MacOS",
+      "Linux"
+    ],
+    "version": "1.0"
+  }
+} 
+

Note that certain terms in the codemeta namespace are explicitly being typed as such (e.g. codemeta:maintainer rather than plain maintainer) by the compaction algorithm, because these terms do not have matching types in their original codemeta v1 context vs codemeta v2 context.

+
+
+

+Framing

+

We can use a frame to extract particular elements in a particular format. This is most useful when there are highly nested complex types. Framing with the @explicit tag is also a good way to filter out fields that we are not interested in, though these are usually less problematic for developers to work around.

+
frame <- 
+'{
+  "@context":"https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta-v2.jsonld",
+  "@type": "SoftwareSourceCode",
+  "@explicit": "true",
+  "readme": {},
+  "description": {},
+  "maintainer": {}
+}'
+
+jsonld_frame(v2_json, frame)
+
{
+  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta-v2.jsonld",
+  "@graph": [
+    {
+      "@id": "_:b0",
+      "@type": "SoftwareSourceCode",
+      "description": "Codemeta is a metadata content standard for software.  It includes schemas in JSON-LD and XML Schema for providing semantics and validation.",
+      "codemeta:maintainer": {
+        "@id": "http://orcid.org/0000-0002-2192-403X",
+        "@type": "Person",
+        "affiliation": "NCEAS",
+        "email": "slaughter@nceas.ucsb.edu",
+        "name": "Peter Slaughter"
+      },
+      "readme": "https://github.com/codemeta/codemeta/README.md"
+    }
+  ]
+} 
+

Note that our frame can refer to maintainer even though the compaction has left the Property as codemeta:maintainer.

+
+
+
+ + + +
+ + +
+ +
+

Site built with pkgdown.

+
+ +
+
+ + + diff --git a/docs/authors.html b/docs/authors.html index 50edab55..4953517b 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -25,12 +25,14 @@ - + + + @@ -57,7 +59,12 @@ @@ -74,8 +81,8 @@

Authors

diff --git a/docs/codemeta.json b/docs/codemeta.json new file mode 100644 index 00000000..71780cec --- /dev/null +++ b/docs/codemeta.json @@ -0,0 +1,136 @@ +{ + "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld", + "@type": "SoftwareSourceCode", + "identifier": "testthat", + "description": "A unit testing system designed to be fun, flexible and easy to\n set up.", + "name": "testthat: Unit Testing for R", + "codeRepository": "https://github.com/hadley/testthat", + "issueTracker": "https://github.com/hadley/testthat/issues", + "datePublished": "2016-04-23 08:37:40", + "licenseId": "MIT + file LICENSE", + "version": "1.0.2", + "programmingLanguage": { + "@type": "ComputerLanguage", + "name": "R", + "version": "3.4.0", + "url": "https://r-project.org" + }, + "runtimePlatform": "R version 3.4.0 (2017-04-21)", + "author": [ + { + "@type": "Person", + "givenName": "Hadley", + "familyName": "Wickham", + "email": "hadley@rstudio.com" + } + ], + "copyrightHolder": [ + { + "@type": "Organization", + "name": "RStudio" + } + ], + "maintainer": { + "@type": "Person", + "givenName": "Hadley", + "familyName": "Wickham", + "email": "hadley@rstudio.com" + }, + "suggests": [ + { + "@type": "SoftwareApplication", + "name": "devtools", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "withr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "covr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + } + ], + "softwareRequirements": [ + { + "@type": "SoftwareApplication", + "name": "digest", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "crayon", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "praise", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "magrittr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "R6", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "methods" + }, + { + "@type": "SoftwareApplication", + "name": "R", + "version": "3.1.0)" + } + ], + "keywords": [ + "metadata", + "ropensci" + ] +} diff --git a/docs/index.html b/docs/index.html index d7b92252..42df37d7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,7 +9,7 @@ - @@ -35,7 +35,14 @@ Articles - + @@ -55,40 +62,194 @@
+codemetar

The goal of codemetar is to generate the JSON-LD file, codemeta.json containing software metadata describing an R package

- Installation

+Installation

You can install codemetar from github with:

# install.packages("devtools")
 devtools::install_github("codemeta/codemetar")
+
library("codemetar")

- Example

+Example

This is a basic example which shows you how to generate a codemeta.json for an R package (e.g. for testthat):

-
codemetar::write_codemeta("testthat")
+
write_codemeta("testthat")
+

codemetar can take the path to the package root instead. This may allow codemetar to glean some additional information that is not available from the description file alone.

+ +
{
+  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
+  "@type": "SoftwareSourceCode",
+  "identifier": "testthat",
+  "description": "A unit testing system designed to be fun, flexible and easy to\n    set up.",
+  "name": "testthat: Unit Testing for R",
+  "codeRepository": "https://github.com/hadley/testthat",
+  "issueTracker": "https://github.com/hadley/testthat/issues",
+  "datePublished": "2016-04-23 08:37:40",
+  "licenseId": "MIT + file LICENSE",
+  "version": "1.0.2",
+  "programmingLanguage": {
+    "@type": "ComputerLanguage",
+    "name": "R",
+    "version": "3.4.0",
+    "url": "https://r-project.org"
+  },
+  "runtimePlatform": "R version 3.4.0 (2017-04-21)",
+  "author": [
+    {
+      "@type": "Person",
+      "givenName": "Hadley",
+      "familyName": "Wickham",
+      "email": "hadley@rstudio.com"
+    }
+  ],
+  "copyrightHolder": [
+    {
+      "@type": "Organization",
+      "name": "RStudio"
+    }
+  ],
+  "maintainer": {
+    "@type": "Person",
+    "givenName": "Hadley",
+    "familyName": "Wickham",
+    "email": "hadley@rstudio.com"
+  },
+  "suggests": [
+    {
+      "@type": "SoftwareApplication",
+      "name": "devtools",
+      "provider": {
+        "@id": "https://cran.r-project.org",
+        "@type": "Organization",
+        "name": "Central R Archive Network (CRAN)",
+        "url": "https://cran.r-project.org"
+      }
+    },
+    {
+      "@type": "SoftwareApplication",
+      "name": "withr",
+      "provider": {
+        "@id": "https://cran.r-project.org",
+        "@type": "Organization",
+        "name": "Central R Archive Network (CRAN)",
+        "url": "https://cran.r-project.org"
+      }
+    },
+    {
+      "@type": "SoftwareApplication",
+      "name": "covr",
+      "provider": {
+        "@id": "https://cran.r-project.org",
+        "@type": "Organization",
+        "name": "Central R Archive Network (CRAN)",
+        "url": "https://cran.r-project.org"
+      }
+    }
+  ],
+  "softwareRequirements": [
+    {
+      "@type": "SoftwareApplication",
+      "name": "digest",
+      "provider": {
+        "@id": "https://cran.r-project.org",
+        "@type": "Organization",
+        "name": "Central R Archive Network (CRAN)",
+        "url": "https://cran.r-project.org"
+      }
+    },
+    {
+      "@type": "SoftwareApplication",
+      "name": "crayon",
+      "provider": {
+        "@id": "https://cran.r-project.org",
+        "@type": "Organization",
+        "name": "Central R Archive Network (CRAN)",
+        "url": "https://cran.r-project.org"
+      }
+    },
+    {
+      "@type": "SoftwareApplication",
+      "name": "praise",
+      "provider": {
+        "@id": "https://cran.r-project.org",
+        "@type": "Organization",
+        "name": "Central R Archive Network (CRAN)",
+        "url": "https://cran.r-project.org"
+      }
+    },
+    {
+      "@type": "SoftwareApplication",
+      "name": "magrittr",
+      "provider": {
+        "@id": "https://cran.r-project.org",
+        "@type": "Organization",
+        "name": "Central R Archive Network (CRAN)",
+        "url": "https://cran.r-project.org"
+      }
+    },
+    {
+      "@type": "SoftwareApplication",
+      "name": "R6",
+      "provider": {
+        "@id": "https://cran.r-project.org",
+        "@type": "Organization",
+        "name": "Central R Archive Network (CRAN)",
+        "url": "https://cran.r-project.org"
+      }
+    },
+    {
+      "@type": "SoftwareApplication",
+      "name": "methods"
+    },
+    {
+      "@type": "SoftwareApplication",
+      "name": "R",
+      "version": "3.1.0)"
+    }
+  ]
+}
+
+
+

+Enriching CodeMeta metadata

+

The best way to ensure codemeta.json is as complete as possible is to begin by making full use of the fields that can be set in an R package DESCRIPTION file, such as BugReports and URL. Using the Authors@R notation allows a much richer specification of author roles, correct parsing of given vs family names, and email addresses.

+

In the current implementation, developers may specify an ORCID url for an author in the optional comment field of Authors@R, e.g.

+
Authors@R: person("Carl", "Boettiger", role=c("aut", "cre", "cph"), email="cboettig@gmail.com", comment="http://orcid.org/0000-0002-1642-628X")
+

which will allow codemetar to associate an identifier with the person. This is clearly something of a hack since R’s person object lacks an explicit notion of id, and may be frowned upon.

+

Additional metadata can be added by creating and manipulating a codemeta list in R:

+
cm <- create_codemeta(".")
+cm$keywords <- list("metadata", "ropensci")
+write_codemeta(cm)
diff --git a/docs/pkgdown.css b/docs/pkgdown.css index fd7b0ba4..9c437c74 100644 --- a/docs/pkgdown.css +++ b/docs/pkgdown.css @@ -36,11 +36,8 @@ img.icon { /* Section anchors ---------------------------------*/ -.hasAnchor { - margin-left: -30px; -} - a.anchor { + margin-left: -30px; display:inline-block; width: 30px; height: 30px; @@ -56,6 +53,13 @@ a.anchor { visibility: visible; } +@media (max-width: 767px) { + .hasAnchor:hover a.anchor { + visibility: hidden; + } +} + + /* Fixes for fixed navbar --------------------------*/ .contents h1, .contents h2, .contents h3, .contents h4 { @@ -63,6 +67,17 @@ a.anchor { margin-top: -60px; } +/* Static header placement on mobile devices */ +@media (max-width: 767px) { + .navbar-fixed-top { + position: absolute; + } + .navbar { + padding: 0; + } +} + + /* Sidebar --------------------------*/ #sidebar { @@ -81,33 +96,59 @@ a.anchor { margin-bottom: 0.5em; } -/* Syntax highlighting ---------------------------------------------------- */ +/* Reference index & topics ----------------------------------------------- */ -code { - background-color: #f7f7f7; - color: #333; -} -code a { - color: #375f84; +.ref-index th {font-weight: normal;} +.ref-index h2 {font-size: 20px;} + +.ref-index td {vertical-align: top;} +.ref-index .alias {width: 40%;} +.ref-index .title {width: 60%;} + +.ref-index .alias {width: 40%;} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top;} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; } -.warning { color: red; } -.message { font-weight: bolder; } -.error { color: red; font-weight: bolder; } +/* Syntax highlighting ---------------------------------------------------- */ -.fl,.number {color:rgb(21,20,181);} -.fu,.functioncall {color:#264D66 ;} -.ch,.st,.string {color:#375D81 ;} -.kw,.keyword {color:black;} -.argument {color:#264D66 ;} -.co,.comment {color: #777;} -.formalargs {color: #264D66;} -.eqformalargs {color:#264D66;} -.slot {font-style:italic;} -.symbol {color:black ;} -.prompt {color:black ;} +pre { + word-wrap: normal; + word-break: normal; + border: 1px solid #eee; +} + +pre, code { + background-color: #f8f8f8; + color: #333; +} pre img { background-color: #fff; display: block; } + +code a, pre a { + color: #375f84; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.message { color: black; font-weight: bolder;} +.error { color: orange; font-weight: bolder;} +.warning { color: #6A0366; font-weight: bolder;} + diff --git a/docs/reference/codemeta.json b/docs/reference/codemeta.json index 34cca0e9..602fd480 100644 --- a/docs/reference/codemeta.json +++ b/docs/reference/codemeta.json @@ -1,71 +1,161 @@ { - "identifier": "codemetar", "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld", "@type": "SoftwareSourceCode", - "title": "Generate CodeMeta Metadata for R Packages", + "identifier": "codemetar", "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.", - "name": "codemetar", - "licenseId": "FreeBSD", + "name": "codemetar: Generate CodeMeta Metadata for R Packages", + "codeRepository": "https://github.com/codemeta/codemetar", + "issueTracker": "https://github.com/codemeta/codemetar/issues", + "licenseId": "MIT + file LICENSE", "version": "0.1.0", "programmingLanguage": { + "@type": "ComputerLanguage", "name": "R", - "version": "3.3.3", - "URL": "https://r-project.org" + "version": "3.4.0", + "url": "https://r-project.org" }, - "agents": [ + "runtimePlatform": "R version 3.4.0 (2017-04-21)", + "author": [ + { + "@type": "Person", + "givenName": "Carl", + "familyName": "Boettiger", + "email": "cboettig@gmail.com", + "@id": "http://orcid.org/0000-0002-1642-628X" + } + ], + "copyrightHolder": [ { - "@id": {}, - "@type": "person", - "name": "Carl Boettiger", + "@type": "Person", + "givenName": "Carl", + "familyName": "Boettiger", "email": "cboettig@gmail.com", - "isMaintainer": true, - "role": ["aut", "cre"] + "@id": "http://orcid.org/0000-0002-1642-628X" } ], + "maintainer": { + "@type": "Person", + "givenName": "Carl", + "familyName": "Boettiger", + "email": "cboettig@gmail.com", + "@id": "http://orcid.org/0000-0002-1642-628X" + }, "suggests": [ { - "identifier": {}, + "@type": "SoftwareApplication", "name": "testthat", - "version": null, - "packageSystem": "http://cran.r-project.org" + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "jsonvalidate", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "jsonld", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } }, { - "identifier": {}, - "name": " jsonvalidate", - "version": null, - "packageSystem": "http://cran.r-project.org" + "@type": "SoftwareApplication", + "name": "covr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } }, { - "identifier": {}, - "name": " jsonld", - "version": null, - "packageSystem": "http://cran.r-project.org" + "@type": "SoftwareApplication", + "name": "knitr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } }, { - "identifier": {}, - "name": " covr", - "version": null, - "packageSystem": "http://cran.r-project.org" + "@type": "SoftwareApplication", + "name": "rmarkdown", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } }, { - "identifier": {}, - "name": " knitr", - "version": null, - "packageSystem": "http://cran.r-project.org" + "@type": "SoftwareApplication", + "name": "httr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } }, { - "identifier": {}, - "name": " rmarkdown", - "version": null, - "packageSystem": "http://cran.r-project.org" + "@type": "SoftwareApplication", + "name": "tidyverse", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } } ], - "depends": [ + "softwareRequirements": [ { - "identifier": {}, + "@type": "SoftwareApplication", "name": "jsonlite", "version": "1.3", - "packageSystem": "http://cran.r-project.org" + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Central R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + } + }, + { + "@type": "SoftwareApplication", + "name": "utils" + }, + { + "@type": "SoftwareApplication", + "name": "methods" + }, + { + "@type": "SoftwareApplication", + "name": "stats" + }, + { + "@type": "SoftwareApplication", + "name": "R", + "version": "3.0.0)" } + ], + "contIntegration": "https://travis-ci.org/codemeta/codemetar", + "developmentStatus": "wip", + "keywords": [ + "metadata", + "ropensci" ] } diff --git a/docs/reference/create_codemeta.html b/docs/reference/create_codemeta.html new file mode 100644 index 00000000..6c3bab31 --- /dev/null +++ b/docs/reference/create_codemeta.html @@ -0,0 +1,145 @@ + + + + + + + + +create_codemeta — create_codemeta • codemetar + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + + +

create a codemeta list object in R for further manipulation

+ + +
create_codemeta(pkg = ".", root = ".", version = "2", ...)
+ +

Arguments

+ + + + + + + + + + + + + + + + + + +
pkg

package path to package root, or package name, or description file (character), or a codemeta object (list)

root

if pkg is a codemeta object, optionally give the path to package root. Default guess is current dir.

version

schema version

...

additional arguments to write_json

+ +

Value

+ +

a codemeta list object

+ + +

Examples

+
cm <- create_codemeta("jsonlite") +cm$keywords <- list("metadata", "ropensci") +write_codemeta(cm)
+
+ +
+ +
+ + +
+

Site built with pkgdown.

+
+ +
+
+ + + diff --git a/docs/reference/crosswalk.html b/docs/reference/crosswalk.html new file mode 100644 index 00000000..15fb1bac --- /dev/null +++ b/docs/reference/crosswalk.html @@ -0,0 +1,185 @@ + + + + + + + + +Crosswalk a column to return a JSON-LD context for it based on codemeta — crosswalk • codemetar + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + + +

Crosswalk a column to return a JSON-LD context for it based on codemeta

+ + +
crosswalk(column, cw_table = NULL, to_json = FALSE)
+ +

Arguments

+ + + + + + + + + + + + + + +
column

column name from the CrossWalk table (character vector)

cw_table

A CrossWalk table. call to readr::read_csv("https://github.com/codemeta/codemeta/raw/master/crosswalk.csv") or use default cached copy.

to_json

logical, should the result be turned into a json string? +Default FALSE, which permits easier manipulation such as adding this +context to an existing list before serializing to JSON

+ +

Value

+ +

a context list, which can be converted to a json string

+ + +

Examples

+
crosswalk("Zenodo")
#> $schema +#> [1] "http://schema.org/" +#> +#> $codemeta +#> [1] "https://codemeta.github.io/terms/" +#> +#> $relatedLink +#> [1] "schema:codeRepository" +#> +#> $communities +#> [1] "schema:applicationCategory" +#> +#> $creators +#> [1] "schema:author" +#> +#> $date_published +#> [1] "schema:datePublished" +#> +#> $contributors +#> [1] "schema:funder" +#> +#> $keywords +#> [1] "schema:keywords" +#> +#> $license +#> [1] "schema:license" +#> +#> $description +#> [1] "schema:description" +#> +#> $id +#> [1] "schema:identifier" +#> +#> $title +#> [1] "schema:name" +#> +#> $affiliation +#> [1] "schema:affiliation" +#> +#> $ORCID +#> [1] "schema:identifier" +#> +#> $name +#> [1] "schema:name" +#>
+
+ +
+ +
+ + +
+

Site built with pkgdown.

+
+ +
+
+ + + diff --git a/docs/reference/index.html b/docs/reference/index.html index fa321b58..1d0a21ef 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -25,12 +25,14 @@ - + + + @@ -57,7 +59,12 @@ @@ -69,20 +76,48 @@
-

All functions

-

- - -

write_codemeta

- - + + + + + + + + + + + + + + + + + + + + + + + + + +
+

All functions

+

+
+

create_codemeta

+

create_codemeta

+

crosswalk

+

Crosswalk a column to return a JSON-LD context for it based on codemeta

+

write_codemeta

+

write_codemeta

diff --git a/docs/reference/write_codemeta.html b/docs/reference/write_codemeta.html index 779e264e..17cd290e 100644 --- a/docs/reference/write_codemeta.html +++ b/docs/reference/write_codemeta.html @@ -25,12 +25,14 @@ - + + + @@ -57,7 +59,12 @@
@@ -76,29 +83,45 @@

write_codemeta

write_codemeta

-
write_codemeta(pkg = ".", id = NULL, path = "codemeta.json",
-  pretty = TRUE, auto_unbox = TRUE, ...)
+
write_codemeta(pkg = ".", path = "codemeta.json", root = ".",
+  version = "2", ...)

Arguments

-
-
pkg
-
package description file, can be path or package name.
-
id
-
an id for the package, such as the Zenodo DOI. a UUID will be generated if none is provided
-
path
-
file name of the output, leave at default "codemeta.json"
-
pretty
-
formatting option to write_json
-
auto_unbox
-
formatting option to write_json
-
...
-
additional arguments to write_json
-
+ + + + + + + + + + + + + + + + + + + + + + +
pkg

package path to package root, or package name, or description file (character), or a codemeta object (list)

path

file name of the output, leave at default "codemeta.json"

root

if pkg is a codemeta object, optionally give the path to package root. Default guess is current dir.

version

schema version

...

additional arguments to write_json

Value

writes out the codemeta.json file

+

Details

+ +

If pkg is a codemeta object, the function will attempt to + update any fields it can guess (i.e. from the DESRIPTION file), + overwriting any existing data in that block. In this case, the package + root directory should be the current working directory.

+

Examples

write_codemeta("codemetar")
@@ -109,6 +132,8 @@

Contents

  • Arguments
  • Value
  • + +
  • Details
  • Examples