This is a data harvest exercise. The code below ingests data
as JSON. I would like to (a) print/extract the data schema from this data
into Schema1
. Then (b) compare it against some Schema2
, because I need to change some metadata header names and accepted values.
Ckan has a Python "IDatasetform" plugin that I apparently allows this kind of analysis, but I don't know how to do this in R. Thanks
library(ckanr)
ckanr_setup(url = "https://energydata.info")
data <- ckanr:::package_show('6c0d331b-4dca-4815-a006-264745cbb9d0', as = 'json', pretty = TRUE)
data <- jsonlite::fromJSON(data)$result
## extract Schema1 from 'data'
## compare Schema1 vs. Schema2