Skip to content

Commit

Permalink
Temp: ordo mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
joeflack4 committed Mar 27, 2024
1 parent f1e37f4 commit d5b088e
Show file tree
Hide file tree
Showing 9 changed files with 34,961 additions and 178 deletions.
267 changes: 135 additions & 132 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,132 +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/
# 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/
19 changes: 19 additions & 0 deletions config/icd11.sssom-metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
creator_id: 0000-0002-2906-7319
curie_map:
GTR: http://purl.obolibrary.org/obo/mondo/mappings/unknown_prefix/GTR/
HP: http://purl.obolibrary.org/obo/HP_
MESH: http://identifiers.org/mesh/
MONDO: http://purl.obolibrary.org/obo/MONDO_
NCIT: http://purl.obolibrary.org/obo/NCIT_
OMIM: https://omim.org/entry/
Orphanet: http://www.orpha.net/ORDO/Orphanet_
SCTID: http://identifiers.org/snomedct/
UMLS: http://purl.obolibrary.org/obo/UMLS_
oboInOwl: http://www.geneontology.org/formats/oboInOwl#
owl: http://www.w3.org/2002/07/owl#
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs: http://www.w3.org/2000/01/rdf-schema#
semapv: https://w3id.org/semapv/
skos: http://www.w3.org/2004/02/skos/core#
sssom: https://w3id.org/sssom/
license: http://w3id.org/sssom/license/unspecified
103 changes: 57 additions & 46 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,46 +1,57 @@
.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 $< > $@

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/*

# 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/*

# 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"
Loading

0 comments on commit d5b088e

Please sign in to comment.