Skip to content

Sample CellML files for testing#22

Merged
jonc125 merged 13 commits intodevelopfrom
test_cellml_files
Apr 6, 2018
Merged

Sample CellML files for testing#22
jonc125 merged 13 commits intodevelopfrom
test_cellml_files

Conversation

@jonc125
Copy link
Copy Markdown
Contributor

@jonc125 jonc125 commented Feb 21, 2018

For #21. I think this is now a fairly complete set of tests for the CellML parsing side of things.

@jonc125 jonc125 self-assigned this Feb 21, 2018
@ghost ghost added the in progress label Feb 21, 2018
@jonc125 jonc125 requested a review from tamuri April 6, 2018 08:15
@jonc125 jonc125 changed the title Sample CellML files for testing [WIP] Sample CellML files for testing Apr 6, 2018
@jonc125 jonc125 added review and removed in progress labels Apr 6, 2018
Copy link
Copy Markdown
Contributor

@tamuri tamuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Well-formed, MathML valid and transpiler works, RDF valid. We can check the various connections/annotations as we develop. Out of interest, the CellML XML schema has for connection type:

<xsd:element name="connection" type="connection_type" />

<xsd:complexType name="connection_type">
    <xsd:choice  maxOccurs="unbounded" >
      <xsd:element ref="map_components" />
      <xsd:element ref="map_variables" />
    </xsd:choice>
  </xsd:complexType>

Therefore, this test model (and the weblab cellml examples I looked at) doesn't validate with schema.

@jonc125
Copy link
Copy Markdown
Contributor Author

jonc125 commented Apr 6, 2018

I'm aware that the XML Schema for CellML 1 doesn't capture all restrictions, but I thought it would at least validate things that were valid. Though I've not tried it in years. I checked the files with pycml and it says they're OK, which I trust much more :)

Though I don't see why the snippet you showed would fail to validate - doesn't the maxOccurs on the choice let you have more than 1 of each? So it's really too lenient (you should have at most one map_components).

@jonc125 jonc125 merged commit 448373a into develop Apr 6, 2018
@ghost ghost removed the review label Apr 6, 2018
@jonc125 jonc125 deleted the test_cellml_files branch April 6, 2018 11:22
@tamuri
Copy link
Copy Markdown
Contributor

tamuri commented Apr 6, 2018

<xsd:choice> means only one of the elements, but that one element can occur multiple times with maxOccurs="unbounded". The CellML DTD also defines the same choice but has the occurence as you describe: <!ELEMENT connection (map_components | map_variables+)>

@jonc125
Copy link
Copy Markdown
Contributor Author

jonc125 commented Apr 6, 2018

Not if the maxOccurs is on the choice - that means that the choice itself can be made many times, and each time it's free to choose differently.

@jonc125
Copy link
Copy Markdown
Contributor Author

jonc125 commented Apr 6, 2018

If the maxOccurs was on each child element declaration, then it'd do what you're describing.

@tamuri
Copy link
Copy Markdown
Contributor

tamuri commented Apr 6, 2018

Ah, yes, that's right.

@tamuri
Copy link
Copy Markdown
Contributor

tamuri commented Apr 6, 2018

I checked the files with pycml and it says they're OK, which I trust much more :)

Thanks & confirmed, validates with the Relax NG schema from https://chaste.comlab.ox.ac.uk/cellml/

@jonc125 jonc125 mentioned this pull request Apr 17, 2018
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants