Skip to content

Commit

Permalink
notes on meta from gh, #20
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettig committed Jul 11, 2017
1 parent 0f8488d commit 157cfd1
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions inst/notebook/meta_from_gh.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
library("gh")
library("jsonlite")
library("jsonld")
library("codemetar")
library("magrittr")
library("readr")
library("dplyr")


codemeta <- "https://doi.org/10.5063/schema/codemeta-2.0"
#github <- codemetar::crosswalk("GitHub")

github <-
"https://github.com/codemeta/codemeta/raw/master/crosswalk.csv" %>%
read_csv() %>%
select(Property, `GitHub`) %>%
filter(!is.na(`GitHub`))

codemeta_context <- read_json(codemeta)
properties <- names(codemeta_context[[1]])

## replace property names according to crosswalk data.frame
for(i in 1:dim(github)[2]){
# properties github
}



r <- gh("/repos/:owner/:repo", owner = "ropensci", repo = "EML")
r$`@context` <- github

toJSON(r, auto_unbox = TRUE, pretty = TRUE) %>%
jsonld_expand() %>%
jsonld_compact(context = codemeta) -> out



toJSON(r, auto_unbox = TRUE, pretty = TRUE) %>%
jsonld_expand()

#l <- fromJSON(j)


cm <- codemetar:::new_codemeta()

cm$identifier <- r$id

0 comments on commit 157cfd1

Please sign in to comment.