-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
437 changed files
with
21,923 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Empty file.
This file contains 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
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> |
This file contains 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
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 not shown.
This file contains 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
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" | ||
} |
This file contains 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
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" | ||
} |
This file contains 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
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" | ||
} |
This file contains 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
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/" | ||
} | ||
] | ||
} |
This file contains 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
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/" | ||
} | ||
] | ||
} |
This file contains 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
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" | ||
} |
This file contains 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
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" | ||
} |
This file contains 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
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" | ||
} |
This file contains 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
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" | ||
} |
This file contains 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
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/" | ||
} |
This file contains 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
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/" | ||
} |
This file contains 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
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') | ||
|
This file contains 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
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 not shown.
This file contains 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
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" | ||
} |
Oops, something went wrong.