libsbgnpy 0.6.5__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/CITATION.cff +1 -1
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/PKG-INFO +3 -2
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/api/index.md +3 -1
- libsbgnpy-0.7.0/docs/api/schematron.md +3 -0
- libsbgnpy-0.7.0/docs/api/specification.md +3 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/index.md +12 -9
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/maps.md +8 -5
- libsbgnpy-0.7.0/docs/specifications.md +171 -0
- libsbgnpy-0.7.0/docs/validation.md +175 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/README.md +1 -1
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/clone_marker.py +2 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/ethanol.py +2 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/extension.py +6 -1
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/labels.py +2 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/notes.py +6 -1
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/render.py +6 -1
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/validate.py +13 -7
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/write.py +12 -2
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/pyproject.toml +2 -1
- libsbgnpy-0.7.0/release-notes/0.7.0.md +28 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/scripts/generate_bindings.py +1 -1
- libsbgnpy-0.7.0/scripts/specification_docs.py +165 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/src/libsbgnpy/__init__.py +20 -2
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/src/libsbgnpy/io.py +26 -14
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/src/libsbgnpy/sbgn.py +7 -1
- libsbgnpy-0.7.0/src/libsbgnpy/schema/LICENSE-libsbgn.txt +27 -0
- libsbgnpy-0.7.0/src/libsbgnpy/schema/README.md +59 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/src/libsbgnpy/schema/SBGN.xsd +7 -0
- libsbgnpy-0.7.0/src/libsbgnpy/schema/sbgn_af.sch +275 -0
- libsbgnpy-0.7.0/src/libsbgnpy/schema/sbgn_er.sch +289 -0
- libsbgnpy-0.7.0/src/libsbgnpy/schema/sbgn_pd.sch +635 -0
- libsbgnpy-0.7.0/src/libsbgnpy/schematron.py +195 -0
- libsbgnpy-0.7.0/src/libsbgnpy/specification.py +494 -0
- libsbgnpy-0.7.0/src/libsbgnpy/validator.py +90 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10101-fail.sbgn +34 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10101-pass.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10102-fail-1.sbgn +17 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10102-fail-2.sbgn +17 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10102-fail-3.sbgn +17 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10102-fail-4.sbgn +17 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10102-pass.sbgn +17 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10103-fail.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10103-pass.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10104-fail.sbgn +34 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10104-pass.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10109-fail.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10109-pass.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10110-fail.sbgn +34 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10111-fail.sbgn +42 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10111-pass.sbgn +26 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10112-fail.sbgn +25 -0
- libsbgnpy-0.7.0/tests/data/schematron/AF/af10113-fail.sbgn +17 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10103-fail.sbgn +29 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10103-pass.sbgn +25 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10104-fail.sbgn +31 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10104-pass.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10106-fail-1.sbgn +26 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10106-fail-2.sbgn +26 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10106-fail-3.sbgn +26 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10106-fail-4.sbgn +26 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10106-fail-5.sbgn +26 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10106-fail-6.sbgn +26 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10106-pass.sbgn +26 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10107-fail-1.sbgn +25 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10107-fail-2.sbgn +25 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10107-fail-3.sbgn +25 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10107-fail-4.sbgn +25 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10107-fail-5.sbgn +25 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10107-fail-6.sbgn +25 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10107-pass.sbgn +26 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10108-fail-1.sbgn +43 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10108-fail-2.sbgn +43 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10108-pass.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10109-fail.sbgn +40 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10109-pass.sbgn +40 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10111-fail.sbgn +53 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er10111-pass.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er20001-fail.sbgn +55 -0
- libsbgnpy-0.7.0/tests/data/schematron/ER/er20001-pass.sbgn +57 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10101-fail.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10101-pass.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10102-fail.sbgn +55 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10102-pass.sbgn +55 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10103-fail.sbgn +37 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10103-pass.sbgn +45 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10104-fail.sbgn +55 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10104-pass.sbgn +47 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10105-fail.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10105-pass.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10106-fail.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10106-pass.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10107-fail.sbgn +37 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10107-pass.sbgn +45 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10108-fail.sbgn +42 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10108-pass.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10109-fail-1.sbgn +51 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10109-fail-2.sbgn +51 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10109-fail-3.sbgn +51 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10109-fail-4.sbgn +51 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10109-fail-5.sbgn +51 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10109-pass.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10110-fail-1.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10110-fail-2.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10110-fail-3.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10110-fail-4.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10110-fail-5.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10110-pass.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10111-fail-2.sbgn +72 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10111-fail.sbgn +72 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10111-pass.sbgn +68 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10112-fail-1.sbgn +28 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10112-fail-2.sbgn +28 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10112-pass.sbgn +28 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10124-fail.sbgn +67 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10124-pass.sbgn +67 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10125-fail.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10126-fail.sbgn +53 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10126-pass.sbgn +45 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10127-fail.sbgn +21 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10127-pass.sbgn +17 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10128-fail.sbgn +21 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10128-pass.sbgn +17 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10131-fail.sbgn +9 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10131-pass.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10132-fail.sbgn +10 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10132-pass.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10140-fail.sbgn +31 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10140-pass.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10141-fail.sbgn +11 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10141-pass.sbgn +27 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10142-fail.sbgn +35 -0
- libsbgnpy-0.7.0/tests/data/schematron/PD/pd10142-pass.sbgn +53 -0
- libsbgnpy-0.7.0/tests/test_data.py +64 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/test_io.py +16 -6
- libsbgnpy-0.7.0/tests/test_schematron.py +250 -0
- libsbgnpy-0.7.0/tests/test_specification.py +228 -0
- libsbgnpy-0.7.0/tests/test_specification_docs.py +23 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/zensical.toml +6 -0
- libsbgnpy-0.6.5/docs/validation.md +0 -119
- libsbgnpy-0.6.5/src/libsbgnpy/schema/README.md +0 -34
- libsbgnpy-0.6.5/src/libsbgnpy/validator.py +0 -60
- libsbgnpy-0.6.5/tests/test_data.py +0 -39
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/.gitignore +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/.ruff.toml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/LICENSE +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/README.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/README.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/api/console.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/api/image.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/api/io.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/api/log.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/api/render.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/api/sbgn.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/api/validator.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/development.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/extensions.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/images/ethanol_example.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/images/favicon/favicon.ico +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/images/favicon/libsbgnpy-100x100.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/images/libsbgnpy.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/images/libsbgnpy_large.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/images/libsbgnpy_screenshot.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/images.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/installation.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/io.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/render.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/docs/robots.txt +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/read.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/sbgn/adh.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/sbgn/adh_0.3.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/sbgn/glycolysis.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/sbgn/invalid.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/examples/sbgn/neuronal_muscle_signalling_color.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.2.0.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.2.2.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.3.0.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.3.1.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.3.2.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.3.3.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.4.0.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.4.1.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.5.0.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.5.1.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.5.2.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.6.0.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.6.1.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.6.2.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.6.3.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.6.4.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/release-notes/0.6.5.md +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/scripts/llms_txt.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/src/libsbgnpy/console.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/src/libsbgnpy/image.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/src/libsbgnpy/log.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/src/libsbgnpy/py.typed +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/src/libsbgnpy/render.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/src/libsbgnpy/schema/render.xsd +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/AF_Reference_Card.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/AF_Reference_Card.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/activity-nodes.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/activity-nodes.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/activity-nodes.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/auxiliary-units.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/auxiliary-units.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/auxiliary-units.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/compartment.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/compartment.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/compartment.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/delay.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/delay.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/delay.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/modulation.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/modulation.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/modulation.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/submap.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/submap.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/submap.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/submap_expanded.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/submap_expanded.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/submap_expanded.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/submaps_all-in-one.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/two_edges_between_two_activities.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/two_edges_between_two_activities.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/AF/two_edges_between_two_activities.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ER_Reference_Card.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ER_Reference_Card.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/OR gate.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/OR gate.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/OR gate.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/absolute inhibition.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/absolute inhibition.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/absolute inhibition.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/absolute stimulation.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/absolute stimulation.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/binary-no-outcome.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/binary-no-outcome.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/binary-no-outcome.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/binary-with-perturbation-and-phenotype.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/binary-with-perturbation-and-phenotype.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/binary-with-perturbation-and-phenotype.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/cis.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/cis.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/cis.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/delay.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/delay.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/delay.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/existence_variable.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/existence_variable.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/existence_variable.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/implicit_xor.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/implicit_xor.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/implicit_xor.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/invisible node.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/invisible node.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/invisible node.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/location.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/location.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/location.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/outcome-dual.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/outcome-dual.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/outcome-dual.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/outcome-simplified.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/outcome-simplified.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/outcome-simplified.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/phosphorylation.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/phosphorylation.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/phosphorylation.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ternary-interaction.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ternary-interaction.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ternary-interaction.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ternary-with-cardinality.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ternary-with-cardinality.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ternary-with-cardinality.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ternary-with-perturbation-and-phenotype.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ternary-with-perturbation-and-phenotype.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/ternary-with-perturbation-and-phenotype.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/trans.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/trans.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/ER/trans.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/PD_Reference_Card.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/PD_Reference_Card.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/activated_stat1alpha_induction_of_the_irf1_gene.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/activated_stat1alpha_induction_of_the_irf1_gene.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/adh.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/adh.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/adh.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/and.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/and.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/and.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/annotation.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/annotation.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/bool-expr-pd.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/bool-expr-pd.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/clone-marker.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/clone-marker.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/clone-marker.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/compartmentOrder1.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/compartmentOrder1.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/compartmentOrder2.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/compartmentOrder2.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/compartments.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/compartments.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/compartments.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/edgerouting.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/edgerouting.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/edgerouting.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/glycolysis.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/glycolysis.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/insulin-like_growth_factor_signaling.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/insulin-like_growth_factor_signaling.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/labeledCloneMarker.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/labeledCloneMarker.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/mapk_cascade.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/mapk_cascade.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/mixed_arcs.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/multimer.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/multimer.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/multimer.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/multimer2.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/multimer2.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/multimer2.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/neuronal_muscle_signalling.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/neuronal_muscle_signalling.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/neuronal_muscle_signalling_color.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/neuronal_muscle_signalling_color.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/or-simple.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/or-simple.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/or-simple.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/protein_degradation.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/protein_degradation.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/protein_degradation.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/reversible-verticalpn.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/reversible-verticalpn.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/reversible-verticalpn.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/states.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/states.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/states.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/statesType2.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/statesType2.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/statesType3.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/stoichiometry.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/stoichiometry.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/stoichiometry.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/submap.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/submap.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/submap.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/submap_expanded.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/submap_expanded.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/submap_expanded.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/submaps_MAPKcascade.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/utf8_test_case_with_byte_order_mark.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/utf8_test_case_with_byte_order_mark.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/utf8_test_case_with_byte_order_mark.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/utf8_test_case_without_byte_order_mark.gml +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/utf8_test_case_without_byte_order_mark.png +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/data/PD/utf8_test_case_without_byte_order_mark.sbgn +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/test_bindings.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/test_examples.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/test_extension.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/test_image.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/test_libsbgn.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/test_notes.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tests/test_validator.py +0 -0
- {libsbgnpy-0.6.5 → libsbgnpy-0.7.0}/tox.ini +0 -0
|
@@ -8,7 +8,7 @@ authors:
|
|
|
8
8
|
given-names: "Matthias"
|
|
9
9
|
orcid: "https://orcid.org/0000-0003-1725-179X"
|
|
10
10
|
affiliation: "Humboldt-University Berlin, Faculty of Life Science, Institute for Biology, Biology, Berlin; University Lübeck; University Hospital Schleswig-Holstein, Campus Lübeck, First Department of Medicine, Germany"
|
|
11
|
-
version: "0.
|
|
11
|
+
version: "0.7.0"
|
|
12
12
|
date-released: "2026-09-23"
|
|
13
13
|
doi: "10.5281/zenodo.22918324"
|
|
14
14
|
identifiers:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: libsbgnpy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: libsbgnpy are python utilities for working with SBGN.
|
|
5
5
|
Project-URL: Homepage, https://matthiaskoenig.github.io/libsbgnpy
|
|
6
6
|
Project-URL: Documentation, https://matthiaskoenig.github.io/libsbgnpy
|
|
@@ -31,14 +31,15 @@ Requires-Dist: rich>=15.0.0
|
|
|
31
31
|
Requires-Dist: xsdata>=26.2
|
|
32
32
|
Provides-Extra: dev
|
|
33
33
|
Requires-Dist: bump-my-version>=1.5.1; extra == 'dev'
|
|
34
|
-
Requires-Dist: lxml-stubs>=0.5.1; extra == 'dev'
|
|
35
34
|
Requires-Dist: mkdocstrings-python>=2.0.8; extra == 'dev'
|
|
36
35
|
Requires-Dist: pre-commit>=4.6.2; extra == 'dev'
|
|
37
36
|
Requires-Dist: pytest-cov>=7.1.0; extra == 'dev'
|
|
38
37
|
Requires-Dist: pytest>=9.1.1; extra == 'dev'
|
|
39
38
|
Requires-Dist: ruff>=0.16.6; extra == 'dev'
|
|
39
|
+
Requires-Dist: tox-uv>=1.36.0; extra == 'dev'
|
|
40
40
|
Requires-Dist: tox>=4.61.2; extra == 'dev'
|
|
41
41
|
Requires-Dist: ty>=0.0.78; extra == 'dev'
|
|
42
|
+
Requires-Dist: types-lxml>=2026.2.16; extra == 'dev'
|
|
42
43
|
Requires-Dist: xsdata[cli]>=26.2; extra == 'dev'
|
|
43
44
|
Requires-Dist: zensical>=0.0.59; extra == 'dev'
|
|
44
45
|
Description-Content-Type: text/markdown
|
|
@@ -16,7 +16,9 @@ The python bindings of the SBGN-ML schemas, generated with [xsdata](https://gith
|
|
|
16
16
|
| module | description |
|
|
17
17
|
| --- | --- |
|
|
18
18
|
| [io](io.md) | reading and writing of SBGN documents |
|
|
19
|
-
| [
|
|
19
|
+
| [specification](specification.md) | versions and vocabularies of the SBGN specifications, the checks beyond the schema |
|
|
20
|
+
| [validator](validator.md) | validation against the schema and the SBGN specifications |
|
|
21
|
+
| [schematron](schematron.md) | validation against the schematron rules of the SBGN languages |
|
|
20
22
|
| [image](image.md) | rendering of a map as an image |
|
|
21
23
|
|
|
22
24
|
## Output of the package
|
|
@@ -13,16 +13,17 @@ A pathway drawn by hand is a picture: a human sees what it means, a machine sees
|
|
|
13
13
|
- **Entity Relationship (ER)** — which entity influences which other entity, without ordering the events,
|
|
14
14
|
- **Activity Flow (AF)** — the flow of activity between the entities, the level of a cartoon in a review.
|
|
15
15
|
|
|
16
|
-
**SBGN-ML** is the exchange format of such a map ([van Iersel et al. 2012](https://doi.org/10.1186/1471-2105-13-S6-S12)): an XML document which stores the glyphs, the arcs between them, and the coordinates they are drawn at, so a map travels between the tools that draw it. `libsbgnpy` reads, writes, validates and renders these documents from python.
|
|
16
|
+
**SBGN-ML** is the exchange format of such a map ([van Iersel et al. 2012](https://doi.org/10.1186/1471-2105-13-S6-S12)): an XML document which stores the glyphs, the arcs between them, and the coordinates they are drawn at, so a map travels between the tools that draw it. `libsbgnpy` reads, writes, validates and renders these documents from python, following SBGN-ML 0.3 ([Bergmann et al. 2020](https://doi.org/10.1515/jib-2020-0016)) and the latest language specifications, see [SBGN specifications](specifications.md).
|
|
17
17
|
|
|
18
18
|
## Features
|
|
19
19
|
|
|
20
|
-
- **[SBGN
|
|
21
|
-
- **[
|
|
22
|
-
- **[
|
|
23
|
-
- **[
|
|
24
|
-
- **[
|
|
25
|
-
- **[
|
|
20
|
+
- **[SBGN specifications](specifications.md)** - the versions of the language specifications, up to PD Level 1 Version 2.1, and the glyphs and arcs of every language.
|
|
21
|
+
- **[SBGN maps](maps.md)** - the complete SBGN-ML schema as python classes, generated with [xsdata](https://github.com/tefra/xsdata): maps, glyphs, arcs, ports and bounding boxes, with the classes of the three languages as enums.
|
|
22
|
+
- **[Reading and writing](io.md)** - read and write SBGN-ML documents from files or strings; SBGN-ML 0.1 and 0.2 documents are upconverted while reading.
|
|
23
|
+
- **[Notes and extensions](extensions.md)** - the arbitrary XML which SBGN elements carry, written and read back as XML.
|
|
24
|
+
- **[Render information](render.md)** - colors, gradients and styles of a map, stored as an extension.
|
|
25
|
+
- **[Validation](validation.md)** - validation of a document against the SBGN XSD schema, the rules of the SBGN specifications which the schema lacks and the schematron rules of the SBGN languages.
|
|
26
|
+
- **[Images](images.md)** - rendering of a map as a PNG through a web service.
|
|
26
27
|
|
|
27
28
|
## Quickstart
|
|
28
29
|
|
|
@@ -31,12 +32,12 @@ Read an SBGN document and walk over its content:
|
|
|
31
32
|
```python
|
|
32
33
|
from pathlib import Path
|
|
33
34
|
|
|
34
|
-
from libsbgnpy import read_sbgn_from_file
|
|
35
|
+
from libsbgnpy import map_language, read_sbgn_from_file
|
|
35
36
|
|
|
36
37
|
sbgn = read_sbgn_from_file(Path("examples/sbgn/adh.sbgn"))
|
|
37
38
|
map = sbgn.map[0]
|
|
38
39
|
|
|
39
|
-
print(map
|
|
40
|
+
print(map_language(map))
|
|
40
41
|
# MapLanguage.PROCESS_DESCRIPTION
|
|
41
42
|
|
|
42
43
|
for glyph in map.glyph:
|
|
@@ -50,6 +51,7 @@ Create a map from scratch, write it and render it:
|
|
|
50
51
|
from pathlib import Path
|
|
51
52
|
|
|
52
53
|
from libsbgnpy import (
|
|
54
|
+
LATEST,
|
|
53
55
|
Bbox,
|
|
54
56
|
Glyph,
|
|
55
57
|
GlyphClass,
|
|
@@ -63,6 +65,7 @@ from libsbgnpy import (
|
|
|
63
65
|
|
|
64
66
|
map = Map(
|
|
65
67
|
id="ethanol",
|
|
68
|
+
version=LATEST[MapLanguage.PROCESS_DESCRIPTION],
|
|
66
69
|
language=MapLanguage.PROCESS_DESCRIPTION,
|
|
67
70
|
bbox=Bbox(x=0, y=0, w=363, h=253),
|
|
68
71
|
)
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
# SBGN maps
|
|
2
2
|
|
|
3
|
-
The classes of `libsbgnpy.sbgn` are the python bindings of the SBGN-ML schema, generated with [xsdata](https://github.com/tefra/xsdata). They mirror the schema, so the [SBGN specifications](
|
|
3
|
+
The classes of `libsbgnpy.sbgn` are the python bindings of the SBGN-ML schema, generated with [xsdata](https://github.com/tefra/xsdata). They mirror the schema, so the [SBGN specifications](specifications.md) are the reference for what an element means; this page describes how the classes are used.
|
|
4
4
|
|
|
5
5
|
## The document
|
|
6
6
|
|
|
7
|
-
An SBGN-ML document is an `Sbgn` object holding one or more `Map` objects. A map declares
|
|
7
|
+
An SBGN-ML document is an `Sbgn` object holding one or more `Map` objects. A map declares the specification it follows, an optional bounding box, and holds the glyphs and arcs it is drawn from:
|
|
8
8
|
|
|
9
9
|
```python
|
|
10
|
-
from libsbgnpy import Bbox, Map, MapLanguage, Sbgn
|
|
10
|
+
from libsbgnpy import LATEST, Bbox, Map, MapLanguage, Sbgn
|
|
11
11
|
|
|
12
12
|
map = Map(
|
|
13
13
|
id="ethanol",
|
|
14
|
+
version=LATEST[MapLanguage.PROCESS_DESCRIPTION],
|
|
14
15
|
language=MapLanguage.PROCESS_DESCRIPTION,
|
|
15
16
|
bbox=Bbox(x=0, y=0, w=363, h=253),
|
|
16
17
|
)
|
|
17
18
|
sbgn = Sbgn(map=[map])
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
The language of the map decides which vocabulary of glyphs and arcs applies:
|
|
21
22
|
|
|
22
23
|
| language | what it describes |
|
|
23
24
|
| --- | --- |
|
|
@@ -25,6 +26,8 @@ sbgn = Sbgn(map=[map])
|
|
|
25
26
|
| `MapLanguage.ENTITY_RELATIONSHIP` | which entity influences which other entity |
|
|
26
27
|
| `MapLanguage.ACTIVITY_FLOW` | the flow of activity between the entities |
|
|
27
28
|
|
|
29
|
+
The `version` is the identifier of the specification, e.g., PD Level 1 Version 2.1, and names the language as well; `LATEST` holds the version of the latest specification of every language. SBGN-ML 0.3 deprecated the `language` in favour of the `version` and requires one of them; setting both keeps the map readable for tools which only know the `language`. `map_language` returns the language of a map from either attribute, see [SBGN specifications](specifications.md#the-version-of-a-map).
|
|
30
|
+
|
|
28
31
|
All classes are keyword only, i.e., `Map(id="ethanol")` works and `Map("ethanol")` does not. Every list attribute (`map`, `glyph`, `arc`, `port`) defaults to an empty list, so it can be extended after the object was created.
|
|
29
32
|
|
|
30
33
|
## Glyphs
|
|
@@ -44,7 +47,7 @@ map.glyph.append(
|
|
|
44
47
|
)
|
|
45
48
|
```
|
|
46
49
|
|
|
47
|
-
The class of a glyph is the shape it is drawn as, `GlyphClass` has all classes of the three languages, e.g., `SIMPLE_CHEMICAL`, `MACROMOLECULE`, `COMPLEX`, `PROCESS`, `COMPARTMENT`, `BIOLOGICAL_ACTIVITY` or `PHENOTYPE`. The attribute is called `class_value`, since `class` is a python keyword.
|
|
50
|
+
The class of a glyph is the shape it is drawn as, `GlyphClass` has all classes of the three languages, e.g., `SIMPLE_CHEMICAL`, `MACROMOLECULE`, `COMPLEX`, `PROCESS`, `COMPARTMENT`, `BIOLOGICAL_ACTIVITY` or `PHENOTYPE`. Only some of them belong to the language of a map, see [Glyphs and arcs of every language](specifications.md#glyphs-and-arcs-of-every-language). The attribute is called `class_value`, since `class` is a python keyword.
|
|
48
51
|
|
|
49
52
|
!!! note "Coordinates"
|
|
50
53
|
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# SBGN specifications
|
|
2
|
+
|
|
3
|
+
SBGN is defined by two kinds of specifications: the **language specifications** define what a glyph and an arc mean and how they may be combined, one for each of the three languages, and the **SBGN-ML specification** defines how a map is stored as XML. `libsbgnpy` implements SBGN-ML 0.3 and knows the versions and the vocabularies of the language specifications, see `libsbgnpy.specification`. The specifications are published on [sbgn.github.io/specifications](https://sbgn.github.io/specifications) and registered with [COMBINE](https://github.com/combine-org/combine-specifications).
|
|
4
|
+
|
|
5
|
+
## The languages
|
|
6
|
+
|
|
7
|
+
| language | specification | publication |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| Process Description (PD) | Level 1 Version 2.1 (2026) | Balci, Rougny et al. *Systems biology graphical notation: process description language level 1 version 2.1.* J Integr Bioinform (2026). [10.1515/jib-2025-0018](https://doi.org/10.1515/jib-2025-0018) |
|
|
10
|
+
| Entity Relationship (ER) | Level 1 Version 2.0 (2015) | Sorokin et al. *Systems Biology Graphical Notation: Entity Relationship language Level 1 Version 2.0.* J Integr Bioinform 12(2):264 (2015). [10.2390/biecoll-jib-2015-264](https://doi.org/10.2390/biecoll-jib-2015-264) |
|
|
11
|
+
| Activity Flow (AF) | Level 1 Version 1.2 (2015) | Mi et al. *Systems Biology Graphical Notation: Activity Flow language Level 1 Version 1.2.* J Integr Bioinform 12(2):265 (2015). [10.2390/biecoll-jib-2015-265](https://doi.org/10.2390/biecoll-jib-2015-265) |
|
|
12
|
+
| SBGN-ML | Version 0.3 (2020) | Bergmann et al. *Systems biology graphical notation markup language (SBGNML) version 0.3.* J Integr Bioinform 17(2-3):20200016 (2020). [10.1515/jib-2020-0016](https://doi.org/10.1515/jib-2020-0016) |
|
|
13
|
+
|
|
14
|
+
## The version of a map
|
|
15
|
+
|
|
16
|
+
A map states which specification it follows with its `version`, the identifier of the specification. SBGN-ML 0.3 deprecated the `language` of a map in favour of the `version`, and requires one of the two. The version names the language as well, so `map_language` takes the language from the version, and from the deprecated `language` if a map has no version:
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from libsbgnpy import LATEST, Map, MapLanguage, map_language
|
|
20
|
+
|
|
21
|
+
map = Map(
|
|
22
|
+
id="ethanol",
|
|
23
|
+
version=LATEST[MapLanguage.PROCESS_DESCRIPTION],
|
|
24
|
+
language=MapLanguage.PROCESS_DESCRIPTION,
|
|
25
|
+
)
|
|
26
|
+
print(map.version.value)
|
|
27
|
+
# http://identifiers.org/combine.specifications/sbgn.pd.level-1.version-2.1
|
|
28
|
+
print(map_language(map))
|
|
29
|
+
# MapLanguage.PROCESS_DESCRIPTION
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`LATEST` holds the version of the latest specification of every language, set in bold below. Set the `language` as well if a map is read by tools which only know SBGN-ML 0.2. `SPECIFICATIONS` maps every `MapVersion` to its `Specification`, i.e., its language, level, version, year and DOI. The `version` of a map is `http://identifiers.org/combine.specifications/` followed by the identifier of the specification:
|
|
33
|
+
|
|
34
|
+
<!-- specification:versions -->
|
|
35
|
+
| specification | year | publication | identifier |
|
|
36
|
+
| --- | --- | --- | --- |
|
|
37
|
+
| **PD L1V2.1** | 2026 | [10.1515/jib-2025-0018](https://doi.org/10.1515/jib-2025-0018) | `sbgn.pd.level-1.version-2.1` |
|
|
38
|
+
| PD L1V2.0 | 2019 | [10.1515/jib-2019-0022](https://doi.org/10.1515/jib-2019-0022) | `sbgn.pd.level-1.version-2.0` |
|
|
39
|
+
| PD L1V1.3 | 2015 | [10.2390/biecoll-jib-2015-263](https://doi.org/10.2390/biecoll-jib-2015-263) | `sbgn.pd.level-1.version-1.3` |
|
|
40
|
+
| PD L1V1.2 | 2010 | | `sbgn.pd.level-1.version-1.2` |
|
|
41
|
+
| PD L1V1.1 | 2009 | | `sbgn.pd.level-1.version-1.1` |
|
|
42
|
+
| PD L1V1.0 | 2008 | | `sbgn.pd.level-1.version-1.0` |
|
|
43
|
+
| PD L1V1 | | | `sbgn.pd.level-1.version-1` |
|
|
44
|
+
| **ER L1V2.0** | 2015 | [10.2390/biecoll-jib-2015-264](https://doi.org/10.2390/biecoll-jib-2015-264) | `sbgn.er.level-1.version-2` |
|
|
45
|
+
| ER L1V1.2 | 2011 | | `sbgn.er.level-1.version-1.2` |
|
|
46
|
+
| ER L1V1.1 | 2010 | | `sbgn.er.level-1.version-1.1` |
|
|
47
|
+
| ER L1V1.0 | 2009 | | `sbgn.er.level-1.version-1.0` |
|
|
48
|
+
| ER L1V1 | | | `sbgn.er.level-1.version-1` |
|
|
49
|
+
| **AF L1V1.2** | 2015 | [10.2390/biecoll-jib-2015-265](https://doi.org/10.2390/biecoll-jib-2015-265) | `sbgn.af.level-1.version-1.2` |
|
|
50
|
+
| AF L1V1.0 | 2009 | | `sbgn.af.level-1.version-1.0` |
|
|
51
|
+
| AF L1V1 | | | `sbgn.af.level-1.version-1` |
|
|
52
|
+
<!-- /specification:versions -->
|
|
53
|
+
|
|
54
|
+
The version `version-1` of a language is the identifier of the latest version 1.x at the time it was registered. The published SBGN-ML schema, which `libsbgnpy` takes from [sbgn/libsbgn](https://github.com/sbgn/libsbgn), lacks PD L1V2.0 and L1V2.1; `libsbgnpy` adds both to its schema. PD L1V2.0 is listed by the SBGN-ML 0.3 specification, the identifier of PD L1V2.1 follows the naming of the registry but is not registered yet.
|
|
55
|
+
|
|
56
|
+
## What SBGN-ML 0.3 changed
|
|
57
|
+
|
|
58
|
+
SBGN-ML 0.3 is the format `libsbgnpy` reads and writes, documents in SBGN-ML 0.1 and 0.2 are upconverted while reading, see [Reading and writing](io.md#older-sbgn-ml-versions). Compared with 0.2:
|
|
59
|
+
|
|
60
|
+
- a document holds several maps, every map has an `id`,
|
|
61
|
+
- the `version` of a map replaces the deprecated `language`,
|
|
62
|
+
- submaps are supported completely with the `mapRef` and the `tagRef` of a glyph,
|
|
63
|
+
- the `perturbation` of AF is no longer an activity node, but a unit of information of a biological activity; the glyph class is deprecated in AF,
|
|
64
|
+
- colours and styles are stored as render information in the extension of a map, see [Render information](render.md).
|
|
65
|
+
|
|
66
|
+
## Glyphs of the latest PD specification in SBGN-ML
|
|
67
|
+
|
|
68
|
+
PD L1V2.0 and L1V2.1 renamed and added glyphs without changing SBGN-ML. They are encoded with the glyph classes which already exist:
|
|
69
|
+
|
|
70
|
+
| glyph of PD L1V2.x | SBGN-ML |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| empty set (replaces source and sink) | `source and sink` |
|
|
73
|
+
| submap terminal | `terminal` inside a `submap` |
|
|
74
|
+
| subunit of a complex | a glyph of an entity pool node class inside a `complex` |
|
|
75
|
+
| equivalence operator | `equivalence` |
|
|
76
|
+
| annotation | `annotation` |
|
|
77
|
+
| stoichiometry of a flux arc | `cardinality` inside the `arc` |
|
|
78
|
+
|
|
79
|
+
The shapes, e.g., the stadium of a simple chemical or of a state variable since PD L1V2.0, are a matter of the drawing and not stored in SBGN-ML.
|
|
80
|
+
|
|
81
|
+
## Glyphs and arcs of every language
|
|
82
|
+
|
|
83
|
+
The SBGN-ML schema has a single enumeration of glyph classes and of arc classes for all languages, it does not know which class belongs to which language. `GLYPH_CLASSES` and `ARC_CLASSES` hold the classes of the latest specification of every language, auxiliary units such as state variables included. Deprecated classes are still allowed, but logged as a warning.
|
|
84
|
+
|
|
85
|
+
<!-- specification:glyphs -->
|
|
86
|
+
| class | PD | ER | AF |
|
|
87
|
+
| --- | :---: | :---: | :---: |
|
|
88
|
+
| `unspecified entity` | ✓ | | |
|
|
89
|
+
| `simple chemical` | ✓ | | |
|
|
90
|
+
| `macromolecule` | ✓ | | |
|
|
91
|
+
| `nucleic acid feature` | ✓ | | |
|
|
92
|
+
| `simple chemical multimer` | ✓ | | |
|
|
93
|
+
| `macromolecule multimer` | ✓ | | |
|
|
94
|
+
| `nucleic acid feature multimer` | ✓ | | |
|
|
95
|
+
| `complex` | ✓ | | |
|
|
96
|
+
| `complex multimer` | ✓ | | |
|
|
97
|
+
| `source and sink` | ✓ | | |
|
|
98
|
+
| `perturbation` | | | deprecated |
|
|
99
|
+
| `biological activity` | | | ✓ |
|
|
100
|
+
| `perturbing agent` | ✓ | ✓ | |
|
|
101
|
+
| `compartment` | ✓ | | ✓ |
|
|
102
|
+
| `submap` | ✓ | | ✓ |
|
|
103
|
+
| `tag` | ✓ | | ✓ |
|
|
104
|
+
| `terminal` | ✓ | | ✓ |
|
|
105
|
+
| `process` | ✓ | | |
|
|
106
|
+
| `omitted process` | ✓ | | |
|
|
107
|
+
| `uncertain process` | ✓ | | |
|
|
108
|
+
| `association` | ✓ | | |
|
|
109
|
+
| `dissociation` | ✓ | | |
|
|
110
|
+
| `phenotype` | ✓ | ✓ | ✓ |
|
|
111
|
+
| `and` | ✓ | ✓ | ✓ |
|
|
112
|
+
| `or` | ✓ | ✓ | ✓ |
|
|
113
|
+
| `not` | ✓ | ✓ | ✓ |
|
|
114
|
+
| `equivalence` | ✓ | | |
|
|
115
|
+
| `state variable` | ✓ | ✓ | |
|
|
116
|
+
| `unit of information` | ✓ | ✓ | ✓ |
|
|
117
|
+
| `entity` | | ✓ | |
|
|
118
|
+
| `outcome` | | ✓ | |
|
|
119
|
+
| `interaction` | | ✓ | |
|
|
120
|
+
| `influence target` | | ✓ | |
|
|
121
|
+
| `annotation` | ✓ | ✓ | ✓ |
|
|
122
|
+
| `variable value` | | ✓ | |
|
|
123
|
+
| `implicit xor` | | ✓ | |
|
|
124
|
+
| `delay` | | ✓ | ✓ |
|
|
125
|
+
| `existence` | | ✓ | |
|
|
126
|
+
| `location` | | ✓ | |
|
|
127
|
+
| `cardinality` | ✓ | ✓ | |
|
|
128
|
+
| `observable` | deprecated | deprecated | deprecated |
|
|
129
|
+
<!-- /specification:glyphs -->
|
|
130
|
+
|
|
131
|
+
<!-- specification:arcs -->
|
|
132
|
+
| class | PD | ER | AF |
|
|
133
|
+
| --- | :---: | :---: | :---: |
|
|
134
|
+
| `production` | ✓ | | |
|
|
135
|
+
| `consumption` | ✓ | | |
|
|
136
|
+
| `catalysis` | ✓ | | |
|
|
137
|
+
| `modulation` | ✓ | ✓ | |
|
|
138
|
+
| `stimulation` | ✓ | ✓ | |
|
|
139
|
+
| `inhibition` | ✓ | ✓ | |
|
|
140
|
+
| `assignment` | | ✓ | |
|
|
141
|
+
| `interaction` | | ✓ | |
|
|
142
|
+
| `absolute inhibition` | | ✓ | |
|
|
143
|
+
| `absolute stimulation` | | ✓ | |
|
|
144
|
+
| `positive influence` | | | ✓ |
|
|
145
|
+
| `negative influence` | | | ✓ |
|
|
146
|
+
| `unknown influence` | | | ✓ |
|
|
147
|
+
| `equivalence arc` | ✓ | | ✓ |
|
|
148
|
+
| `necessary stimulation` | ✓ | ✓ | ✓ |
|
|
149
|
+
| `logic arc` | ✓ | ✓ | ✓ |
|
|
150
|
+
<!-- /specification:arcs -->
|
|
151
|
+
|
|
152
|
+
## Checking a map
|
|
153
|
+
|
|
154
|
+
`check_map` and `check_sbgn` check what the specifications require on top of the schema: a map declares its language with a `version` or a `language`, the two agree, and every glyph and every arc has a class of the language of the map. `validate` combines these checks with the validation against the schema, see [Validation](validation.md):
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
from libsbgnpy import Bbox, Glyph, GlyphClass, Map, MapLanguage, check_map
|
|
158
|
+
|
|
159
|
+
map = Map(id="m", language=MapLanguage.PROCESS_DESCRIPTION)
|
|
160
|
+
map.glyph.append(
|
|
161
|
+
Glyph(
|
|
162
|
+
id="g1",
|
|
163
|
+
class_value=GlyphClass.BIOLOGICAL_ACTIVITY,
|
|
164
|
+
bbox=Bbox(x=0, y=0, w=120, h=60),
|
|
165
|
+
)
|
|
166
|
+
)
|
|
167
|
+
print(check_map(map))
|
|
168
|
+
# ["map 'm': glyph 'g1' has the class 'biological activity', which is no glyph class of process description"]
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The validation rules of the language specifications, e.g., that a consumption arc connects an entity pool node with a process, are checked by `validate_schematron`, see [Schematron rules](validation.md#schematron-rules).
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Validation
|
|
2
|
+
|
|
3
|
+
Reading a document parses it, it does not check that it follows SBGN-ML. Three functions perform that check:
|
|
4
|
+
|
|
5
|
+
- `validate_xsd` validates against the packaged schema, `libsbgnpy/schema/SBGN.xsd`, i.e., the structure of the document,
|
|
6
|
+
- `validate` adds the rules of the SBGN specifications which the schema cannot express, see [What the specifications add](#what-the-specifications-add),
|
|
7
|
+
- `validate_schematron` checks the validation rules of the SBGN languages, e.g., that a consumption arc starts at an entity pool node, see [Schematron rules](#schematron-rules).
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
from libsbgnpy import validate
|
|
13
|
+
|
|
14
|
+
errors = validate(Path("map.sbgn"))
|
|
15
|
+
if errors:
|
|
16
|
+
for error in errors:
|
|
17
|
+
print(error)
|
|
18
|
+
else:
|
|
19
|
+
print("valid")
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`validate_xsd` and `validate` return the errors as a list of strings, which is empty for a valid document, so a check is `if validate(f):`. Nothing is written to stdout or stderr; a summary is logged at info level, see [Logging](installation.md#logging).
|
|
23
|
+
|
|
24
|
+
An error names the line, the element and what is wrong with it:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
<string>:3:0:ERROR:SCHEMASV:SCHEMAV_CVC_COMPLEX_TYPE_4:
|
|
28
|
+
Element '{http://sbgn.org/libsbgn/0.3}map': The attribute 'id' is required but missing.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
A file which is no well formed XML is reported as a single error rather than raising, so a corrupt file and an invalid one are handled the same way.
|
|
32
|
+
|
|
33
|
+
## An invalid document
|
|
34
|
+
|
|
35
|
+
[`examples/sbgn/invalid.sbgn`](https://github.com/matthiaskoenig/libsbgnpy/blob/develop/examples/sbgn/invalid.sbgn) breaks the schema in three ways, one per kind of error the validation reports:
|
|
36
|
+
|
|
37
|
+
```xml
|
|
38
|
+
<sbgn xmlns="http://sbgn.org/libsbgn/0.3">
|
|
39
|
+
<map language="process description"> <!-- no id -->
|
|
40
|
+
<bbox x="0" y="0" w="363" h="253"/>
|
|
41
|
+
<glyph class="simple chemcial" id="glyph_ethanol"> <!-- typo -->
|
|
42
|
+
<label text="Ethanol"/>
|
|
43
|
+
<bbox x="40" y="120" w="60" h="60"/>
|
|
44
|
+
</glyph>
|
|
45
|
+
...
|
|
46
|
+
<arc class="consumption" source="glyph_ethanol" target="pn1.1" id="a01">
|
|
47
|
+
<start x="98" y="160"/> <!-- no end -->
|
|
48
|
+
</arc>
|
|
49
|
+
</map>
|
|
50
|
+
</sbgn>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`validate_xsd` returns the three errors:
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from pathlib import Path
|
|
57
|
+
|
|
58
|
+
from libsbgnpy import validate_xsd
|
|
59
|
+
|
|
60
|
+
for error in validate_xsd(Path("examples/sbgn/invalid.sbgn")):
|
|
61
|
+
print(error)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- a required attribute is missing, the `id` of the map:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
SCHEMAV_CVC_COMPLEX_TYPE_4: Element '{http://sbgn.org/libsbgn/0.3}map':
|
|
68
|
+
The attribute 'id' is required but missing.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- an attribute carries a value which is not in the enumeration, `simple chemcial` is not an SBGN glyph class. The error lists every class the schema allows, which is the fastest way to find the correct spelling:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
SCHEMAV_CVC_ENUMERATION_VALID: Element '{http://sbgn.org/libsbgn/0.3}glyph',
|
|
75
|
+
attribute 'class': [facet 'enumeration'] The value 'simple chemcial' is not
|
|
76
|
+
an element of the set {'unspecified entity', 'simple chemical', ...}.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
- a required child element is missing, an arc needs an `end` point:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
SCHEMAV_ELEMENT_CONTENT: Element '{http://sbgn.org/libsbgn/0.3}arc':
|
|
83
|
+
Missing child element(s). Expected is one of
|
|
84
|
+
( {http://sbgn.org/libsbgn/0.3}next, {http://sbgn.org/libsbgn/0.3}end ).
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The line number in front of every error, e.g. `<string>:13:0:`, is the line of the *upconverted* document, which is what the validation sees, see [Which schema is used](#which-schema-is-used). For a 0.3 document it is the line of the file; for a 0.1 or 0.2 document only the namespace of the root element changes, so the lines still match.
|
|
88
|
+
|
|
89
|
+
!!! note
|
|
90
|
+
|
|
91
|
+
A document which does not validate can often still be read. `read_sbgn_from_file` parses without validating, so an invalid class ends up in the bindings as the string it is written as, and a warning is logged. Only a document which lacks a required element or attribute, like the missing `end` of the arc above, cannot be read, it raises a `ParserError`. Validate first if a document comes from somewhere else.
|
|
92
|
+
|
|
93
|
+
## Which schema is used
|
|
94
|
+
|
|
95
|
+
The packaged schema is the SBGN-ML 0.3 schema. Documents in the earlier namespaces are upconverted before they are validated, exactly as they are when they are read, see [Older SBGN-ML versions](io.md#older-sbgn-ml-versions). A 0.1 or 0.2 document is therefore validated against the 0.3 schema, which is what `libsbgnpy` reads it as. The schema is the one of [sbgn/libsbgn](https://github.com/sbgn/libsbgn) with the versions PD L1V2.0 and L1V2.1 added, which the published schema lacks, see [The version of a map](specifications.md#the-version-of-a-map).
|
|
96
|
+
|
|
97
|
+
## What the specifications add
|
|
98
|
+
|
|
99
|
+
The schema has a single enumeration of glyph classes and of arc classes for all languages, and it cannot require one of two attributes. `validate` therefore checks, after the schema, the rules of the specifications which the schema lacks, see [SBGN specifications](specifications.md#checking-a-map):
|
|
100
|
+
|
|
101
|
+
- a map declares its language with a `version` or a `language`, SBGN-ML 0.3 requires one of them,
|
|
102
|
+
- the `version` and the `language` of a map name the same language,
|
|
103
|
+
- every glyph and every arc has a class of the language of the map, e.g., a `biological activity` is no glyph of a process description.
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
map 'm': glyph 'g1' has the class 'biological activity', which is no glyph class of process description
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
A deprecated class, e.g., the `perturbation` activity node of an activity flow map, is no error, it is logged as a warning. The checks are also available on a document which was read or created in python, as `check_sbgn` and `check_map`. A document which cannot be read is only validated against the schema.
|
|
110
|
+
|
|
111
|
+
## Schematron rules
|
|
112
|
+
|
|
113
|
+
The specifications of the SBGN languages define validation rules beyond the vocabulary of a map, e.g., that a consumption arc starts at an entity pool node and ends at a process, or that a process has at least one input and one output. The Java library [libSBGN](https://github.com/sbgn/libsbgn) implements them as Schematron rules, one set per map language, and `libsbgnpy` packages these rules: `validate_schematron` checks a document against them with the results of the Java library.
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from pathlib import Path
|
|
117
|
+
|
|
118
|
+
from libsbgnpy import validate_schematron
|
|
119
|
+
|
|
120
|
+
for issue in validate_schematron(Path("examples/sbgn/invalid.sbgn")):
|
|
121
|
+
print(issue.rule_id, issue.element_id)
|
|
122
|
+
print(f" {issue.message}")
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Every broken rule is reported as an `Issue`:
|
|
126
|
+
|
|
127
|
+
| attribute | meaning |
|
|
128
|
+
| --- | --- |
|
|
129
|
+
| `severity` | the role of the rule, `error` for all rules which are checked |
|
|
130
|
+
| `rule_id` | the rule, the language followed by its number, e.g., `pd10101` |
|
|
131
|
+
| `message` | what the rule requires |
|
|
132
|
+
| `element_id` | the id of the glyph or arc which breaks the rule, `None` if the rule does not name it |
|
|
133
|
+
|
|
134
|
+
The typo `simple chemcial` of [`invalid.sbgn`](#an-invalid-document) makes the source of the consumption arc no entity pool node, and the process loses its input:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
pd10101 a01
|
|
138
|
+
Arc with class consumption must have source reference to glyph of EPN classes
|
|
139
|
+
pd10141 pn1
|
|
140
|
+
All process nodes should have at least one input and at least one ouput pointing to the arcs
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The document is read like `validate_xsd` reads it, a 0.1 or 0.2 document is upconverted first. Every map is checked on its own with the rules of its language, which is taken from its `version` or else its `language`; a map of an unknown language is not checked, which `validate` reports. The rules do not check the structure of the document, so validate it against the schema as well, and a file which is no well-formed XML raises an `lxml.etree.XMLSyntaxError`.
|
|
144
|
+
|
|
145
|
+
!!! note
|
|
146
|
+
|
|
147
|
+
The rules were written for the earlier specifications, e.g., PD L1V1.3, and some of the reference maps of the current specifications break them. Rule `pd10131`, for example, requires every entity pool node to be connected to an arc, which the maps showing glyphs on their own break. The issues are therefore kept apart from the errors of `validate`; review them rather than rejecting a document because of them, see [issue #103](https://github.com/matthiaskoenig/libsbgnpy/issues/103). The rules are the ones of libSBGN with three XPath 2.0 expressions rewritten for the XSLT 1.0 processor of lxml, see [`libsbgnpy/schema/README.md`](https://github.com/matthiaskoenig/libsbgnpy/blob/develop/src/libsbgnpy/schema/README.md).
|
|
148
|
+
|
|
149
|
+
## Examples
|
|
150
|
+
|
|
151
|
+
| example | what it shows |
|
|
152
|
+
| --- | --- |
|
|
153
|
+
| [`validate.py`](https://github.com/matthiaskoenig/libsbgnpy/blob/develop/examples/validate.py) | validate the documents in `examples/sbgn/` and report the errors and the broken rules |
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
python examples/validate.py
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
valid: adh.sbgn
|
|
161
|
+
valid: adh_0.3.sbgn
|
|
162
|
+
valid: glycolysis.sbgn
|
|
163
|
+
invalid: invalid.sbgn
|
|
164
|
+
<string>:11:0:ERROR:SCHEMASV:SCHEMAV_CVC_COMPLEX_TYPE_4: ...
|
|
165
|
+
<string>:13:0:ERROR:SCHEMASV:SCHEMAV_CVC_ENUMERATION_VALID: ...
|
|
166
|
+
<string>:22:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: ...
|
|
167
|
+
pd10101 'a01'
|
|
168
|
+
Arc with class consumption must have source reference to glyph of EPN classes
|
|
169
|
+
pd10141 'pn1'
|
|
170
|
+
All process nodes should have at least one input and at least one ouput pointing to the arcs
|
|
171
|
+
valid: neuronal_muscle_signalling_color.sbgn
|
|
172
|
+
|
|
173
|
+
4/5 documents are valid
|
|
174
|
+
invalid: invalid.sbgn
|
|
175
|
+
```
|
|
@@ -15,7 +15,7 @@ python examples/read.py
|
|
|
15
15
|
| [`notes.py`](notes.py) | write and read notes |
|
|
16
16
|
| [`extension.py`](extension.py) | write and read extensions |
|
|
17
17
|
| [`render.py`](render.py) | write and read render information |
|
|
18
|
-
| [`validate.py`](validate.py) | validate against the SBGN schema |
|
|
18
|
+
| [`validate.py`](validate.py) | validate against the SBGN schema, the specifications and the schematron rules |
|
|
19
19
|
| [`ethanol.py`](ethanol.py) | build a map step by step and render it as an image |
|
|
20
20
|
|
|
21
21
|
`ethanol.py` renders images with a web service and therefore needs an internet connection, all other examples run offline.
|
|
@@ -11,6 +11,7 @@ python examples/clone_marker.py
|
|
|
11
11
|
from pathlib import Path
|
|
12
12
|
|
|
13
13
|
from libsbgnpy import (
|
|
14
|
+
LATEST,
|
|
14
15
|
Arc,
|
|
15
16
|
ArcClass,
|
|
16
17
|
Bbox,
|
|
@@ -41,6 +42,7 @@ def clone_marker(f: Path) -> Sbgn:
|
|
|
41
42
|
"""
|
|
42
43
|
map = Map(
|
|
43
44
|
id="clone_marker",
|
|
45
|
+
version=LATEST[MapLanguage.PROCESS_DESCRIPTION],
|
|
44
46
|
language=MapLanguage.PROCESS_DESCRIPTION,
|
|
45
47
|
bbox=Bbox(x=0, y=0, w=363, h=253),
|
|
46
48
|
)
|
|
@@ -15,6 +15,7 @@ python examples/ethanol.py
|
|
|
15
15
|
from pathlib import Path
|
|
16
16
|
|
|
17
17
|
from libsbgnpy import (
|
|
18
|
+
LATEST,
|
|
18
19
|
Arc,
|
|
19
20
|
ArcClass,
|
|
20
21
|
Bbox,
|
|
@@ -55,6 +56,7 @@ def ethanol(prefix: str) -> Sbgn:
|
|
|
55
56
|
"""
|
|
56
57
|
map = Map(
|
|
57
58
|
id="ethanol",
|
|
59
|
+
version=LATEST[MapLanguage.PROCESS_DESCRIPTION],
|
|
58
60
|
language=MapLanguage.PROCESS_DESCRIPTION,
|
|
59
61
|
bbox=Bbox(x=0, y=0, w=363, h=253),
|
|
60
62
|
)
|
|
@@ -12,6 +12,7 @@ python examples/extension.py
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
|
|
14
14
|
from libsbgnpy import (
|
|
15
|
+
LATEST,
|
|
15
16
|
Map,
|
|
16
17
|
MapLanguage,
|
|
17
18
|
Sbgn,
|
|
@@ -45,7 +46,11 @@ def write_extension(f: Path) -> Sbgn:
|
|
|
45
46
|
Returns:
|
|
46
47
|
The SBGN document.
|
|
47
48
|
"""
|
|
48
|
-
map = Map(
|
|
49
|
+
map = Map(
|
|
50
|
+
id="extension",
|
|
51
|
+
version=LATEST[MapLanguage.PROCESS_DESCRIPTION],
|
|
52
|
+
language=MapLanguage.PROCESS_DESCRIPTION,
|
|
53
|
+
)
|
|
49
54
|
sbgn = Sbgn(map=[map])
|
|
50
55
|
map.extension = Sbgnbase.Extension(any_element=[ANNOTATION])
|
|
51
56
|
|
|
@@ -10,6 +10,7 @@ python examples/labels.py
|
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
12
|
from libsbgnpy import (
|
|
13
|
+
LATEST,
|
|
13
14
|
Arc,
|
|
14
15
|
ArcClass,
|
|
15
16
|
Bbox,
|
|
@@ -33,6 +34,7 @@ def labels() -> str:
|
|
|
33
34
|
"""
|
|
34
35
|
map = Map(
|
|
35
36
|
id="labels",
|
|
37
|
+
version=LATEST[MapLanguage.PROCESS_DESCRIPTION],
|
|
36
38
|
language=MapLanguage.PROCESS_DESCRIPTION,
|
|
37
39
|
bbox=Bbox(x=0, y=0, w=600, h=200),
|
|
38
40
|
)
|
|
@@ -11,6 +11,7 @@ python examples/notes.py
|
|
|
11
11
|
from pathlib import Path
|
|
12
12
|
|
|
13
13
|
from libsbgnpy import (
|
|
14
|
+
LATEST,
|
|
14
15
|
Bbox,
|
|
15
16
|
Glyph,
|
|
16
17
|
GlyphClass,
|
|
@@ -35,7 +36,11 @@ def write_notes(f: Path) -> Sbgn:
|
|
|
35
36
|
Returns:
|
|
36
37
|
The SBGN document.
|
|
37
38
|
"""
|
|
38
|
-
map = Map(
|
|
39
|
+
map = Map(
|
|
40
|
+
id="notes",
|
|
41
|
+
version=LATEST[MapLanguage.PROCESS_DESCRIPTION],
|
|
42
|
+
language=MapLanguage.PROCESS_DESCRIPTION,
|
|
43
|
+
)
|
|
39
44
|
sbgn = Sbgn(map=[map])
|
|
40
45
|
|
|
41
46
|
glyph = Glyph(
|
|
@@ -12,6 +12,7 @@ python examples/render.py
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
|
|
14
14
|
from libsbgnpy import (
|
|
15
|
+
LATEST,
|
|
15
16
|
Bbox,
|
|
16
17
|
ColorDefinition,
|
|
17
18
|
G,
|
|
@@ -45,7 +46,11 @@ def write_render(f: Path) -> Sbgn:
|
|
|
45
46
|
Returns:
|
|
46
47
|
The SBGN document.
|
|
47
48
|
"""
|
|
48
|
-
map = Map(
|
|
49
|
+
map = Map(
|
|
50
|
+
id="render",
|
|
51
|
+
version=LATEST[MapLanguage.PROCESS_DESCRIPTION],
|
|
52
|
+
language=MapLanguage.PROCESS_DESCRIPTION,
|
|
53
|
+
)
|
|
49
54
|
sbgn = Sbgn(map=[map])
|
|
50
55
|
|
|
51
56
|
map.glyph = [
|