---
title: "Soil JSON-LD"
author: "Deepa Bhuvanagiri, Vibha Mandayam, Jeffrey Yarus, Roger H. French"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Soil JSON-LD}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---
Soil(HWSD) JSON-LD Description
-----------------------------------
This JSON-LD Soil (HWSD) template consists set of features describing soil properties across the global stored in the Harmonized World Soil database. Data was collected to provide soil information to assist in assessing land potential productivity. Examples of features present include texture of the soil, water capacity, and depth of roots.

Creating JSON-LD for Soil(HWSD)  in R
------------------------------------------
```{r, message=FALSE, eval=FALSE}
library(FAIRmaterials)

# An example data frame for soil(HWSD) data
soil <- data.frame(
  'ID' = c("176","250"),
  'texture' = c('Coarse', 'None'),
  'AwC' = c('0', '50'),
  'roots' = c('60-80', '20-40'),
  'addProp' = c('Petric', 'Vertic')
)


# This will generate json-ld files for the example data
soil_output <- fairify_data(soil, domain ='soil', saveLocal = TRUE)
```


Creating JSON-LD for Soil(HWSD)  in Python
------------------------------------------

```{python, eval = FALSE, python.reticulate = FALSE}
from fairmaterials.fairify_data import *
import pandas as pd

# An example data frame for soil(HWSD) data

data = pd.DataFrame (
  'ID' = ["176","250"],
  'texture' = ['Coarse', 'None'],
  'AWC' = ['0', '50'],
  'roots' = ['60-80', '20-40'],
  'addProp' = ['Petric', 'Vertic']])
   
# This will generate JSON-LD file for the example data in Python
fairify_data(data, domain ='soil', saveLocal = TRUE)
```
 Soil(HWSD) schema diagram
--------------------------

```{r, out.width="1200px", echo=FALSE, fig.cap="soil(HWSD) schema diagram"}
knitr::include_graphics("soil.png")
```



References
--------------------------
https://jsonwelllogformat.org/
https://www.energistics.org/energistics-unit-of-measure-standard
https://schema.org/
https://www.iso.org/standard/73830.html
https://www.fao.org/soils-portal/data-hub/soil-maps-and-databases/harmonized-world-soil-database-v12/en/

Acknowledgment
--------------------------
This material is based upon work supported by SDLE Research Center 

