Subject: [VCARDDAV] Cardinality notation

From: Simon Perreault <[email-masked]>
Date: Tue, 02 Nov 2010 09:17:03 -0400

> The current cardinality shorthands are cryptic, please use something more typically readable, e.g.:
> 
>     * (1) - exactly one instance must be present
>     * (1-n) - at least one instance must be present
>     * (0-1) - at most one instance may be present
>     * (0-n) - any number of instances may be present 

How about not inventing our own and using something that people may have
already seen before?

How about UML?

1    - exactly one instance must be present
1..* - at least one instance must be present
0..1 - at most one instance may be present
*    - any number of instances may be present

(The notation we have currently is the "(min, max)-notation of
Jean-Raymond Abrial in 1974" as described on
http://en.wikipedia.org/wiki/Entity-relationship_model. I admit it's not
very popular, and I forget why I picked it.)

Simon
-- 
NAT64/DNS64 open-source --> http://ecdysis.viagenie.ca
STUN/TURN server        --> http://numb.viagenie.ca
vCard 4.0               --> http://www.vcarddav.org

---

From: Cyrus Daboo <[email-masked]>
Date: Tue, 02 Nov 2010 09:54:27 -0400

Hi Simon,

> *    - any number of instances may be present

Or something more familiar in the IETF - ABNF style:

1    - exactly one instance must be present
1*   - at least one instance must be present
*1   - at most one instance may be present
*    - any number of instances may be present

Though that is perhaps a little less readable than what you proposed. 
Anyway, by using ABNF, that does allow flexibility in the future of using 
more complex cardinality rules, e.g. 1*3 etc. It maybe that one day we will 
actually have a proper, complete ABNF for vcard.

-- 
Cyrus Daboo