Skip to content

Commit

Permalink
ORDO Mappings
Browse files Browse the repository at this point in the history
- Add: New release output: ordo-icd11.sssom.tsv
  • Loading branch information
joeflack4 committed Mar 28, 2024
1 parent 6a33343 commit 6660152
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 34,900 deletions.
270 changes: 135 additions & 135 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,135 +1,135 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

.idea/
tmp/

# Custom
_archive/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

.idea/
tmp/

# Custom
_archive/
117 changes: 60 additions & 57 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,57 +1,60 @@
.DEFAULT_GOAL := all
.PHONY: all release clean
TODAY ?=$(shell date +%Y-%m-%d)
VERSION=v$(TODAY)
SOURCE_URL=https://icd11files.blob.core.windows.net/tmp/whofic-2023-04-08.owl.gz


# MAIN COMMANDS / GOALS ------------------------------------------------------------------------------------------------
all: tmp/output/release/icd11foundation.owl

clean:
rm -rf tmp/

tmp/output/release/icd11foundation.owl: tmp/output/intermediate1-unicode-cleaned.owl
robot remove --axioms equivalent -i $< -o $@

# Cleans all unicode characters
tmp/output/intermediate1-unicode-cleaned.owl: tmp/input/source.owl | tmp/output/release/
tr -cd '\11\12\15\40-\176' < $< > $@

tmp/output/release/:
mkdir -p $@

tmp/input/:
mkdir -p $@

tmp/input/source.owl: tmp/input/source.gz
gunzip -c $< > $@
rm $<

tmp/input/source.gz: | tmp/input/
wget ${SOURCE_URL} -O $@

# Requires GitHub CLI: https://cli.github.com/
release: | tmp/output/release/
@test $(VERSION)
gh release create $(VERSION) --notes "New release." --title "$(VERSION)" tmp/output/release/*

# Mappings
tmp/input/mappings.json: | tmp/input/
wget -qO tmp/input/en_product1.json.tar.gz https://www.orphadata.com/data/json/en_product1.json.tar.gz
tar -xvf tmp/input/en_product1.json.tar.gz -C tmp/input/
mv tmp/input/en_product1.json $@
rm tmp/input/en_product1.json.tar.gz

tmp/output/release/ordo-icd11.sssom.tsv: tmp/input/mappings.json | tmp/output/release/
python3 src/make_sssom.py $< > $@

# HELP -----------------------------------------------------------------------------------------------------------------
help:
@echo "-----------------------------------"
@echo " Command reference: GARD OWL Ingest"
@echo "-----------------------------------"
@echo "all"
@echo "Runs ingest and creates all release artefacts.\n"
@echo "release"
@echo "Uploads release to GitHub.\n"
.DEFAULT_GOAL := all
.PHONY: all release clean
TODAY ?=$(shell date +%Y-%m-%d)
VERSION=v$(TODAY)
SOURCE_URL=https://icd11files.blob.core.windows.net/tmp/whofic-2023-04-08.owl.gz


# MAIN COMMANDS / GOALS ------------------------------------------------------------------------------------------------
all: tmp/output/release/icd11foundation.owl

clean:
rm -rf tmp/

tmp/output/release/icd11foundation.owl: tmp/output/intermediate1-unicode-cleaned.owl
robot remove --axioms equivalent -i $< -o $@

# Cleans all unicode characters
tmp/output/intermediate1-unicode-cleaned.owl: tmp/input/source.owl | tmp/output/release/
tr -cd '\11\12\15\40-\176' < $< > $@

tmp/output/release/:
mkdir -p $@

tmp/input/:
mkdir -p $@

tmp/input/source.owl: tmp/input/source.gz
gunzip -c $< > $@
rm $<

tmp/input/source.gz: | tmp/input/
wget ${SOURCE_URL} -O $@

# Requires GitHub CLI: https://cli.github.com/
release: | tmp/output/release/
@test $(VERSION)
gh release create $(VERSION) --notes "New release." --title "$(VERSION)" tmp/output/release/*

xxx: tmp/input/Orphanet_Nomenclature_Pack_EN/ORPHA_ICD11_mapping_en_newversion_2023.xml

# Mappings
tmp/input/Orphanet_Nomenclature_Pack_EN/ORPHA_ICD11_mapping_en_newversion_2023.xml: | tmp/input/
wget https://www.orphadata.com/data/nomenclature/packs/Orphanet_Nomenclature_Pack_EN.zip -O tmp/input/Orphanet_Nomenclature_Pack_EN.zip
# wget -qO tmp/input/en_product1.json.tar.gz https://www.orphadata.com/data/json/en_product1.json.tar.gz
# tar -xvf tmp/input/en_product1.json.tar.gz -C tmp/input/
# mv tmp/input/en_product1.json $@
# rm tmp/input/en_product1.json.tar.gz

tmp/output/release/ordo-icd11.sssom.tsv: tmp/input/Orphanet_Nomenclature_Pack_EN/ORPHA_ICD11_mapping_en_newversion_2023.xml | tmp/output/release/
python3 src/make_sssom.py $< > $@

# HELP -----------------------------------------------------------------------------------------------------------------
help:
@echo "-----------------------------------"
@echo " Command reference: GARD OWL Ingest"
@echo "-----------------------------------"
@echo "all"
@echo "Runs ingest and creates all release artefacts.\n"
@echo "release"
@echo "Uploads release to GitHub.\n"
Loading

0 comments on commit 6660152

Please sign in to comment.