[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: RE: ANN: Portable Data Component -- start/end

  • From: "Toby Considine" <Toby.Considine@gmail.com>
  • To: "'Costello, Roger L.'" <costello@mitre.org>,<xml-dev@l...>
  • Date: Mon, 18 Apr 2011 13:49:17 -0700

RE:  RE: ANN: Portable Data Component -- start/end
In WS-Calendar (in process) , which is meant as a formalization of iCalendar
for use in service interactions, we discussed this long and hard . Many of
the initial use cases for ws-calendar are tied to smart grids / smart
energy, where time f delivery and duration are critical. In that space, we
had before us:

Start time
End Time
Duration.

Clearly if you have any two, you can derive the third. We decided the
Duration was the most critical, as that two how movie is a service that can
be provided any number of times per day. As the proposed movie moves toward
a transaction (Let's go to the 11:00 pm show!), The start time is added to
the Duration. In this way, transactional validation can occur without
complex "Add this element to another element and see what time it is) logic.

Duration is defined in RFC5545, but is essentially one of the legal variants
of ISO 8601. Durations have some not obvious, until you think twice, rules
about meaning. ISO861 defines rules for understanding duration. For example,
a day is not the same as 24 hours, P1D is not the same as PT24H. While P1D
is usually 24 hours, once a year it is 23, and once a hear it is 25. 1D
takes us to the same time tomorrow. If you specific 24 hours, well that is
what you want. If you specific a day, it is the period between [now] and the
same time tomorrow. This same thinking distinguishes P1M from P30D; A month
from now is May 18. This month, that same is true for P30D.

Leap minutes and Leap Seconds are also handled by selecting the correct
units for the duration.

tc


"He who fights with monsters should look to it that he himself does not
become a monster, and if you stare long into an abyss, the abyss also stares
into you."   - Fredrich Nietzche

Toby Considine
TC9, Inc
TC Chair: oBIX & WS-Calendar
TC Editor: EMIX, EnergyInterop
U.S. National Inst. of Standards and Tech. Smart Grid Architecture Committee

  
Email: Toby.Considine@gmail.com
Phone: (919)619-2104
http://www.tcnine.com/
blog: www.NewDaedalus.com


-----Original Message-----
From: Costello, Roger L. [mailto:costello@mitre.org] 
Sent: Monday, April 18, 2011 11:19 AM
To: xml-dev@lists.xml.org
Subject:  RE: ANN: Portable Data Component -- start/end

Hi Folks,

Suppose that a person records the start time and end time of a movie, which
starts at 11pm and ends at 1am the next day:

    <movie>
        <start>23:00:00</start>
        <end>01:00:00</end>
    </movie>

Validating that against the portable start/end data component (see below)
results in this error: "movie does not match the assertion".

Had the movie times been specified using dateTime:

    <movie>
        <start>2011-04-16T23:00:00</start>
        <end>2011-04-17T01:00:00</end>
    </movie>

then there would be no error.

QUESTION

Who's at fault? 

    - The person who specified the movie times using just time values? 
    - Or, the portable start/end data component for throwing an error on
perfectly good movie times?

/Roger

P.S. Here's the portable start/end data component:

    <xs:complexType name="start-end-date-time">
        <xs:sequence>
            <xs:element name="start">
                <xs:simpleType>
                    <xs:union memberTypes="xs:date xs:time 
                                           xs:dateTime" />
                </xs:simpleType>
            </xs:element>
            <xs:element name="end" minOccurs="0">
                <xs:simpleType>
                    <xs:union memberTypes="xs:date xs:time 
                                           xs:dateTime" />
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
        <xs:assert test="
              if (exists(end)) then 
                  if (start castable as xs:dateTime) then
                      xs:dateTime(end) gt xs:dateTime(start)
                  else if (start castable as xs:date) then
                      xs:date(end) gt xs:date(start)
                  else if (start castable as xs:time) then
                      xs:time(end) gt xs:time(start)
                  else true()
              else true()" />
    </xs:complexType>

Comments welcome.

/Roger

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support
XML implementation and development. To minimize spam in the archives, you
must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org List archive:
http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.