---
title: "Optical Spectroscopy JSON-LD"
author: "Leean Jo, Erika I. Barcelos, Laura S. Bruckman, Roger H. French"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Optical Spectroscopy JSON-LD}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

Optical Spectroscopy JSON-LD Description
-----------------------------------
This json-ld template is used to store metadata information commonly used to describe optical spectroscopy measurements including FTIR, UV-vis, Raman, Fluorescence and Optical emission spectroscopies. 

It includes some key meta information about the experimental setup, equipment and sample information, such as material type, wavelength,intensity, analysis method concentration etc.The results and calibration data is also included in some spectroscopic techniques - Inductively Coupled Plasma Optical Emission. A more detailed structure is shown below, each branch represents a type of spectroscopy and the data and metadata associated to it. 

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

# An example data frame for Optical Spectroscopy
# FTIR spectroscopy example from PMMA samples

FTIR_example <- data.frame(
  'wavelength' = c('649.57', '2650.5'),
  'spc' = c('0.019966', '0.00315458'),
  'SampleMaterial' = c('UVT', 'FF1'),
  'SamplePhase' = c('solid', 'solid'),
  'sampleID' = c('sa17435', 'sa17559')
)

# This will generate JSON-LD file for the example data
output <- fairify_data(FTIR_example, domain = 'OpticalSpectroscopy', saveLocal = TRUE)
```

Creating JSON-LD for Optical Spectroscopy in Python
------------------------------------------
```{python, eval = FALSE, python.reticulate = FALSE}
from fairmaterials.fairify_data import *
import pandas as pd

# An example data frame for Optical Spectroscopy
# FTIR spectroscopy example from PMMA samples
FTIR_example = pd.DataFrame({
  'wavelength': ['649.57', '2650.5'],
  'spc': ['0.019966', '0.00315458'],
  'SampleMaterial': ['UVT', 'FF1'],
  'SamplePhase': ['solid', 'solid'],
  'sampleID': ['sa17435', 'sa17559']
})

# This will generate JSON-LD file for the example data
output <- fairify_data(FTIR_example, domain = 'OpticalSpectroscopy')
```

Optical Spectroscopy schema diagram
--------------------------

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

Acknowledgment
--------------------------
