Skip to content

Commit

Permalink
development
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfiex committed Dec 3, 2024
1 parent 417b184 commit 6cd6914
Showing 1 changed file with 173 additions and 15 deletions.
188 changes: 173 additions & 15 deletions notebooks/using_pyld.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,92 @@
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'activity_base' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[4], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m activity_graph \u001b[38;5;241m=\u001b[39m base\u001b[38;5;241m+\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mgraph\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m----> 3\u001b[0m jsonld\u001b[38;5;241m.\u001b[39mframe(\u001b[43mactivity_base\u001b[49m, base\u001b[38;5;241m+\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_context_\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
"\u001b[0;31mNameError\u001b[0m: name 'activity_base' is not defined"
]
"data": {
"text/plain": [
"{'@context': ['../_context_',\n",
" {'@base': 'https://wcrp-cmip.github.io/WCRP-UNIVERSE/activity/',\n",
" '@vocab': 'https://wcrp-cmip.github.io/WCRP-UNIVERSE/activity/'}],\n",
" '@graph': [{'id': 'wcrp-universe:activity/aerchemmip',\n",
" 'type': 'activity',\n",
" 'description': 'AerChemMIP experiments focus on the role of atmospheric chemistry and aerosols in climate, including piClim and hist-piSLCF simulations.',\n",
" 'name': 'AerChemMIP',\n",
" 'url': 'https://gmd.copernicus.org/articles/10/585/2017/gmd-10-585-2017.pdf'},\n",
" {'id': 'wcrp-universe:activity/c4mip',\n",
" 'type': 'activity',\n",
" 'description': 'C4MIP experiments focus on carbon cycle feedbacks and interactions, including 1pctCO2-bgc and esm-flat10-cdr experiments.',\n",
" 'name': 'C4MIP',\n",
" 'url': 'https://gmd.copernicus.org/articles/9/2853/2016/gmd-9-2853-2016.pdf'},\n",
" {'id': 'wcrp-universe:activity/cfmip',\n",
" 'type': 'activity',\n",
" 'description': 'CFMIP experiments focus on cloud feedbacks and their role in climate, including abrupt-0p5CO2 and amip-piForcing simulations.',\n",
" 'name': 'CFMIP',\n",
" 'url': 'https://gmd.copernicus.org/articles/10/359/2017/gmd-10-359-2017.pdf'},\n",
" {'id': 'wcrp-universe:activity/cmip',\n",
" 'type': 'activity',\n",
" 'description': 'CMIP DECK: 1pctCO2, abrupt-4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments',\n",
" 'name': 'CMIP',\n",
" 'url': 'https://gmd.copernicus.org/articles/9/1937/2016/gmd-9-1937-2016.pdf'},\n",
" {'id': 'wcrp-universe:activity/damip',\n",
" 'type': 'activity',\n",
" 'description': 'DAMIP focuses on detection and attribution of climate change, covering experiments like hist-aer and hist-nat.',\n",
" 'name': 'DAMIP',\n",
" 'url': 'https://gmd.copernicus.org/articles/13/7947/2020/gmd-13-7947-2020.pdf'},\n",
" {'id': 'wcrp-universe:activity/dcpp',\n",
" 'type': 'activity',\n",
" 'description': 'DCPP focuses on decadal climate predictions and initialized experiments like prediction for 2025-2036.',\n",
" 'name': 'DCPP',\n",
" 'url': 'https://gmd.copernicus.org/articles/9/3751/2016/gmd-9-3751-2016.pdf'},\n",
" {'id': 'wcrp-universe:activity/geomip',\n",
" 'type': 'activity',\n",
" 'description': 'GeoMIP explores the potential impacts and side-effects of geoengineering, including experiments like G7-1.5K-SAI.',\n",
" 'name': 'GeoMIP',\n",
" 'url': 'https://gmd.copernicus.org/articles/8/989/2015/gmd-8-989-2015.pdf'},\n",
" {'id': 'wcrp-universe:activity/lesfmip',\n",
" 'type': 'activity',\n",
" 'description': 'The Large Ensemble Single Forcing Model Intercomparison Project',\n",
" 'name': 'LESFMIP',\n",
" 'url': 'https://www.frontiersin.org/articles/10.3389/fclim.2022.955414/full'},\n",
" {'id': 'wcrp-universe:activity/lmip',\n",
" 'type': 'activity',\n",
" 'description': 'LMIP explores land-atmosphere interactions and processes, with experiments like land-hist.',\n",
" 'name': 'LMIP',\n",
" 'url': 'https://gmd.copernicus.org/articles/10/3977/2017/gmd-10-3977-2017.pdf'},\n",
" {'id': 'wcrp-universe:activity/pmip',\n",
" 'type': 'activity',\n",
" 'description': 'PMIP focuses on past climate variability, with experiments like LIGabrupt.',\n",
" 'name': 'PMIP',\n",
" 'url': 'https://gmd.copernicus.org/articles/9/3461/2016/gmd-9-3461-2016.pdf'},\n",
" {'id': 'wcrp-universe:activity/ramip',\n",
" 'type': 'activity',\n",
" 'description': 'Regional Aerosol Model Intercomparison Project',\n",
" 'name': 'RAMIP',\n",
" 'url': 'https://ramip.ncas.ac.uk'},\n",
" {'id': 'wcrp-universe:activity/rfmip',\n",
" 'type': 'activity',\n",
" 'description': 'RFMIP assesses the radiative forcing of climate change with experiments such as piClim-aer, piClim-histaer, and piClim-histall.',\n",
" 'name': 'RFMIP',\n",
" 'url': 'https://gmd.copernicus.org/articles/13/169/2020/gmd-13-169-2020.pdf'},\n",
" {'id': 'wcrp-universe:activity/scenariomip',\n",
" 'type': 'activity',\n",
" 'description': 'ScenarioMIP focuses on future climate projections based on different socio-economic pathways, including High, Medium, and Very Low scenarios.',\n",
" 'name': 'ScenarioMIP',\n",
" 'url': 'https://gmd.copernicus.org/articles/12/1443/2019/gmd-12-1443-2019.pdf'},\n",
" {'id': 'wcrp-universe:activity/tipmip',\n",
" 'type': 'activity',\n",
" 'description': 'Tipping Point Model Intercomparison Project',\n",
" 'name': 'TIPMIP',\n",
" 'url': 'https://tipmip.pik-potsdam.de/'}]}"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"activity_graph = base+'graph'\n",
"\n",
"jsonld.frame(activity_base, base+'_context_')"
"jsonld.frame(activity_graph, base+'_context_')"
]
},
{
Expand All @@ -105,7 +176,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -128,9 +199,32 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'@context': 'https://wcrp-cmip.github.io/WCRP-UNIVERSE/activity/_context_',\n",
" 'description': 'Regional Aerosol Model Intercomparison Project',\n",
" 'id': 'wcrp-universe:activity/ramip',\n",
" 'name': 'RAMIP',\n",
" 'source_activity': [{'id': 'cmip6plus:source/cesm2',\n",
" 'type': 'cmip6plus:source/source'},\n",
" {'id': 'cmip6plus:source/cnrm_esm2_1',\n",
" 'type': 'cmip6plus:source/source'},\n",
" {'id': 'cmip6plus:source/ec_earth_aerchem',\n",
" 'type': 'cmip6plus:source/source'},\n",
" {'id': 'cmip6plus:source/mri_esm2_0',\n",
" 'type': 'cmip6plus:source/source'},\n",
" {'id': 'cmip6plus:source/ukesm1_0_ll',\n",
" 'type': 'cmip6plus:source/source'}],\n",
" 'type': 'activity',\n",
" 'url': 'https://ramip.ncas.ac.uk'}\n"
]
}
],
"source": [
"frame = {\n",
" # use the activity context as we are interested in this\n",
Expand Down Expand Up @@ -164,9 +258,73 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'@context': 'https://wcrp-cmip.github.io/WCRP-UNIVERSE/activity/_context_',\n",
" '@graph': [{'id': 'wcrp-universe:activity/aerchemmip',\n",
" 'name': 'AerChemMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/10/585/2017/gmd-10-585-2017.pdf'},\n",
" {'id': 'wcrp-universe:activity/c4mip',\n",
" 'name': 'C4MIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/9/2853/2016/gmd-9-2853-2016.pdf'},\n",
" {'id': 'wcrp-universe:activity/cfmip',\n",
" 'name': 'CFMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/10/359/2017/gmd-10-359-2017.pdf'},\n",
" {'id': 'wcrp-universe:activity/cmip',\n",
" 'name': 'CMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/9/1937/2016/gmd-9-1937-2016.pdf'},\n",
" {'id': 'wcrp-universe:activity/damip',\n",
" 'name': 'DAMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/13/7947/2020/gmd-13-7947-2020.pdf'},\n",
" {'id': 'wcrp-universe:activity/dcpp',\n",
" 'name': 'DCPP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/9/3751/2016/gmd-9-3751-2016.pdf'},\n",
" {'id': 'wcrp-universe:activity/geomip',\n",
" 'name': 'GeoMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/8/989/2015/gmd-8-989-2015.pdf'},\n",
" {'id': 'wcrp-universe:activity/lesfmip',\n",
" 'name': 'LESFMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://www.frontiersin.org/articles/10.3389/fclim.2022.955414/full'},\n",
" {'id': 'wcrp-universe:activity/lmip',\n",
" 'name': 'LMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/10/3977/2017/gmd-10-3977-2017.pdf'},\n",
" {'id': 'wcrp-universe:activity/pmip',\n",
" 'name': 'PMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/9/3461/2016/gmd-9-3461-2016.pdf'},\n",
" {'id': 'wcrp-universe:activity/ramip',\n",
" 'name': 'RAMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://ramip.ncas.ac.uk'},\n",
" {'id': 'wcrp-universe:activity/rfmip',\n",
" 'name': 'RFMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/13/169/2020/gmd-13-169-2020.pdf'},\n",
" {'id': 'wcrp-universe:activity/scenariomip',\n",
" 'name': 'ScenarioMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://gmd.copernicus.org/articles/12/1443/2019/gmd-12-1443-2019.pdf'},\n",
" {'id': 'wcrp-universe:activity/tipmip',\n",
" 'name': 'TIPMIP',\n",
" 'type': 'activity',\n",
" 'url': 'https://tipmip.pik-potsdam.de/'}]}\n"
]
}
],
"source": [
"frame2 = {\n",
" # use the activity context as we are interested in this\n",
Expand Down

0 comments on commit 6cd6914

Please sign in to comment.