Release notes for libsbgnpy 0.7.0
This release follows the latest SBGN specifications (PD L1V2.1, ER L1V2.0, AF L1V1.2) and validates documents against the rules of the specifications: the rules the schema cannot express, and the schematron rules of the SBGN languages, as the Java library libSBGN does.
Added
- Schematron validation (#101):
validate_schematronchecks a document against the schematron rules of libSBGN, e.g., that a consumption arc starts at an entity pool node, and returns every broken rule as anIssuewith its severity, rule id, message and the id of the offending glyph or arc. Every map is checked on its own with the rules of its language; 0.1 and 0.2 documents are upconverted first. The results are the ones of the Java library: the rules are packaged with three XPath 2.0 expressions rewritten for the XSLT 1.0 processor of lxml, seelibsbgnpy/schema/README.md. Some reference maps of the current specifications break the partly outdated rules, so the issues are kept apart fromvalidate(#103). libsbgnpy.specification(#100): the SBGN specifications as data,SPECIFICATIONS(language, level, version, year and DOI of every map version),LATEST, the glyph and arc classes of every language (GLYPH_CLASSES,ARC_CLASSES) and the deprecated glyph classes.map_languageandlanguage_oftake the language of a map from itsversion, falling back to the deprecatedlanguage.check_mapandcheck_sbgncheck what SBGN-ML 0.3 requires but the schema cannot express: a map declares aversionor alanguage, both name the same language, and every glyph and arc has a class of the language of the map. Deprecated classes are logged as warnings.validatevalidates against the schema and adds the errors ofcheck_sbgn;validate_xsdis unchanged.- The documentation has a page on the SBGN specifications, with the citations, the map versions and the glyph and arc classes of every language.
Fixed
- Maps of PD L1V2.0, which SBGN-ML 0.3 lists, and of the latest PD L1V2.1 are valid: the packaged schema allows both versions, which the schema of libSBGN lacks, and they are read as
MapVersionmembers instead of plain strings. - A description of a returned value spanning several lines is rendered as one entry in the API reference instead of several.
Changed
- Reading keeps a value outside of an enumeration, e.g., an unknown glyph class, as a string and logs the xsdata
ConverterWarninginstead of emitting it. - The examples set the
versionof the latest PD specification together with thelanguageof a map.
Development
tests/data/schematronholds the test files of the schematron rules of libSBGN; the issues of the reference maps are pinned intests/test_schematron.py, computed with Saxon, the XSLT processor of the Java library.- The tables of
docs/specifications.mdare generated fromlibsbgnpy.specificationbyscripts/specification_docs.py;tests/test_specification_docs.pyfails if they are outdated. - lxml is typed with
types-lxmlinstead of the unmaintainedlxml-stubs;tox-uvis part of the dev extra, souv run tox r -e tyworks. - Update urllib3 to 2.8.0.