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 11813 - Clarification request for the Constr-cont-nsmode-5 test
Summary: Clarification request for the Constr-cont-nsmode-5 test
Status: RESOLVED WONTFIX
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: unspecified
Hardware: All Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Benjamin Nguyen
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
: 11824 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-19 15:58 UTC by Nicolae Brinza
Modified: 2016-04-12 14:36 UTC (History)
5 users (show)

See Also:


Attachments

Description Nicolae Brinza 2011-01-19 15:58:47 UTC
The XQTS contains tests Constr-cont-nsmode-5 through Constr-cont-nsmode-10 (without Constr-const-nsmode-9), which verify the conditions for raising XQTY0086 ( http://www.w3.org/TR/xquery-30/#ERRXQTY0086 ). 

In brief, to raise the XQTY0086 error, the document needs to contain an item whose dynamic type is xs:QName or xs:NOTATION. This, in my opinion, requires that the input document by validated against a schema (in the case of these tests, atomic.xml should be validated against atomic.xsd). 

Hence, shouldn't these tests include an "import schema" statement? And as a consequence, moved to the XML Schema optional features category?

While it is true that the XDM instance can have validation information without an explicit schema import statement (e.g. through implementation defined means), there are no provisions in the XQTS for indicating this should be done for these tests.
Comment 1 Michael Kay 2011-01-19 17:00:44 UTC
I don't think there's an explicit statement in the test guidelines to this effect, but I find the following rule works: if the <source> element in the test-sources section of the catalog has a "schema" attribute, then validate the source document against that schema before running the query. An import-schema declaration is needed in the query only if the query contains explicit references to components declared in the schema.
Comment 2 Nicolae Brinza 2011-01-24 22:11:59 UTC
The rule would obviously fix the tests in discussion (and in that case should be added to the Testsuite instructions), but my question still remains: shouldn't they be moved to the XML Schema optional features?

As it stands now, it is impossible for a Minimal Conformance XQuery processor that does not implement the Schema Validation optional feature to pass 100% of the Minimal Conformance tests.
Comment 3 Daniela Florescu 2011-01-25 02:39:53 UTC
This is a bug in the testing methodology.

This should be stated explicitly, not made as an hidden rule that some
implementations do even though it is not stated anywhere.

Best
Dana


(In reply to comment #1)
> I don't think there's an explicit statement in the test guidelines to this
> effect, but I find the following rule works: if the <source> element in the
> test-sources section of the catalog has a "schema" attribute, then validate the
> source document against that schema before running the query. An import-schema
> declaration is needed in the query only if the query contains explicit
> references to components declared in the schema.
Comment 4 Benjamin Nguyen 2011-01-25 13:54:34 UTC
*** Bug 11824 has been marked as a duplicate of this bug. ***
Comment 5 Michael Kay 2011-01-26 18:45:42 UTC
The original design of the test suite seems to have been that if a test depends on an optional feature, then it should go in a test group (in the catalog) whose name implies a dependency on that feature. However, there doesn't seem to be a section of the catalog for tests that depend on the input document being pre-validated outside the query ("construction from a PSVI" in spec-terminology.) So it's not obvious where one would move these tests to indicate such a dependency.

Some other tests such as Constr-cont-constrmod-2 simply give two alternative results, one for validated input and one for unvalidated. Since there is no indication of the relationship of test results to processor features, this is a very unsatisfactory resolution.

In the XQuery Update tests we have moved in the direction of having the metadata for a test group describe its dependencies on optional features. For example:

            <GroupInfo>
               <title>Revalidation Declaration = strict</title>
               <description/>
               <depends-on>
                  <feature supported="true">revalidation:strict</feature>
                  <description>These tests are designed to be run by a product  that supports
                     revalidation mode strict</description>
                  <spec-citation spec="XQUPDATE" section-number="2.2.1"
                     section-title="Revalidation Declaration"
                     section-pointer="id-revalidation-declaration"/>
               </depends-on>
            </GroupInfo>

I think this is the right strategic direction: we should put these tests in a group and label it

<depends-on>
  <feature supported="true">input-construction:PSVI</feature>
</depends-on>

and if appropriate, include another copy of the test with

<depends-on>
  <feature supported="true">input-construction:infoset</feature>
</depends-on>

and a different expected result.
Comment 6 Michael Kay 2011-02-15 14:48:17 UTC
The source document "atomic.xml" is used by the following tests:


fn-union-node-args-015 to 022
fn-intersect-node-args-015 to 022
fn-except-node-args-015 to 021

Constr-cont-constrmod-1 to 8
Constr-cont-nsmode-5 to 10
Constr-compelem-compname-8
Constr-compattr-compname-8
Constr-docnode-constrmod-1 to 4
Constr-comppi-compname-8 to 9
Constr-compelem-constrmod-1, 2, 5, 6

casthcds1 to 42
schema-import-4 to 31

The first three groups don't seem to care whether the input is typed or untyped, the result will be the same either way.

The last two groups are positioned within the SchemaImport part of the test group hierarchy.

So the problems are confined to the (appallingly named) Constr- groups.

Some of these appear to have alternate results. In some cases the alternate results appear to be tagged 'input-document="typed"' or 'input-document="untyped"' In fact, the only tests that use this attribute are

Constr-cont-constrmod-4
Constr-cont-constrmod-8
Constr-cont-nsmode-5
Constr-cont-nsmode-6
Constr-cont-nsmode-7
Constr-cont-nsmode-8
Constr-compelem-constrmod-8

which is (almost) a subset of the tests listed above.

The following query retrieves all tests whose source documents have a schema:

declare namespace c='http://www.w3.org/2005/02/query-test-XQTSCatalog';
//c:test-case[c:input-file=/*/c:sources/c:source[@schema]/@ID]/<t group='{string-join(ancestor::c:test-group/c:GroupInfo/c:title, '/')}' file='{string(c:input-file)}'>{@name}</t>

Most of these, but by no means all, are in the "Optional Features" part of the catalog. Among those in the Minimal Conformance section are ForExprTypeNNN and orderByNNN (source document orderData), LocalNameFromQNameFuncNNN and namespaceURIFromQNameFuncNNN (source document QNameSource), and the three CatalogNNN tests.

The ForExprTypeNNN tests have been split into two groups: where the results depend on schema validation they have been moved into the "Schema Import" group (even if they do not import a schema); in other cases they have been left in the "Minimal Conformance" group.

For the NamespaceURIFromQName and LocalNameFromQName tests, a different strategy has been employed again: although these tests were clearly originally written to use typed input, they have been modified to cast the typed input to a string so that they no longer depend on schema validation (and, as a side-effect, no longer test what they were designed to test).

Proposal: follow the crowd. In future, tests that depend on schema-validating the input should go in the "Schema Import" group. Tests that currently have two results for the two cases should be split into two tests. Scrap the almost-unused @input-document='typed|untyped' attribute which appears to have been an earlier attempt to solve this problem.
Comment 7 O'Neil Delpratt 2016-04-12 14:36:57 UTC
I am marking this bug as resolved as it is not relevant in the QT3 as the classification is done in a  different way.