DAP4: Proposal for Keys in Sequences

From OPeNDAP Documentation
Revision as of 19:41, 1 May 2012 by DennisHeimbigner (talk | contribs) (Created page with "DevelopmentDAP4 << Back to OPULS Development ==Background== John Caron has argued that supporting nested sequen...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
⧼opendap2-jumptonavigation⧽

<< Back to OPULS Development

Background

John Caron has argued that supporting nested sequences is desirable because it provides a natural representation for certain datasets such as trajectories of trajectories.

Proposal

I propose to support a specific form of nested Sequences. Consider this example.

<Sequence name="SQ1">
  <Int32 name="f11"/>
  <Sequence name="SQ2">
    <Int32 name="f21"/>
  </Sequence>
  <Structure name="ST1">
    <Sequence name="SQ3">
      <Int32 name="f31"/>
    </Sequence>
  </Structure>
</Sequence>
</Sequence>

This example would be legal under my proposal and would be equivalent to the following.

<Sequence name="SQ1">
  <Int32 name="f11"/>
  <Int32 name="SQ1.SQ2"/>
</Sequence>
<Sequence name="SQ1.SQ2">
  <Int32 name="SQ1.SQ2"/>
  <Int32 name="f21"/>
  <Int32 name="SQ1.ST1.SQ3"/>
</Sequence>
<Sequence name="SQ1.ST1.SQ3">
  <Int32 name="SQ1.ST1.SQ3"/>
  <Int32 name="f31"/>
</Sequence>

What I have done is to flatten the sequences so that they are all treated as top-level sequences with slightly different names. In addition I have added foreign key columns to the flattened sequences to support proper joining of the sequences.

Rationale

This proposal supports John's desire for nested sequences while it still maintains the effect that all sequences are treated as top-level.

Note specifically that the first version is how it would appear in the DDX and the second, flattened version is how it would be interpreted

Dennis