Subject: [RFC2445] Discrepancy in 4.3.6 Duration (original and May 10th draft)

From: "coral" <[email-masked]>
Date: Fri, 11 May 2001 10:06:58 -0700

There seems to be a point of confusion in 4.3.6 Duration.

-- RFC2234 (ABNF) states:

3.6  Variable Repetition                                *Rule

   The operator "*" preceding an element indicates repetition. The full
   form is:

        <a>*<b>element

   where <a> and <b> are optional decimal values, indicating at least
   <a> and at most <b> occurrences of element.

   Default values are 0 and infinity so that *<element> allows any
   number, including zero; 1*<element> requires at  least  one;
   3*3<element> allows exactly 3 and 1*2<element> allows one or two

-- RFC2445 (iCal), Draft Update (May 10, 2001) states:

4.3.6 Duration

   Value Name: DURATION 

   Purpose: This value type is used to identify properties that contain
   a duration of time. 

   Formal Definition: The value type is defined by the following
   notation: 

        dur-value  = (["+"] / "-") "P" (dur-date / dur-time / dur-week)

        dur-date   = dur-day [dur-time]
        dur-time   = "T" (dur-hour / dur-minute / dur-second)
        dur-week   = 1*DIGIT "W"
        dur-hour   = 1*DIGIT "H" [dur-minute]
        dur-minute = 1*DIGIT "M" [dur-second]
        dur-second = 1*DIGIT "S"
        dur-day    = 1*DIGIT "D"

   Description: If the property permits, multiple "duration" values are
   specified by a COMMA character (US-ASCII decimal 44) separated list
   of values. The format is expressed as the [3] basic format for the
   duration of time. The format can represent durations in terms of
   weeks, days, hours, minutes, and seconds. 

   No additional content value encoding (i.e., BACKSLASH character
   encoding) are defined for this value type. 

   Example: A duration of 15 days, 5 hours and 20 seconds would be: 

        P15DT5H0M20S

   A duration of 7 weeks would be: 

        P7W

-- end

Per the ABNF provided in 4.3.6, P7W as stated directly above is not
valid - 1*DIGIT "W" is satisfied, but the "T", "H", "M", "S", and "D"
are also required.  I would propose changing the section to:

        dur-value  = (["+"] / "-") "P" (dur-date / dur-time / dur-week)

        dur-date   = dur-day [dur-time]
        dur-time   = "T" (dur-hour / dur-minute / dur-second)
        dur-week   = *1DIGIT "W"
        dur-hour   = *1DIGIT "H" [dur-minute]
        dur-minute = *1DIGIT "M" [dur-second]
        dur-second = *1DIGIT "S"
        dur-day    = *1DIGIT "D"

This allows P7W, P15DT5H0M20S, and P15DT4H10S as valid durations.

Working on Net::ICal (a perl module implemented the iCal RFC), I've
recently made a code change that allows us to reduce Duration values
down to only what is necessary to express the duration, by removing
zero-value elements.  Example:

   P15DT0H10M0S    would become    P15DT10M
   P0DT0H0M1S      would become    PT1S

However, this leads to further questions:  Is it allowed to specify
a time duration without providing the dur-day?  How does one express
a zero-value - "P0DT0H0M0S" would reduce to "P", which may or not be
an acceptable duration.

I'm not sure where to go from here.  I prefer being able to specify
time durations without requiring dur-week or dur-day.  Net::ICal is
using PT0S to express zero durations at this time, as it seemed the
most reasonable choice.

Also, there appears to be a thread on the Issues list that may be
of some relevance to this topic:

45 01/19/2001 [Typo] Several examples with durations are missing T

Thanks for your help and time.

coral

---

From: [email-masked]
Date: Fri, 11 May 2001 14:52:52 -0400

>         dur-minute = 1*DIGIT "M" [dur-second]
[Snip]
> are also required.  I would propose changing the section to:

Actually it is satisified by resolving this way:

        P7W = (["+"] / "-")"P" dur-week = "P" 1*DIGIT "W"

The ABNF says "(dur-date / dur-time / dur-week)" which means only 1 of 
them is possible (hence the extra work in dur-date, etc).  As such, P7W 
resolves in just 1 step.  There is no ABNF requirement for the dur-time, 
dur-date, dur-hour, etc if resolving the value to dur-week.

Now the ABNF does NOT allow for something like P2W3DT12H (ie: 2 Weeks, 3 
Days and 12 Hours) but thats not the same case you seem to be looking for.

> a zero-value - "P0DT0H0M0S" would reduce to "P", which may or not be

Sure, the ABNF is:

which for your question would be resolveable by resolving the ABNF down to 

        dur-value  = (["+"] / "-") "P" dur-time

As for the 0 length duration, its legal to have PT0H0M0S (or just PT0H, 
etc) but the question is WHY have it?  If the entry has no length, why use 
a DURATION at all??  Guess Im just not sure why you would even want to 
generate that...

Bruce
===========================================================================
Bruce Kahn                                INet: [email-masked]
Iris Associates                          Phone: 978.392.5335
Westford, MA, USA 01886                    FAX: and nothing but the FAX...
Standard disclaimers apply, even where prohibited by law...

---

From: [email-masked]
Date: Thu, 17 May 2001 17:59:46 -0400

Alan, minor errors can not be corrected in a published RFC - that is 
correct. That's the errata list.  However, if there are changes required 
to a draft (i.e. ones that impact interoperability), the process is to 
reissue the draft with a new number.

---

From: Alan Davies <[email-masked]>
Date: Thu, 17 May 2001 18:30:01 -0400

Yes, so referring to RFC2445 is specific enough, as
2445 will not change. 2445 may be obsoleted by RFC9999
at some time in the future though.

I assume you're using the term 'draft' to refer to a 'Draft
Standard' as opposed to an 'Internet Draft'. iCalendar, iTIP
and IMIP are of course 'Proposed Standards' [RFC2800, May 2001].

--Alan

---

From: [email-masked]
Date: Thu, 17 May 2001 17:59:46 -0400