Skip to content

Test Case ad-as.b.1 Fails Incorrectly #1248

@mpleic

Description

@mpleic

Hi,

I found an issue with test case ad-as.b.1 that fails even though the data is correct.

Problem

Test case ad-as.b.1: An address shall have an admin unit address component spatial object whose level is 1 (Country) fails when validating GML data that correctly contains AdminUnitName components with level 1stOrder (Country).

What's happening

In the test case (line 358 in ets-ad-as-bsxets.xml), the XPath expression uses:

if ($element/ad3:level/text()='1stOrder' or $element/ad:level/@xlink:href='http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/1stOrder') then

The main problems are:

  1. Incorrect namespace prefix: It uses ad3:level but the GML uses ad:level (the ad3: prefix doesn't match the actual namespace prefix in the GML data)
  2. Incorrect value check: It looks for text content in the level element (/text()='1stOrder'), but level is of type gml:ReferenceType which cannot have textual content according to the schema. The value should be checked via the xlink:href attribute only, which contains the unique identifier URI (http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/1stOrder)

Example data

In the attached ZIP file, you'll find XML files:

  • ad_Address.xml - contains Address objects with component references
  • ad_AdminUnitName.xml - contains AdminUnitName objects with level elements

Example Address object:

<ad:Address gml:id="Address.2178420683">
    ...
    <ad:component xlink:href="#AdminUnitName.2183871399"/>
    ...
</ad:Address>

Example AdminUnitName object with level 1stOrder:

<ad:AdminUnitName gml:id="AdminUnitName.2183871399">
    ...
    <ad:level xlink:href="http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/1stOrder" xlink:title="1stOrder"/>
    ...
</ad:AdminUnitName>

Where:

  • ad: = http://inspire.ec.europa.eu/schemas/ad/4.0 (Addresses namespace)
  • xlink: = http://www.w3.org/1999/xlink (XLink namespace)

Recommended solution

The XPath expression should:

  1. Use the correct namespace prefix (ad: instead of ad3:)
  2. Check the xlink:href attribute as the primary way to identify the level value (since level is ReferenceType and cannot have textual content)
if ($element/ad:level/@xlink:href='http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/1stOrder') then

The xlink:href URI is the unique identifier for the level value and should be the primary check, not text content or xlink:title.

Additional information

  • We're also attaching the validation test report for reference
  • All other test cases in the same test suite pass correctly

Attachments

INSPIRE_Internal_WFS_AD_ad.zip
INSPIRE_Internal_WFS_AD_ad_GML.html

Thanks for looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    user-fixedProblem solved on user side

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions