Skip to content

Commit

Permalink
production push
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfiex committed Nov 21, 2024
1 parent 344446e commit 54a785a
Show file tree
Hide file tree
Showing 437 changed files with 21,923 additions and 0 deletions.
Binary file added data_descriptors/.DS_Store
Binary file not shown.
Empty file added data_descriptors/.nojekyll
Empty file.
27 changes: 27 additions & 0 deletions data_descriptors/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Load JSON Key Display</title>
<link rel='stylesheet' href='https://bootswatch.com/5/sketchy/bootstrap.css'>
<style>
body { padding:10px; }
h2 { font-size:0.8rem; margin-left: 10px }
h3 { font-size:0.6rem; margin-left: 15px ; color:gray }
p { margin-left: 30px }
pre {border: none; padding:40px}
ul {padding-left: 40px}
</style>
</head>
<body>
<h1 id='title'>Data Descriptor</h1>
<div>
<code id="content"></code>
</div>

<script src='https://wcrp-cmip.github.io/CMIP-LD/static/404_restful.js'>

</script>
</body>
</html>
14 changes: 14 additions & 0 deletions data_descriptors/_context_
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@context": {
"@base": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/",
"@vocab": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/",
"id": "@id",
"type": "@type",
"cf": "https://wcrp-cmip.github.io/WCRP-CMIP/CF/",
"cmip6plus": "https://wcrp-cmip.github.io/CMIP6Plus_CVs/",
"cmip7": "https://wcrp-cmip.github.io/CMIP7_CVs/",
"mip-variables": "https://wcrp-cmip.github.io/MIPvariables/",
"wcrp-universe": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/"
},
"@embed": "@always"
}
Binary file added data_descriptors/activity/.DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions data_descriptors/activity/_context_
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"@context": [
"../_context_",
{
"@base": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/activity/",
"@vocab": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/activity/"
}
],
"@embed": "@always"
}
8 changes: 8 additions & 0 deletions data_descriptors/activity/cmip
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@context": "_context_",
"id": "cmip",
"type": "activity",
"description": "CMIP DECK: 1pctCO2, abrupt4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments",
"name": "CMIP",
"url": "https://gmd.copernicus.org/articles/9/1937/2016/gmd-9-1937-2016.pdf"
}
8 changes: 8 additions & 0 deletions data_descriptors/activity/cmip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@context": "_context_",
"id": "cmip",
"type": "activity",
"description": "CMIP DECK: 1pctCO2, abrupt4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments",
"name": "CMIP",
"url": "https://gmd.copernicus.org/articles/9/1937/2016/gmd-9-1937-2016.pdf"
}
43 changes: 43 additions & 0 deletions data_descriptors/activity/graph
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"@context": {
"@base": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/activity/",
"@vocab": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/activity/",
"id": "@id",
"type": "@type",
"cf": "https://wcrp-cmip.github.io/WCRP-CMIP/CF/",
"cmip6plus": "https://wcrp-cmip.github.io/CMIP6Plus_CVs/",
"cmip7": "https://wcrp-cmip.github.io/CMIP7_CVs/",
"mip-variables": "https://wcrp-cmip.github.io/MIPvariables/",
"wcrp-universe": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/"
},
"@graph": [
{
"id": "cmip",
"type": "activity",
"description": "CMIP DECK: 1pctCO2, abrupt4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments",
"name": "CMIP",
"url": "https://gmd.copernicus.org/articles/9/1937/2016/gmd-9-1937-2016.pdf"
}
,{
"id": "lesfmip",
"type": "activity",
"description": "The Large Ensemble Single Forcing Model Intercomparison Project",
"name": "LESFMIP",
"url": "https://www.frontiersin.org/articles/10.3389/fclim.2022.955414/full"
}
,{
"id": "ramip",
"type": "activity",
"description": "Regional Aerosol Model Intercomparison Project",
"name": "RAMIP",
"url": "https://ramip.ncas.ac.uk"
}
,{
"id": "tipmip",
"type": "activity",
"description": "Tipping Point Model Intercomparison Project",
"name": "TIPMIP",
"url": "https://tipmip.pik-potsdam.de/"
}
]
}
43 changes: 43 additions & 0 deletions data_descriptors/activity/graph.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"@context": {
"@base": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/activity/",
"@vocab": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/activity/",
"id": "@id",
"type": "@type",
"cf": "https://wcrp-cmip.github.io/WCRP-CMIP/CF/",
"cmip6plus": "https://wcrp-cmip.github.io/CMIP6Plus_CVs/",
"cmip7": "https://wcrp-cmip.github.io/CMIP7_CVs/",
"mip-variables": "https://wcrp-cmip.github.io/MIPvariables/",
"wcrp-universe": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/"
},
"@graph": [
{
"id": "cmip",
"type": "activity",
"description": "CMIP DECK: 1pctCO2, abrupt4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments",
"name": "CMIP",
"url": "https://gmd.copernicus.org/articles/9/1937/2016/gmd-9-1937-2016.pdf"
}
,{
"id": "lesfmip",
"type": "activity",
"description": "The Large Ensemble Single Forcing Model Intercomparison Project",
"name": "LESFMIP",
"url": "https://www.frontiersin.org/articles/10.3389/fclim.2022.955414/full"
}
,{
"id": "ramip",
"type": "activity",
"description": "Regional Aerosol Model Intercomparison Project",
"name": "RAMIP",
"url": "https://ramip.ncas.ac.uk"
}
,{
"id": "tipmip",
"type": "activity",
"description": "Tipping Point Model Intercomparison Project",
"name": "TIPMIP",
"url": "https://tipmip.pik-potsdam.de/"
}
]
}
8 changes: 8 additions & 0 deletions data_descriptors/activity/lesfmip
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@context": "_context_",
"id": "lesfmip",
"type": "activity",
"description": "The Large Ensemble Single Forcing Model Intercomparison Project",
"name": "LESFMIP",
"url": "https://www.frontiersin.org/articles/10.3389/fclim.2022.955414/full"
}
8 changes: 8 additions & 0 deletions data_descriptors/activity/lesfmip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@context": "_context_",
"id": "lesfmip",
"type": "activity",
"description": "The Large Ensemble Single Forcing Model Intercomparison Project",
"name": "LESFMIP",
"url": "https://www.frontiersin.org/articles/10.3389/fclim.2022.955414/full"
}
8 changes: 8 additions & 0 deletions data_descriptors/activity/ramip
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@context": "_context_",
"id": "ramip",
"type": "activity",
"description": "Regional Aerosol Model Intercomparison Project",
"name": "RAMIP",
"url": "https://ramip.ncas.ac.uk"
}
8 changes: 8 additions & 0 deletions data_descriptors/activity/ramip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@context": "_context_",
"id": "ramip",
"type": "activity",
"description": "Regional Aerosol Model Intercomparison Project",
"name": "RAMIP",
"url": "https://ramip.ncas.ac.uk"
}
8 changes: 8 additions & 0 deletions data_descriptors/activity/tipmip
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@context": "_context_",
"id": "tipmip",
"type": "activity",
"description": "Tipping Point Model Intercomparison Project",
"name": "TIPMIP",
"url": "https://tipmip.pik-potsdam.de/"
}
8 changes: 8 additions & 0 deletions data_descriptors/activity/tipmip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@context": "_context_",
"id": "tipmip",
"type": "activity",
"description": "Tipping Point Model Intercomparison Project",
"name": "TIPMIP",
"url": "https://tipmip.pik-potsdam.de/"
}
65 changes: 65 additions & 0 deletions data_descriptors/archive/CLD2vIV.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import glob
import json
from collections import OrderedDict
import os
import subprocess





remote_url = subprocess.check_output(["git", "remote", "get-url", "origin"], text=True).strip()
user_repo = remote_url.split("github.com")[-1].replace(":", "/").replace(".git", "").strip("/")
pages_url = f"https://{user_repo.split('/')[0]}.github.io/{user_repo.split('/')[1]}"

# print(remote_url)
# print(user_repo)
# print(pages_url)
# https://github.com/WCRP-CMIP/WCRP-UNIVERSE.git
# WCRP-CMIP/WCRP-UNIVERSE
# https://WCRP-CMIP.github.io/WCRP-UNIVERSE


folders = glob.glob('*/')


for folder in folders:
print(folder)
files = glob.glob(folder + '*.json')
for file in files:
with open(file, 'r') as f:

js = json.load(f)

if '@type' not in js:
continue
js['id'] = file.split('/')[-1]
js['type'] = js['@type'].replace('-', '_')
js['@context'] = f'{pages_url}/data_descriptors/{folder}_context'
del js['@type'], js['@id']

js = OrderedDict(sorted(js.items()))


json.dump(js, open(file,'w') , indent=4)
# print(file)


# context new file
location = f"{pages_url}/data_descriptors/{folder}"
context = {

"@context": {
"@base": location,
"@vocab": location,
"id": "@id",
"type": "@type"
},
"@embed": "@always"
}

json.dump(context, open(f"{folder}_context.json", 'w'), indent=4)


os.system('rm -f ' + folder + '*.jsonld')

17 changes: 17 additions & 0 deletions data_descriptors/archive/idfix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
find . -type f -name "*-*.json" | while read -r file; do
new_file=$(echo "$file" | sed 's/-/_/g')
mv "$file" "$new_file"
done

find . -type f -name "*.json" | while read -r file; do
# Extract the filename without path and extension
filename=$(basename "$file" .json)

# Update the "id" field inside the JSON to match the new filename
perl -i -pe "s/\"id\" *: *\"[^\"]+\"/\"id\": \"$filename\"/" "$file"

# Change permissions to make the file readable for others but not writable
chmod 644 "$file"
done

rm -f */*.json-E
Binary file added data_descriptors/consortia/.DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions data_descriptors/consortia/_context_
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"@context": [
"../_context_",
{
"@base": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/consortia/",
"@vocab": "https://wcrp-cmip.github.io/WCRP-UNIVERSE/consortia/"
}
],
"@embed": "@always"
}
Loading

0 comments on commit 54a785a

Please sign in to comment.