<?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>8407</bug_id>
          
          <creation_ts>2009-12-01 08:51:29 +0000</creation_ts>
          <short_desc>[XQFTTS] MildNot test cases</short_desc>
          <delta_ts>2009-12-21 07:36:53 +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>Full Text 1.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</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="Peter M. Fischer">peter.fischer</reporter>
          <assigned_to name="Jim Melton">jim.melton</assigned_to>
          <cc>pcase</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>29849</commentid>
    <comment_count>0</comment_count>
    <who name="Peter M. Fischer">peter.fischer</who>
    <bug_when>2009-12-01 08:51:29 +0000</bug_when>
    <thetext>The following cases might be errors in the test suite, related to mildNot:

- FTMildNot-q2/FTMildNot-unconstrained-q2:
$input-context/books/book[para contains text &quot;usability studies&quot; not in &quot;usability&quot;]/title

(against ftbookexample)

The expected result is &quot;Ninja Coder&quot;, but I think that the correct result should be empty. &quot;usability studies&quot; is indeed found in the &quot;ninja coder&quot; book, but one of the matches of &quot;usability&quot; is found inside &quot;usability studies&quot;, therefore fulfilling the FTMildNot requirement for removing this match from the result.
(I reported this problem in a private mail to Jim Melton before, the answer might have been lost)

- FTMildNot-bad3: The intent of the query seems to generate a StringExclude by using a FTTimes, triggering an error in FTMildNot. 

If I understand the semantics of FTTimes and FTUnaryNot correctly, in this specific case no StringExclude will be generated:
- The FTTimes is applied on the Matches for &quot;ninja&quot;, within the search context of $input-context/books/book/para there is only a single Match with a single StringInclude (in the &quot;para&quot; element in the &quot;Ninja Coder&quot; book)

- According to the FTTimes semantics (4.2.6.10 FTTimes),
fts:FormRange((M(S(&quot;Ninja&quot;))), 1, 1, $allMatches/@stokenNum) is invoked,

- In FormRange, fts:FormCombinationsAtLeast() is invoked for $times values of 1 and 2, the result of the latter is then negated using FTUnaryNot

- The invocation (denoted as $am1) with $times eq 1 yields M(S(&quot;Ninja&quot;))
- The invocation (denoted as $am2) with $times eq 2 yields (), since the number of elements in the match sequence is smaller than $times (and the for clause in FormCombinationsAtLeast will therefore not produce anything)

- FTUnaryNot is applied on $am2 (with the an () value), resulting in an AllMatch containing a match without any StringExcludes or StringIncludes (see 
UnaryNotHelper: if (fn:empty($matches)) then &lt;fts:match/&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30058</commentid>
    <comment_count>1</comment_count>
    <who name="Pat Case">pcase</who>
    <bug_when>2009-12-09 20:35:56 +0000</bug_when>
    <thetext>Hi Peter,

Again, thanks for your help. 

Again, please mark the bug closed or let us know that you remain unsatisfied.

--Responses follow inline:

- FTMildNot-q2/FTMildNot-unconstrained-q2:
$input-context/books/book[para contains text &quot;usability studies&quot; not in
&quot;usability&quot;]/title

(against ftbookexample)

The expected result is &quot;Ninja Coder&quot;, but I think that the correct result
should be empty. &quot;usability studies&quot; is indeed found in the &quot;ninja coder&quot; book,
but one of the matches of &quot;usability&quot; is found inside &quot;usability studies&quot;,
therefore fulfilling the FTMildNot requirement for removing this match from the
result.
(I reported this problem in a private mail to Jim Melton before, the answer
might have been lost)

--No change. We believe your evaluation is correct for &quot;usability&quot; not in &quot;usability studies&quot;, but not for this example &quot;usability studies&quot; not in &quot;usability&quot;.  In the latter, &quot;usability studies&quot; must be a part of the match for &quot;usabiity&quot; to exclude the match. That can never be, so Ninja Coder is returned. The MildNot only excludes matches where the first operand is a subset of the second. 

- FTMildNot-bad3: The intent of the query seems to generate a StringExclude by
using a FTTimes, triggering an error in FTMildNot. 

If I understand the semantics of FTTimes and FTUnaryNot correctly, in this
specific case no StringExclude will be generated:
- The FTTimes is applied on the Matches for &quot;ninja&quot;, within the search context
of $input-context/books/book/para there is only a single Match with a single
StringInclude (in the &quot;para&quot; element in the &quot;Ninja Coder&quot; book)

- According to the FTTimes semantics (4.2.6.10 FTTimes),
fts:FormRange((M(S(&quot;Ninja&quot;))), 1, 1, $allMatches/@stokenNum) is invoked,

- In FormRange, fts:FormCombinationsAtLeast() is invoked for $times values of 1
and 2, the result of the latter is then negated using FTUnaryNot

- The invocation (denoted as $am1) with $times eq 1 yields M(S(&quot;Ninja&quot;))
- The invocation (denoted as $am2) with $times eq 2 yields (), since the number
of elements in the match sequence is smaller than $times (and the for clause in
FormCombinationsAtLeast will therefore not produce anything)

- FTUnaryNot is applied on $am2 (with the an () value), resulting in an
AllMatch containing a match without any StringExcludes or StringIncludes (see 
UnaryNotHelper: if (fn:empty($matches)) then &lt;fts:match/&gt;

--Agreed. Thinking the test case was supposed to illustrate this statement in section 3.5.3 [Mild-Not Selection]:
     Operands of a mild-not selection may not contain a full-text
     selection that evaluates to an AllMatches that contains a
     StringExclude. Such full-text selections are not-selection and
     FTWords with a cardinality constraint using &apos;at most&apos;, &apos;from ... to&apos;,
     and &apos;exactly&apos; occurrences ranges. If such an expression is
     encountered, an error [err:FTDY0017] is raised.
--We replaced the test suite query with:
(: FTMildNot-bad3: mild not with bad argument :)

(: insert-start :)
declare variable $input-context external;
(: insert-end :)

$input-context/books/book[para contains text &quot;blues&quot; occurs exactly 1 times not in &quot;oxford blues&quot;&quot;]/title


Pat Case, Library of Congress, for the Full Text Task Force

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30221</commentid>
    <comment_count>2</comment_count>
    <who name="Peter M. Fischer">peter.fischer</who>
    <bug_when>2009-12-21 07:36:53 +0000</bug_when>
    <thetext>Dear Pat,

thanks for the clarification. 

Regards,
Peter</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>