Created
March 17, 2024 13:47
-
-
Save egonw/91880159f5dc2c53ba6bcc2fdc45b8c7 to your computer and use it in GitHub Desktop.
Script to convert https://nanocommons.github.io/specifications/nanomile/ content (somewhat cleaned up) to ERM Identifier DB content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new File("/tmp/foo.tsv").eachLine { line -> | |
fields = line.split('\t') | |
nanomileid = fields[0] | |
ermid = fields[1] | |
ermidShort = ermid.split(':')[1] | |
content = """--- | |
title: "Material: ${ermidShort}" | |
type: ChemicalSubstance | |
id: ${ermidShort} | |
tag: ${ermid} | |
otherLinks: | |
- url: https://nanocommons.github.io/specifications/2023/WD-nanomile-20230423/ | |
title: NanoMILE nanomaterial identifiers | |
date: 2023-04-23 | |
type: report | |
format: html | |
sameAs: | |
- ${nanomileid} | |
--- | |
This material also has the NanoMILE identifier [${nanomileid}](https://nanocommons.github.io/specifications/nanomile/).""" | |
ermfilename = "${ermidShort}.yml" | |
new File("/home/egonw/var/Projects/hub/erm-database/_data/erm/${ermfilename}").text = content | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment