OASIS eXtensible Access Control Markup Language (XACML) TC

 View Only

Errata: missing duration functions

  • 1.  Errata: missing duration functions

    Posted 05-30-2003 16:06
    dayTimeDuration and yearMonthDuration as standard XACML DataTypes
    were added fairly late in the XACML 1.0 process.  One of the
    primary motivating use-cases for the duration DataTypes was being
    able to say things like "permit if current date minus subject
    birthdate is greater than or equal to 21".  These expressions
    require some way to subtract dates.
    
    We defined {dayTime|yearMonth}Duration-equal functions, but we
    failed to define the other standard functions necessary to use
    durations in the way required.
    
    I believe this was an erratum due to the late date at which the
    duration DataTypes and functions were added.
    
    Date Subtraction Functions
    ==========================
    
    In order to use durations in the way required, we need a way to
    subtract two dates to get a duration.
    
    [XF] defines the following function, which returns a value of
    type "dayTimeDuration":
    
       subtract-dates
    
    The newer revision of [XF] in
    http://www.w3.org/TR/2003/WD-xpath-functions-20030502/ defines
    two such functions:
    
       subtract-dateTimes-yielding-yearMonthDuration
       subtract-dateTimes-yielding-dayTimeDuration
    
    I recommend that we add the two newer functions to XACML for 1.1.
    
    Date and Time Duration Comparison Functions
    ===========================================
    
    In order to compare the results of a date subtraction function,
    we need duration comparison functions.
    
    The following functions are all defined in
    http://www.w3.org/TR/2002/WD-xquery-operators-20020816/ Section
    8.3 [XF].
    
         dayTimeDuration-greater-than
         dayTimeDuration-greater-than-or-equal
         dayTimeDuration-less-than
         dayTimeDuration-less-than-or-equal
         yearMonthDuration-greater-than
         yearMonthDuration-greater-than-or-equal
         yearMonthDuration-less-than
         yearMonthDuration-less-than-or-equal
    
    Note that dayTime is converted to fractional seconds, and
    yearMonth is converted to integer months, so all these functions
    are integer comparisons, support for which is already standard.
    
    I recommend we add all these functions to XACML for 1.1.
    
    Detailed Schema Changes
    =======================
    
    No schema changes are required.
    
    Detailed Spec Changes
    =====================
    
    -Section 10.2.8 Functions: add following lines
    
       urn:oasis:names:tc:xacml:1.0:function:dayTimeDuration-greater-than
       urn:oasis:names:tc:xacml:1.0:function:dayTimeDuration-greater-than-or-equal
       urn:oasis:names:tc:xacml:1.0:function:dayTimeDuration-less-than
       urn:oasis:names:tc:xacml:1.0:function:dayTimeDuration-less-than-or-equal
       urn:oasis:names:tc:xacml:1.0:function:yearMonthDuration-greater-than
       urn:oasis:names:tc:xacml:1.0:function:yearMonthDuration-greater-than-or-equal
       urn:oasis:names:tc:xacml:1.0:function:yearMonthDuration-less-than
       urn:oasis:names:tc:xacml:1.0:function:yearMonthDuration-less-than-or-equal
       urn:oasis:names:tc:xacml:1.0:function:subtract-dateTimes-yielding-yearMonthDuration
       urn:oasis:names:tc:xacml:1.0:function:subtract-dateTimes-yielding-dayTimeDuration
     
     Each should be marked "M" for mandatory.
    
    -Section 11. References: add following entry
    
     [XF-03]   XQuery 1.0 and XPath 2.0 Functions and Operators, W3C
       Working Draft 02 May 2003.  Available at
       http://www.w3.org/TR/2003/WD-xpath-functions-20030502/.
    
    -A.14.7 Date and time arithmetic functions: add following entries
    
     o dayTimeDuration-greater-than
    
       This function SHALL take two arguments, both of data-type
       "http://www.w3.org/TR/2002/WD-xquery-operators-2002-816#dayTimeDuration".
       It SHALL return a result of
       "http://ww.w3.org/2001/XMLSchema#boolean".  This function
       SHALL return the value returned by comparing the value of the
       first argument with the value of the second argument according
       to the specification of the dayTimeDuration-greater-than
       function in [XF Section 8.3].
    
     o dayTimeDuration-greater-than-or-equal
    
       This function SHALL take two arguments, both of data-type
       "http://www.w3.org/TR/2002/WD-xquery-operators-2002-816#dayTimeDuration".
       It SHALL return a result of
       "http://ww.w3.org/2001/XMLSchema#boolean".  This function
       SHALL return the value returned by comparing the value of the
       first argument with the value of the second argument according
       to the specification of the dayTimeDuration-greater-than
       function in [XF Section 8.3].
    
     o dayTimeDuration-less-than
    
       This function SHALL take two arguments, both of data-type
       "http://www.w3.org/TR/2002/WD-xquery-operators-2002-816#dayTimeDuration".
       It SHALL return a result of
       "http://ww.w3.org/2001/XMLSchema#boolean".  This function
       SHALL return the value returned by comparing the value of the
       first argument with the value of the second argument according
       to the specification of the dayTimeDuration-less-than
       function in [XF Section 8.3].
    
     o dayTimeDuration-less-than-or-equal
    
       This function SHALL take two arguments, both of data-type
       "http://www.w3.org/TR/2002/WD-xquery-operators-2002-816#dayTimeDuration".
       It SHALL return a result of
       "http://ww.w3.org/2001/XMLSchema#boolean".  This function
       SHALL return the value returned by comparing the value of the
       first argument with the value of the second argument according
       to the specification of the
       dayTimeDuration-less-than-or-equal function in [XF Section
       8.3].
    
     o yearMonthDuration-greater-than
    
       This function SHALL take two arguments, both of data-type
       "http://www.w3.org/TR/2002/WD-xquery-operators-2002-816#yearMonthDuration".
       It SHALL return a result of
       "http://ww.w3.org/2001/XMLSchema#boolean".  This function
       SHALL return the value returned by comparing the value of the
       first argument with the value of the second argument according
       to the specification of the yearMonthDuration-greater-than
       function in [XF Section 8.3].
    
     o yearMonthDuration-greater-than-or-equal
    
       This function SHALL take two arguments, both of data-type
       "http://www.w3.org/TR/2002/WD-xquery-operators-2002-816#yearMonthDuration".
       It SHALL return a result of
       "http://ww.w3.org/2001/XMLSchema#boolean".  This function
       SHALL return the value returned by comparing the value of the
       first argument with the value of the second argument according
       to the specification of the yearMonthDuration-greater-than-or-equal
       function in [XF Section 8.3].
    
     o yearMonthDuration-less-than
    
       This function SHALL take two arguments, both of data-type
       "http://www.w3.org/TR/2002/WD-xquery-operators-2002-816#yearMonthDuration".
       It SHALL return a result of
       "http://ww.w3.org/2001/XMLSchema#boolean".  This function
       SHALL return the value returned by comparing the value of the
       first argument with the value of the second argument according
       to the specification of the yearMonthDuration-less-than
       function in [XF Section 8.3].
    
     o yearMonthDuration-less-than-or-equal
    
       This function SHALL take two arguments, both of data-type
       "http://www.w3.org/TR/2002/WD-xquery-operators-2002-816#yearMonthDuration".
       It SHALL return a result of
       "http://ww.w3.org/2001/XMLSchema#boolean".  This function
       SHALL return the value returned by comparing the value of the
       first argument with the value of the second argument according
       to the specification of the
       yearMonthDuration-less-than-or-equal function in [XF Section
       8.3].
    
     o subtract-dateTimes-yielding-yearMonthDuration
    
       This function SHALL take two arguments, both of data-type
       "http://www.w3.org/2001/XMLSchema#dateTime".  It SHALL return
       a result of
       "http://www.w3.org/TR/2002/WD-xquery-operators-2002-816#yearMonthDuration".
       This function SHALL return the value returned by subtracting
       the value of the second argument from the value of the first
       argument according to the specification of the
       subtract-dateTimes-yielding-yearMonthDuration function in
       [XF-03 Section 9.7].
    
     o subtract-dateTimes-yielding-dayTimeDuration
    
       This function SHALL take two arguments, both of data-type
       "http://www.w3.org/2001/XMLSchema#dateTime".  It SHALL return
       a result of
       "http://www.w3.org/TR/2002/WD-xquery-operators-2002-816#dayTimeDuration".
       This function SHALL return the value returned by subtracting
       the value of the second argument from the value of the first
       argument according to the specification of the
       subtract-dateTimes-yielding-dayTimeDuration function in
       [XF-03 Section 9.7].
    
    -- 
    Anne H. Anderson             Email: Anne.Anderson@Sun.COM
    Sun Microsystems Laboratories
    1 Network Drive,UBUR02-311     Tel: 781/442-0928
    Burlington, MA 01803-0902 USA  Fax: 781/442-1692