Skip to content

validator

Validation of SBGN documents against the SBGN XSD schema.

The packaged schema is the SBGN-ML 0.3 schema in libsbgnpy/schema/SBGN.xsd, documents in the earlier namespaces are upconverted before they are validated, i.e., the same documents are read and validated.

from pathlib import Path

from libsbgnpy import validate_xsd

errors = validate_xsd(Path("map.sbgn"))
if errors:
    for error in errors:
        print(error)

validate_xsd

validate_xsd(f)

Validate an SBGN file against the SBGN XSD schema.

Parameters:

Name Type Description Default
f Path

path of the SBGN file

required

Returns:

Type Description
list[str]

The validation errors, empty if the document is valid.

Raises:

Type Description
OSError

if the file cannot be read