Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lc-ia.b.2 added #829

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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