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 6196 - [FT] TestSuite - Syntax
Summary: [FT] TestSuite - Syntax
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: http://basex.org/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-31 07:43 UTC by Christian Gruen
Modified: 2008-11-24 21:47 UTC (History)
2 users (show)

See Also:


Attachments

Description Christian Gruen 2008-10-31 07:43:17 UTC
Hi,

some comments on the current test suite; to avoid too many small bug reports, I have assembled some minor issues in this post.

[1] ExpectedResults/.../2.3-ScoreVariables

Wrong path, should be changed to
.../2.3.1-UsingWeightsWithinAScoredFTContainsExpr


[2] .../examples-23-*.txt

OLD: Somes usability is
NEW: Sometimes usability 


[3] xpath-full-text-10.xml & ExpectedResults//*

OLD: FTAnyallOptions
NEW: FTAnyallOption

...this typo also affects the XQFT specification.


[4] ExpectedResults/.../FTWords/*

OLD: containment is checked.</p>
NEW: containment is checked. </p>

OLD: FTAnyallOption</nt>produces
NEW: FTAnyallOption</nt> produces

OLD: FTWordsValue</nt>is
NEW: FTWordsValue</nt> is


[5] FTPrimary-FTWords-*

OLD: //div2[id="ftwords"]
NEW: //div2[@id="ftwords"]


[6] FTPrimary-FTWords-q1b.xq

OLD: $p ftcontains { $input-context }
NEW: $p ftcontains { $search-token }

..but indeed a query like the following - which should always yield true - could be an interesting one:

 doc("doc.xml") ftcontains { doc("doc.xml") }


[7] FTPrimary-FTWords-q4b.xq

OLD: <paragraphs></paragraphs>
NEW: </paragraphs>


[8] FTAnd-andor.xq

OLD: ftor "ninja"]
NEW: ftor "ninja"]/title


[9] character-queries-results-q2.xml

OLD: <book number="2">...</book>
...This book should be exluded from the result as the wildcard string "resume." will not accept "Resume testing".


[10] logical-queries-results-q2.xml

OLD: <book number="2">...</book> 
...should be excluded as well; "software" is not found here (so "web" ftand "software" will yield false)


[11] logical-queries-results-q5.xml

OLD: <book number="2">...</book> 
...should be excluded as well, as "plan" is actually found here (so "usability" ftand ftnot "plan" will yield false)


[12] FTSelection-Weight-q1e.xq

...the error code "FTDY0016" is not accepted as a result.


[13] wildcard-queries-results-q3.xq / q4.xq

...a closing parenthesis is missing at the end of the queries.


[14] FTAnd-bad2.xq

OLD: Error "XPTY0004"
NEW: Error "XPST0003" 


[15] FTSelection-Weight-q3.xq

OLD: Error "FTDY0016"
NEW: Error "XPTY0004"

...according to the specs, FTDY0016 is only thrown for negative numbers here.



Feel free to ask if you cannot follow my 'verbose' comments..

Christian, BaseX Team 
http://www.basex.org
Comment 1 Pat Case 2008-11-05 16:43:31 UTC
Christian,

Since I have entered the bulk of the Use Case queries into the Test Suite, I can address your points 9-11:

[9] character-queries-results-q2.xml

OLD: <book number="2">...</book>
...This book should be exluded from the result as the wildcard string "resume."
will not accept "Resume testing".

>9.2.2 Q2 Diacritics Insensitive Query uses the diacritics insensitive match opinion. It should return Books 2 and 3 which contain resume either with or without diacritics. If you think I am missing something, please let me know, but Q2 was intended as a counter-point to Q1 Diacritics Sensitive Query which does not return Book 2 for the reason you cited.

[10] logical-queries-results-q2.xml

OLD: <book number="2">...</book> 
...should be excluded as well; "software" is not found here (so "web" ftand
"software" will yield false)

> Yes. My mistake. The results should be Books 1 and 3, not 2 as presented in the Use Cases. I have corrected the expected results in the test suite.

[11] logical-queries-results-q5.xml

OLD: <book number="2">...</book> 
...should be excluded as well, as "plan" is actually found here (so "usability"
ftand ftnot "plan" will yield false)

> Yes. My mistake. The results should be Books 1 and 3, not 2 as presented in the Use Cases. I have corrected the expected results in the test suite.

Thank you so much for implementing XQuery Full Text and for your assistance in polishing the Full Text Test Suite.

Pat Case, Librarian, Library of Congress, FTTF member
Comment 2 Christian Gruen 2008-11-05 16:58:28 UTC
Pat,

thank you for the quick response. A little addition to point [9]..

>> OLD: <book number="2">...</book>
>> ...This book should be exluded from the result as the
>> wildcard string "resume." will not accept "Resume testing".
>
> 9.2.2 Q2 Diacritics Insensitive Query uses the diacritics insensitive match 
> opinion. It should return Books 2 and 3 which contain resume either with or
> without diacritics. If you think I am missing something, please let me know, 
> but Q2 was intended as a counter-point to Q1 Diacritics Sensitive Query which 
> does not return Book 2 for the reason you cited.

Yes, I agree with your comment regarding the diacritics check. However, regarding to section 3.4.2(.1) of the XQFT specs, I assume that the wildcard search "resume." will not match the word "Resume" in the discussed example due to the trailing dot. This case corresponds to the following example (1), whereas (2) would indeed return true:

 (1) 'Resume testing' ftcontains 'resume.' with wildcards
 (2) 'Resume testing' ftcontains 'resum.'  with wildcards

Please correct me if I misinterpreted the specification.
Thanks,

Christian, BaseX Team 
http://www.basex.org


Comment 3 Pat Case 2008-11-05 17:30:59 UTC
Christian,

Re: Yes, I agree with your comment regarding the diacritics check. However,
regarding to section 3.4.2(.1) of the XQFT specs, I assume that the wildcard
search "resume." will not match the word "Resume" in the discussed example due
to the trailing dot. This case corresponds to the following example (1),
whereas (2) would indeed return true:

 (1) 'Resume testing' ftcontains 'resume.' with wildcards
 (2) 'Resume testing' ftcontains 'resum.'  with wildcards

>Yes. You are absolutely correct. 

In both Q1 Diacritics Sensitive Query and Q2 Diacritics Insensitive Query the with wildcards is supposed to allow for the possibly of 1 or more suffix characters to allow the sample text to illustrate the use of the diacritics match options. My mistake was using . with wildcards instead of .? with wildcards.

I have corrected it in test suite queries (leaving the expected results as they were) and the next version of the use cases document will show the changes as well.

Thanks so much.

Pat
Comment 4 Mary Holstege 2008-11-10 20:09:04 UTC
Items #8 and #14: corrected as suggested.
Comment 5 Pat Case 2008-11-10 20:29:20 UTC
Christian,

Re: [13] wildcard-queries-results-q3.xq / q4.xq ...a closing parenthesis is missing at the end of the queries.

It appears that this one is mine also

You are of course correct. I have added additional closing parentheses to the XQuery queries for Wildcard Q3 and Q4 in the test suite and in the use case document.

Thanks again for pointing this stuff out.

Pat Case
Comment 6 Jim Melton 2008-11-11 00:23:13 UTC
Christian, this response addresses the remaining items that have not been addressed already by others. 

[3] xpath-full-text-10.xml & ExpectedResults//*

OLD: FTAnyallOptions
NEW: FTAnyallOption

...this typo also affects the XQFT specification.

>>> You are obviously correct, and the error has been corrected both in the specification and in the test suite result files. 


[4] ExpectedResults/.../FTWords/*

OLD: containment is checked.</p>
NEW: containment is checked. </p>

OLD: FTAnyallOption</nt>produces
NEW: FTAnyallOption</nt> produces

OLD: FTWordsValue</nt>is
NEW: FTWordsValue</nt> is


>>> You are obviously correct, and the error has been corrected both in the specification and in the test suite result files. 


[5] FTPrimary-FTWords-*

OLD: //div2[id="ftwords"]
NEW: //div2[@id="ftwords"]

>>> You are obviously correct, and the error has been corrected both in the specification and in the test suite result files. 


[6] FTPrimary-FTWords-q1b.xq

OLD: $p ftcontains { $input-context }
NEW: $p ftcontains { $search-token }

>>> You are obviously correct, and the error has been corrected both in the specification and in the test suite result files. 

..but indeed a query like the following - which should always yield true -
could be an interesting one:

 doc("doc.xml") ftcontains { doc("doc.xml") }

>>>Undoubtedly true, but I'm not creating such a test at this time. 


[7] FTPrimary-FTWords-q4b.xq

OLD: <paragraphs></paragraphs>
NEW: </paragraphs>

>>>This has been overtaken by events. 

>>>BE AWARE: I have heavily restructured the FTPrimary-FTWordss-* series of tests and their results to better capture all of the various behaviors.  As of the time I'm writing this comment, I'm about 60% done; I still have "all" and "all words" left to do. 


[12] FTSelection-Weight-q1e.xq

...the error code "FTDY0016" is not accepted as a result.

>>>Good catch!


[15] FTSelection-Weight-q3.xq

OLD: Error "FTDY0016"
NEW: Error "XPTY0004"

...according to the specs, FTDY0016 is only thrown for negative numbers here.


>>> You are obviously correct, and the error has been corrected both in the specification and in the test suite result files. 

Thanks again for your very thorough review and your excellent reports. 

I believe that we have now addressed all of the problems that you reported in this bug except for items [1] and [2]. 
Comment 7 Mary Holstege 2008-11-24 21:06:05 UTC
WRT item 1: 
Examples 1-5 should remain in 2.3-ScoreVariables; example 6 should move to 
2.3.1-UsingWeightsWithinAScoredFTContainsExpr. Updated catalog and queries and expected results to accord with this.

WRT item 2: 
Fixed as indicated.

I believe this resolves all issues with this bug.  Please close the bug if you are satisfied with this resolution.