<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>15285</bug_id>
          
          <creation_ts>2011-12-20 18:21:52 +0000</creation_ts>
          <short_desc>[XQ30UseCases] WindowingUseCase05 - incorrect results</short_desc>
          <delta_ts>2012-05-31 19:15:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 3.0 Use Cases</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>andrew.eisenberg</cc>
    
    <cc>jim.melton</cc>
    
    <cc>matthias.brantner</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>61828</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-12-20 18:21:52 +0000</bug_when>
    <thetext>The results I get from this test are 8.88 8.68 12.52 15.6 24.72, which I believe to be correct.

For example, the third window is (6, 13, 33). The smoothed average is therefore 

(0.2*33) + (0.8*(0.2*13 + 0.8*6))

which is 12.52, not 12.32 as given.

(Note, the error appears to be present in the published use cases)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61830</commentid>
    <comment_count>1</comment_count>
    <who name="Matthias Brantner">matthias.brantner</who>
    <bug_when>2011-12-20 18:27:38 +0000</bug_when>
    <thetext>I have confirmed the proposed result with Zorba and updated the test&apos;s expected result.

I&apos;m changing the component of the bug to &quot;XQuery 3.0 Use Cases&quot; because the expected results given in the use cases document also needs to be changed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61832</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2011-12-20 18:38:05 +0000</bug_when>
    <thetext>Fixed in the internal Working Draft of the XQuery 3.0 Use Cases document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65610</commentid>
    <comment_count>3</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2012-03-15 16:43:35 +0000</bug_when>
    <thetext>The resolution for Bug #11763 was to change the source document for Q5. With this modified source document, the result of the query should continue to be:

8.88 8.68 12.32 15.24 23.92

For example, the third window is (6, 13, 32). The smoothed average is therefore 

(0.2*32) + (0.8*(0.2*13 + 0.8*6))

which is 12.32.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66118</commentid>
    <comment_count>4</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2012-03-27 15:23:46 +0000</bug_when>
    <thetext>Fixed now:

&lt;quote&gt;
Solution in XQuery:

declare variable $timesequence := fn:doc(&quot;temp_events.xml&quot;);
let $SMOOTH_CONST := 0.2

for sliding window $w in $timesequence/stream/event
  start at $s_pos when true()
  only end at $e_pos when $e_pos - $s_pos eq 2
return
  round-half-to-even($SMOOTH_CONST * data($w[3]/@temp) + (1 - $SMOOTH_CONST) *
    ( $SMOOTH_CONST * data($w[2]/@temp) +
      (1 - $SMOOTH_CONST) * data($w[1]/@temp) ), 2)

Expected Result:

8.88 8.68 12.32 15.24 23.92
&lt;/quote&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>