handling metadata with multiple values

Patrick Dowler patrick.dowler at nrc-cnrc.gc.ca
Tue Aug 12 15:37:51 PDT 2003


On August 12, 2003 15:20, Matthew Graham wrote:
> Hi,
>
> Here's my tuppence worth:
>
> So what happens when you have an application that tries to handle the
> data
> described by these?  Consider something based on JAXB:
>
> <ucdlist>
>    <ucd> ucd1 </ucd>
>    <ucd> ucd2 </ucd>
> </ucdlist>
>
> will give me a class UCDList which contains a collection of UCDs;
> whereas

Now  you have to have classes for every item type, plus every list type.

> <list>
>    <ucd> foo </ucd>
>    <ucd> bar </ucd>
> </list>
>
> gives me a standard List containing UCDs. The question is it is
> necessary
> to flag the list as containing UCDs (UCDList) or is it sufficient to say
> I
> have a list and then inquire what the list contains? Surely an
> alternative
> might be:
>
> <list containsOnly="ucd">
>    <ucd> foo </ucd>
>    <ucd> bar </ucd>
> </list>

This is a "type-safe" list in that one declares (enforces?) it to have only
certain types of children; that would be great if it can be done such that
all validation is done by the XML parser (ie. well-formed and conforming to
an XSD). Any gurus know how to do that??

> or even
>
> <list containsOnly="ucd">
>    <item> foo </item>
>    <item> bar </item>
> </list>
>
> where foo and bar are UCDs by implication.

This suffers exactly from the problem I mentioned: you cannot (re)move an
item without losing all meaning. IMO that's bad.


-- 
Patrick Dowler
Tel/Tél: (250) 363-6914                  | fax/télécopieur: (250) 363-0045
Canadian Astronomy Data Centre   | Centre canadien de donnees astronomiques
National Research Council Canada | Conseil national de recherches Canada
Government of Canada                  | Gouvernement du Canada
5071 West Saanich Road               | 5071, chemin West Saanich
Victoria, BC                                  | Victoria (C.-B.)



More information about the registry mailing list