open-psa / mef

The Open-PSA Model Exchange Format
https://open-psa.github.io/mef
5 stars 7 forks source link

Uniqueness of attributes #60

Open rakhimov opened 6 years ago

rakhimov commented 6 years ago

The current specification for MEF attributes functionality does not explicitly state whether it allows duplicates or not. Is it implicitly unique? (like XML attributes or Object attributes/properties)

The situation with duplicates would be complicated because variables can inherit and override container attributes.

Consider the following example:

<opsa-mef>
  <define-fault-tree name="tree">
    <attributes>
      <attribute name="room" value="42"/>
      <attribute name="room" value="13"/> <!-- Error? -->
    </attributes>

    <define-basic-event name="pump">
      <attributes>
        <attribute name="room" value="66"/>
      </attributes>
    </define-basic-event>
  </define-fault-tree>
</opsa-mef>

If duplicate attributes were allowed, which 'room' attribute would event 'pump' override? (all of them?)

An analogy for the dilemma can be set vs. multiset. It is just not clear/explicit what the MEF wants.