FpML Issues Tracker

850: ird-23 referenced element doesn’t exist

September 18, 2008

closed

Minor

Always

Validation Rules

Admin

None

Summary

An element referenced in ird-23 do not exist in the FpML schema.

The rule today is: " ird-23 (Mandatory) Context: StubCalculationPeriodAmount (complex type) iff(exist initialStub, calculationPeriodDates element referenced by calculationPeriodDates/@href contains at least one of:

* firstPeriodStartDate * firstRegularPeriodStartDate

). "

The element that does not exist in FpML is: //element(*, StubCalculationPeriodAmount)/calculationPeriodDates

Notes:

  • h_mcallister

    10/13/08 4:50 pm

    (1) I’d submit that the issue, as expressed, is an over-literal misconstruction of the logic represented by the rule. Put another way, the problem is not that FpML calculationPeriodDates does not exist, but that the context of the rule is set at the wrong level (should be InterestRateStream).

    (2) As noted before, firstPeriodStartDate is an optional, secondary characteristic of an InterestRateStream with an initial stub; the element should not exist in the absence of firstRegularPeriodStartDate.

    (3) It is entirely possible for an InterestRateStream to have an initial stub, as denoted by the presence of firstRegularPeriodStartDate, but not to contain stubCalculationPeriodAmount; or to contain stubCalculationPeriodAmount without initialStub being present (only finalStub). Therefore the use of iff() is incorrect here, as it implies mutual dependency between its arguments.

    Taking all these points into consideration, the rule should be expressed as:

    Context: InterestRateStream (complex type)
    if(exists stubCalculationPeriodAmount/initialStub, calculationPeriodDates element referenced by stubCalculationPeriodAmount/calculationPeriodDates/@href contains firstRegularPeriodStartDate)

    * Similar concerns apply to the formal expression of ird-24.

  • matthewdr

    10/14/08 4:26 pm

    Thanks to Harry for explaining the rule.

    Using the style in the FpML Validation Architecture would give:

    Context: InterestRateStream (complex type)
    Guard: [exists(stubCalculationPeriodAmount/initialStub)]
    Test: exists(id(stubCalculationPeriodAmount/calculationPeriodDates/@href)/firstRegularPeriodStartDate)

  • h_mcallister

    10/14/08 6:26 pm

    (i) The “href” expression should read:
    stubCalculationPeriodAmount/calculationPeriodDates*Reference*/@href
    I propagated the error from the original rule – apologies.

    (ii) I don’t understand the “Test” expression:
    exists(id(stubCalculationPeriodAmount/calculationPeriodDates/@href)/firstRegularPeriodStartDate)
    – please elucidate.

  • matthewdr

    10/15/08 1:02 pm

    Applying Harry’s correction to the rule this gives us the following (using the style in the FpML Validation Architecture):

    Context: InterestRateStream (complex type)
    Guard: [exists(stubCalculationPeriodAmount/initialStub)]
    Test: exists(id(stubCalculationPeriodAmount/calculationPeriodDatesReference/@href)/firstRegularPeriodStartDate)

    id() and exists() are functions used in FpML. They have pre-existing definitions in XPath, so as per the FpML Validation Architecture they are not re-defined.

    ## exists() is defined at: http://www.w3.org/TR/xpath-functions/#func-exists
    ## id() is defined at http://www.w3.org/TR/xpath-functions/#func-id

  • matthewdr

    10/21/08 1:26 pm

    Agreed at the VWG to implement:


    Context: InterestRateStream (complex type)
    Guard: [exists(stubCalculationPeriodAmount/initialStub)]
    Test: exists(id(stubCalculationPeriodAmount/calculationPeriodDatesReference/@href)/firstRegularPeriodStartDate)

  • mgratacos

    10/21/08 1:29 pm

    Agreed proposed solution discussed by Matthew and Harry.

    Description of the rule in English should be added as a comment. Andrew will look at it.

  • h_mcallister

    10/28/08 1:55 pm

    I’d like to add a qualification to point (2) in my posting of 2008-10-13 (0001987), where I wrote that “firstPeriodStartDate … should not exist in the absence of firstRegularPeriodStartDate”.

    There is one case where firstPeriodStartDate might exist in the absence of firstRegularPeriodStartDate; that is a single, broken period comprising the term of the trade, which is accrued as for a full period.

    Admittedly, the circumstances under which this might occur are perhaps somewhat artificial; nonetheless the possibility exists, and we have seen a real use case recently, so it’s worth pointing out.

    Point (2) is correct in the context of the rule – by definition, an interestRateStream with an initial stub comprises more than one period, so firstRegularPeriodStartDate exists irrespective of whether firstPeriodStartDate is also required.

  • lyteck

    12/11/08 8:50 pm

    ird-23 was refactored since (as a result of implementing issue 740). The current LCWD implementation (prior to implementing 850) is:


    ird-23 (Mandatory)
    Context: StubCalculationPeriodAmount (complex type)
    English Description:
    initialStub exists if and only if the calculationPeriodDates element referenced by calculationPeriodDates/@href contains at least one of: firstPeriodStartDate, firstRegularPeriodStartDate
    Formal Description:
    iff(exists(initialStub), exists(id(calculationPeriodDates/@href)/(firstPeriodStartDate | firstRegularPeriodStartDate))”

    I think the following implementation summarizes the above discussion. Please verify/correct (in particular the English):


    ird-23 (Mandatory)
    Context: InterestRateStream (complex type)
    English Description:
    if stubCalculationPeriodAmount/initialStub exists, the calculationPeriodDates element referenced by the @href attribute of stubCalculationPeriodAmount/calculationPeriodDatesReference contains firstRegularPeriodStartDate

    Formal Description (as per Matthew note 0002011):
    [exists(stubCalculationPeriodAmount/initialStub)]
    exists(id(stubCalculationPeriodAmount/calculationPeriodDatesReference/@href)/firstRegularPeriodStartDate)

  • matthewdr

    12/16/08 2:24 pm

    Agreed at VWG today to implement as proposed.

  • lyteck

    12/16/08 7:53 pm

    implemented.

  • Leave an update

    You must be logged in to post an update.