From f61911404dcc2f8d5ca041e08af7ab8dfeea0e87 Mon Sep 17 00:00:00 2001 From: Bilal Shaikh Date: Wed, 13 Apr 2022 15:54:12 -0400 Subject: [PATCH] fix(cellml): tweak cellml 1.1 validation to allow RDF and numbered ids --- biosimulators_utils/model_lang/cellml/cellml_1_1.xsd | 5 ++++- .../model_lang/cellml/common/common-attribs.xsd | 2 +- biosimulators_utils/model_lang/cellml/validation.py | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/biosimulators_utils/model_lang/cellml/cellml_1_1.xsd b/biosimulators_utils/model_lang/cellml/cellml_1_1.xsd index 3ade21ef..b3f124e0 100644 --- a/biosimulators_utils/model_lang/cellml/cellml_1_1.xsd +++ b/biosimulators_utils/model_lang/cellml/cellml_1_1.xsd @@ -2,9 +2,11 @@ + @@ -109,7 +111,8 @@ - + + diff --git a/biosimulators_utils/model_lang/cellml/common/common-attribs.xsd b/biosimulators_utils/model_lang/cellml/common/common-attribs.xsd index 33698b8f..2a3011f6 100644 --- a/biosimulators_utils/model_lang/cellml/common/common-attribs.xsd +++ b/biosimulators_utils/model_lang/cellml/common/common-attribs.xsd @@ -26,7 +26,7 @@ - + diff --git a/biosimulators_utils/model_lang/cellml/validation.py b/biosimulators_utils/model_lang/cellml/validation.py index e1e96135..05f247c1 100644 --- a/biosimulators_utils/model_lang/cellml/validation.py +++ b/biosimulators_utils/model_lang/cellml/validation.py @@ -148,7 +148,11 @@ def validate_model_version_1_1(filename, doc, resolve_imports=True, config=None) # The original ``cellml_1_1.xsd`` was modified to change the http sources to local sources. # Additionally, the following two lines were removed from the ``cellml_1_1_original.xsd``: 113, 309 # These lines added the following to the definitions of "Component" and "Role": - # This caused lxml to fail to parse the schema due to it being nondeterministic. + # This caused lxml to fail to parse the schema due to it being nondeterministic. + # In its place, + # was added to allow using RDF syntax in the schema. The RDF is not validated. + # Finally, in common/common-attribs.xsd the type of the attribute "id" was changed from "ID" to "string". + # This was done to allow using numbers as ids for equations as described in the CellML primer. schema_filename = pkg_resources.resource_filename('biosimulators_utils', os.path.join("model_lang", "cellml", "cellml_1_1.xsd"))