Skip to content

Commit

Permalink
Merge pull request #836 from inspire-eu-validation/issue-1050
Browse files Browse the repository at this point in the history
lc-ia.b.2 added
  • Loading branch information
jenriquesoriano authored May 9, 2024
2 parents fb9aace + b019e8d commit 4d16fab
Showing 1 changed file with 68 additions and 3 deletions.
71 changes: 68 additions & 3 deletions data-lc/lc-ia/ets-lc-ia-bsxets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Pre-requisite conformance classes:
<ul><li><a href="http://inspire.ec.europa.eu/id/ats/data/master/information-accessibility" target="_blank">Conformance Class 'Information accessibility'</a></li>
</ul>]]></description>
<reference>../../inspire-noggeo-bsxets.xq</reference>
<version>0.1.1</version>
<version>0.1.2</version>
<author>Consortium Bilbomatica, Guadaltel y Geograma</author>
<creationDate>2020-11-04T14:45:00Z</creationDate>
<lastEditor>Consortium Bilbomatica, Guadaltel y Geograma</lastEditor>
<lastUpdateDate>2023-06-19T09:50:00Z</lastUpdateDate>
<lastEditor>Consortium Bilbomatica y Guadaltel</lastEditor>
<lastUpdateDate>2024-04-04T13:00:00Z</lastUpdateDate>
<tags>
<tag ref="EID320f0a12-0155-4a95-b331-cbfc501482d5"/>
</tags>
Expand Down Expand Up @@ -312,6 +312,71 @@ let $messages :=
return
(if ($messages) then 'FAILED' else 'PASSED',
local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
$messages)
</expression>
<testItemType ref="EIDf0edc596-49d2-48d6-a1a1-1ac581dcde0a"/>
<translationTemplates>
<translationTemplate ref="TR.missingElementLandCover"/>
<translationTemplate ref="TR.brokenLinkLandCover"/>
<translationTemplate ref="TR.missingReferencedElementLandCover"/>
</translationTemplates>
</TestAssertion>
<TestAssertion id="EIDcca07df0-7438-4ee1-a502-6079e93e2f2f">
<label>lc-ia.b.2: LandCoverUnit.dataset</label>
<description><![CDATA[Verify that any feature reference in an association role is publicly accessible via HTTP, i.e. inspect all relevant properties. If a reference (@xlink:href) has a value that starts with "#", verify that an element with a `gml:id` attribute with the referenced identifier exists in the same document. If the reference starts with "http", verify that a HTTP GET request to the URI retrieves an XML document.<br/><br/>
Relevant requirements:
<ul>
<li>IR Requirement Article 4 (2): Types for the Exchange and Classification of Spatial Objects. Spatial object types and data types shall comply with the definitions and constraints and include the attributes and association roles set out in the Annexes.</li>
</ul>
Source: <a href="http://inspire.ec.europa.eu/id/ats/data-lc/master/lc-ia/features" target="_blank">Abstract Test Case 'Feature references'</a>, <a href="http://inspire.ec.europa.eu/documents/Data_Specifications/INSPIRE_DataSpecification_LC_v3.0.pdf">INSPIRE Data Specification on Land Cover, A.1.4</a>]]></description>
<parent ref="EID003a4675-bdea-4321-8814-eda2c10636d2"/>
<expectedResult>NOT_APPLICABLE</expectedResult>
<expression>

let $features_selected := $features[self::lcv:LandCoverUnit]
let $gml_ids := $features//@gml:id
let $property_string := 'LandCoverUnit.dataset'
let $messages :=
for $feature in $features_selected
let $envDom := $feature/lcv:dataset
let $urls :=
for $x in $envDom/@xlink:href
return
if (starts-with($x, '#')) then
()
else
$x
let $map := local:check-resource-uris($urls, 30, true())
let $invalid_urls :=
for $href in $urls
let $url := string($href)
let $validuri := map:get($map, $url)
return
if ($validuri = 'notHTTP' or starts-with($validuri, 'EXCEPTION') or $validuri = 'idNotFound' or matches($validuri,'^\d{3}$')) then
$url
else ()
let $invalid_element_reference :=
for $x in $envDom/@xlink:href
return
if (starts-with($x, '#')) then
if (not(substring($x, 2) = $gml_ids)) then
$x
else ()
else ()

return
if (not(exists($feature/lcv:dataset))) then
local:addMessage('TR.missingElementLandCover', map {'filename': local:filename($feature), 'featureType':local-name($feature), 'gmlid': string($feature/@*:id), 'property': $property_string})
else if (count($feature/lcv:dataset) > 1) then
local:addMessage('TR.wrongMultiplicityLandCover', map {'filename': local:filename($feature), 'featureType':local-name($feature), 'gmlid': string($feature/@*:id), 'property': $property_string, 'multiplicity': 1, 'count': count($feature/lcv:dataset)})
else if(count($invalid_urls) > 0) then
local:addMessage('TR.brokenLinkLandCover', map {'filename': local:filename($feature), 'featureType':local-name($feature), 'gmlid': string($feature/@*:id), 'property': $property_string, 'value': string-join($invalid_urls, ',')})
else if (count($invalid_element_reference) > 0) then
local:addMessage('TR.missingReferencedElementLandCover', map {'filename': local:filename($feature), 'featureType':local-name($feature), 'gmlid': string($feature/@*:id), 'property': $property_string, 'value': string-join($invalid_element_reference, ',')})
else ()
return
(if ($messages) then 'FAILED' else 'PASSED',
local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
$messages)
</expression>
<testItemType ref="EIDf0edc596-49d2-48d6-a1a1-1ac581dcde0a"/>
Expand Down

0 comments on commit 4d16fab

Please sign in to comment.