This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12009 - [XQFTTS] FTNot-q6
Summary: [XQFTTS] FTNot-q6
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 (show other bugs)
Version: Proposed Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-08 10:25 UTC by Tim Mills
Modified: 2011-03-17 08:13 UTC (History)
1 user (show)

See Also:


Attachments

Description Tim Mills 2011-02-08 10:25:31 UTC
Our implementation disagrees with the expected (empty sequence) result for test FTNot-q6.

(: FTNot-q6: violates negation restriction 2: FTST0002 possible :)

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

(: nothing :)
$input-context/books/book[para contains text "software" ftand ("coder" ftand ftn
ot
"ninja" window 5 words)]/title

Consider the paragraph:

   <para>Amazingly enough, many people believe that nunchuks are not useful
    to software development! They prefer usability studies to the swift
    application of physical means of persuasion. Hah! The ninja coder knows
    otherwise.
    </para>

and the predicate

para contains text "software" ftand ("coder" ftand ftnot "ninja" window 5 words

Indexing word positions at 1, 'ninja' is at position 29 (a StringExclude) and 'coder' is at 30 (a StringInclude).

Using the function fts:ApplyFTWordWindow  at 

http://www.w3.org/TR/xpath-full-text-10/#tq-ft-fs-FTWindow

n = 5
minpos = 30
maxpos = 30
windowStartPos ranges from 26 to 30 (inclusive)

When windowStartPos is 30, windowEndPos is 34.

Thus:

         for $stringExclude in $match/fts:stringExclude
            where $stringExclude/fts:tokenInfo/@startPos >=
                  $windowStartPos
              and $stringExclude/fts:tokenInfo/@endPos <=
                  $windowEndPos
            return $stringExclude

returns the empty sequence, because 

$stringExclude/fts:tokenInfo/@startPos = 29 which is less than the windowStartPos, thus there exists a window starting at the word 'coder' which doesn't include 'ninja'.  The match contains no stringExcludes so gives the query a result of <title>Ninja Coder</title>.
Comment 1 Tim Mills 2011-02-08 11:48:37 UTC
FTNot-unconstrained-q6 appears to contain an identical query and so has an identical problem.
Comment 2 Tim Mills 2011-02-08 11:50:04 UTC
FTNot-q6-unconstrained-window also appears to contain an identical query and so has an identical problem.
Comment 3 Michael Dyck 2011-02-21 07:23:28 UTC
(personal response:) I agree with your analysis in comment #0.
Comment 4 Michael Dyck 2011-03-15 19:08:02 UTC
At their joint meeting on February 22nd, the WGs agreed that the test-case was broken, and directed me to fix it. I have now committed revised versions of:
ExpectedTestResults/Expressions/Operators/CompExpr/FTContainsExpr/FTSelection/FTOperators/FTUnaryNot/FTNot-q6.txt ExpectedTestResults/Expressions/Operators/CompExpr/FTContainsExpr/FTSelection/FTOperators/FTUnaryNot/FTNot-unconstrained-q6.txt
Both now contain:
    <title>Ninja Coder</title>
as you advised.

The test-case FTNot-q6-unconstrained-window (which you mentioned in comment 2) re-uses FTNot-q6.txt for its expected result, so it's handled by the above change.

I'm marking this bug resolved-fixed. Please mark it closed if you agree with this resolution.
Comment 5 Tim Mills 2011-03-17 08:13:35 UTC
Confirmed fixed.  Thanks.