-
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
56 changed files
with
520 additions
and
0 deletions.
There are no files selected for viewing
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,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') | ||
|
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,9 @@ | ||
{ | ||
"@context": { | ||
"@base": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/", | ||
"@vocab": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/", | ||
"id": "@id", | ||
"type": "@type" | ||
}, | ||
"@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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "global mean data", | ||
"id": "gm.json", | ||
"name": "gm", | ||
"region": "greenland", | ||
"short name": "Greenland", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "data reported on a model's native grid", | ||
"id": "gn.json", | ||
"name": "gn", | ||
"region": "greenland", | ||
"short name": "Grid Native Greenland", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "data reported on a native grid in the region of Antarctica", | ||
"id": "gna.json", | ||
"name": "gna", | ||
"region": "antarctica", | ||
"short name": "Grid Native Antarctica Greenland", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "data reported on a native grid in the region of Greenland", | ||
"id": "gng.json", | ||
"name": "gng", | ||
"region": "greenland", | ||
"short name": "Grid Native Greenland", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "zonal mean data reported on a model's native latitude grid", | ||
"id": "gnz.json", | ||
"name": "gnz", | ||
"region": "greenland", | ||
"short name": "Grid Native Greenland Zonal Mean", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported on the data provider's preferred target grid", | ||
"id": "gr.json", | ||
"name": "gr", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr1.json", | ||
"name": "gr1", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate 1", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr1a.json", | ||
"name": "gr1a", | ||
"region": "antarctica", | ||
"short name": "Regridded Antarctica Greenland Alternate a", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr1g.json", | ||
"name": "gr1g", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate g", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded zonal mean data reported on a grid other than the native latitude grid and other than the preferred latitude target grid", | ||
"id": "gr1z.json", | ||
"name": "gr1z", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Zonal Mean Alternate z", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr2.json", | ||
"name": "gr2", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate 2", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr2a.json", | ||
"name": "gr2a", | ||
"region": "antarctica", | ||
"short name": "Regridded Antarctica Greenland Alternate a", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr2g.json", | ||
"name": "gr2g", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate g", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded zonal mean data reported on a grid other than the native latitude grid and other than the preferred latitude target grid", | ||
"id": "gr2z.json", | ||
"name": "gr2z", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Zonal Mean Alternate z", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr3.json", | ||
"name": "gr3", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate 3", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr3a.json", | ||
"name": "gr3a", | ||
"region": "antarctica", | ||
"short name": "Regridded Antarctica Greenland Alternate a", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr3g.json", | ||
"name": "gr3g", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate g", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded zonal mean data reported on a grid other than the native latitude grid and other than the preferred latitude target grid", | ||
"id": "gr3z.json", | ||
"name": "gr3z", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Zonal Mean Alternate z", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr4.json", | ||
"name": "gr4", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate 4", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr4a.json", | ||
"name": "gr4a", | ||
"region": "antarctica", | ||
"short name": "Regridded Antarctica Greenland Alternate a", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr4g.json", | ||
"name": "gr4g", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate g", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded zonal mean data reported on a grid other than the native latitude grid and other than the preferred latitude target grid", | ||
"id": "gr4z.json", | ||
"name": "gr4z", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Zonal Mean Alternate z", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr5.json", | ||
"name": "gr5", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate 5", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr5a.json", | ||
"name": "gr5a", | ||
"region": "antarctica", | ||
"short name": "Regridded Antarctica Greenland Alternate a", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr5g.json", | ||
"name": "gr5g", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate g", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded zonal mean data reported on a grid other than the native latitude grid and other than the preferred latitude target grid", | ||
"id": "gr5z.json", | ||
"name": "gr5z", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Zonal Mean Alternate z", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr6.json", | ||
"name": "gr6", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate 6", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Antarctica on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr6a.json", | ||
"name": "gr6a", | ||
"region": "antarctica", | ||
"short name": "Regridded Antarctica Greenland Alternate a", | ||
"type": "grid_label" | ||
} |
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,9 @@ | ||
{ | ||
"@context": "https://WCRP-CMIP.github.io/WCRP-UNIVERSE/data_descriptors/grid_label/_context", | ||
"description": "regridded data reported in the region of Greenland on a grid other than the native grid and other than the preferred target grid", | ||
"id": "gr6g.json", | ||
"name": "gr6g", | ||
"region": "greenland", | ||
"short name": "Regridded Greenland Alternate g", | ||
"type": "grid_label" | ||
} |
Oops, something went wrong.