Skip to content

Commit

Permalink
add gadi path to nci file
Browse files Browse the repository at this point in the history
  • Loading branch information
dansand committed May 22, 2024
1 parent 4b4c778 commit 089ca20
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 5 additions & 3 deletions .github/scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# Example of global parameters

#DOIS
MATE_DOI = 'http://dx.doi.org/10.25914/yrzp-g882'
MATE_WEBSITE = 'https://mate.science/'
MATE_GITHUB = 'https://github.com/ModelAtlasofTheEarth/'
MATE_DOI = 'http://dx.doi.org/10.25914/yrzp-g882'
MATE_WEBSITE = 'https://mate.science/'
MATE_GITHUB = 'https://github.com/ModelAtlasofTheEarth/'
MATE_GADI = '/g/data/nm08/MATE/'

#MATE_THREDDS_BASE = "https://dapds00.nci.org.au/thredds/catalog/nm08/MATE/{}/catalog.html"
#updated version: https://opus.nci.org.au/display/NDP/THREDDS+Upgrade
MATE_THREDDS_BASE = "https://thredds.nci.org.au/thredds/catalog/nm08/MATE/{}/catalog.html"
Expand Down
9 changes: 5 additions & 4 deletions .github/scripts/crosswalks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import copy
from pyld import jsonld
import pandas as pd
from config import MATE_GADI

Ryaml = ruamel.yaml.YAML(typ=['rt', 'string'])
Ryaml.preserve_quotes = True
Expand Down Expand Up @@ -360,10 +361,10 @@ def metadata_to_nci(ro_crate):
#extract funders and authors into a NCI/ISO format
funders = extract_funder_details(ro_crate_nested)
authors = extract_creator_details(ro_crate_nested)

root = 'root' # Key for root element
#license_id = ro_crate_nested.get_nested(f"{root}.license.@id") #get the license id
license_id = ro_crate_nested.get_nested(f"{root}.license") #get the license id

#build up any composite values
nci_file_path = MATE_GADI + ro_crate_nested.get_nested(f"{root}.alternateName")

fields_data = {
"Title*": list_to_string(ro_crate_nested.get_nested(f"{root}.name")),
Expand All @@ -381,7 +382,7 @@ def metadata_to_nci(ro_crate):
"Owner* (if applicable)": "",
"Credit": "",
"Supplemental or supporting material": "",
"Local NCI file path": "",
"Local NCI file path": nci_file_path,
"DOI (NCI Internal Field)": list_to_string(ro_crate_nested.get_nested(f"{root}.identifier")),
"Keyword/s": list_to_string(ro_crate_nested.get_nested(f"{root}.keywords"))
}
Expand Down
2 changes: 2 additions & 0 deletions .github/scripts/write_repo_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@


#######
#Not sure why, but placing this block above the flatten block made a difference.
csv_buffer = StringIO()
#get a iso record as pandas df...
nci_iso_record = metadata_to_nci(rocratedict)
Expand All @@ -58,6 +59,7 @@
csv_content = csv_buffer.getvalue()
model_repo.create_file("metadata_trail/nci_iso.csv","add nci_iso record csv", csv_content)

#This is modifying rocratedict in place, which was not the intention
try:

expanded = jsonld.expand(rocratedict)
Expand Down

0 comments on commit 089ca20

Please sign in to comment.