<?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>3419</bug_id>
          
          <creation_ts>2006-06-30 22:18:26 +0000</creation_ts>
          <short_desc>AllMatches model fails to represent correct semantics of FTUnaryNot</short_desc>
          <delta_ts>2006-08-16 17:47:11 +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>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/xquery-full-text/#tq-ft-fs-FTUnaryNot</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joaquin Delgado">joaquin.delgado</reporter>
          <assigned_to name="Jim Melton">jim.melton</assigned_to>
          
          
          <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>10339</commentid>
    <comment_count>0</comment_count>
    <who name="Joaquin Delgado">joaquin.delgado</who>
    <bug_when>2006-06-30 22:18:26 +0000</bug_when>
    <thetext>In section 3.1.5 (FTUnaryNot) the following example is given

/book[. ftcontains ! &quot;usability&quot;]

which following the evaluation efectively returns the empty sequence because all book elements contains &quot;usability&quot;. However if one were to write

/book[. ftcontains ! &quot;XSLT&quot;]

The expected results is all book elements because the expression (! &quot;XSLT&quot;) evaluates TRUE for all books which do not contain the word &quot;XSLT&quot;. However in the semantics defined with the AllMatches model in http://www.w3.org/TR/xquery-full-text/#tq-ft-fs-FTUnaryNot this fails. 

Esencially the evaluation of FTWords returns no match (no stringInclude) and therefore the negation of an empty match is empty as well, thus the evaluation returs FALSE when it should return TRUE for all books. That is because we do not handle the concept of complement (e.g. *) that represents the rest of the world that is not a match.

This problem can be avoided if we only support AND NOT instead of UnaryNot or introduce the representation of complement in cases where there is negation of an empty match.

-- Joaquin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10418</commentid>
    <comment_count>1</comment_count>
    <who name="Joaquin Delgado">joaquin.delgado</who>
    <bug_when>2006-07-07 00:12:11 +0000</bug_when>
    <thetext>This standalone UnaryNot does not have a bug.

The negation of an empty &lt;allMatches&gt; is not an empty &lt;allMatches&gt; but an &lt;allMatches&gt; with one empty &lt;match&gt;. That is clear in the definition of fts:UnaryNotHelper. It populates &lt;match/&gt; when there is no &lt;match&gt; in &lt;allMatches&gt;. This empty &lt;match&gt; element satisfies fts:FTContainsExpr because it has no &lt;stringExclude&gt;. So, ftcontains returns TRUE as expected.

Thanks,

J.D.
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>