Skip to content

Duplicate parent components not (always) detected #249

@MichaelClerx

Description

@MichaelClerx

Neither of these are detected:

<?xml version="1.0" encoding="UTF-8"?>
<!-- CellML Test Suite. https://github.com/MichaelClerx/cellml-validation -->
<!-- CellML 1.0, 6.4.3.2: A component may not appear more than once in a relationsip -->
<model name="component_ref_duplicate_child_1"
       xmlns="http://www.cellml.org/cellml/1.0#">
  <component name="A" />
  <component name="B" />
  <group>
    <relationship_ref relationship="containment" />
    <component_ref component="A">
      <component_ref component="B" />
      <component_ref component="B" />
    </component_ref>
  </group>
</model>

^ this is acceptable-ish, but not valid CellML

<?xml version="1.0" encoding="UTF-8"?>
<!-- CellML Test Suite. https://github.com/MichaelClerx/cellml-validation -->
<!-- CellML 1.0, 6.4.3.2: A component may not appear more than once in a relationsip -->
<model name="component_ref_duplicate_child_2"
       xmlns="http://www.cellml.org/cellml/1.0#">
  <component name="A" />
  <component name="B" />
  <component name="C" />
  <group>
    <relationship_ref relationship="containment" />
    <component_ref component="A">
      <component_ref component="B">
        <component_ref component="C" />
      </component_ref>
      <component_ref component="C" />
    </component_ref>
  </group>
</model>

^ This should definitely be detected

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions