etfwebapp-report-1E24890D-25F4-4608-8969-24C54ED9BB66.html

Stijn Goedertier, 04 Dec 2019 08:21 am

Download (230 KB)

 
1
<!DOCTYPE html
2
  SYSTEM "about:legacy-compat">
3
<html lang="&#xA;&#x9;&#x9;ETF Test Report&#xA;&#x9;&#x9;test report&#xA;&#x9;&#x9;Report URI&#xA;&#x9;&#x9;Link&#xA;&#x9;&#x9;Test Step URI&#xA;&#x9;&#x9;Link&#xA;&#x9;&#x9;Assertion URI&#xA;&#x9;&#x9;Link&#xA;&#x9;&#x9;Created&#xA;&#x9;&#x9;Test machine&#xA;&#x9;&#x9;Account&#xA;&#x9;&#x9;Report completed&#xA;&#x9;&#x9;Report version&#xA;&#x9;&#x9;&#xA;&#x9;&#x9;Description&#xA;&#x9;&#x9;Short description&#xA;&#x9;&#x9;Detailed description&#xA;&#x9;&#x9;Author&#xA;&#x9;&#x9;Date created&#xA;&#x9;&#x9;Last editor&#xA;&#x9;&#x9;Last updated&#xA;&#x9;&#x9;Duration&#xA;&#x9;&#x9;Started&#xA;&#x9;&#x9;Resource&#xA;&#x9;&#x9;Specification reference&#xA;&#x9;&#x9;Reference&#xA;&#x9;&#x9;Version&#xA;&#x9;&#x9;Size&#xA;&#x9;&#x9;Size in bytes&#xA;&#x9;&#x9;Hash&#xA;&#x9;&#x9;Uploaded&#xA;&#x9;&#x9;Files&#xA;&#x9;&#x9;Test suites&#xA;&#x9;&#x9;Test suite&#xA;&#x9;&#x9;Test modules&#xA;&#x9;&#x9;Test module&#xA;&#x9;&#x9;Test cases&#xA;&#x9;&#x9;Test case&#xA;&#x9;&#x9;Test steps&#xA;&#x9;&#x9;Test step&#xA;&#x9;&#x9;Assertions&#xA;&#x9;&#x9;Assertion&#xA;&#x9;&#x9;Assertion type&#xA;&#x9;&#x9;Expression&#xA;&#x9;&#x9;Expected result&#xA;&#x9;&#x9;Label&#xA;&#x9;&#x9;Status&#xA;&#x9;&#x9;Failed&#xA;&#x9;&#x9;Passed&#xA;&#x9;&#x9;Passed, manual checks required&#xA;&#x9;&#x9;Internal error in test engine occured&#xA;&#x9;&#x9;Passed with warnings&#xA;&#x9;&#x9;Passed with notes&#xA;&#x9;&#x9;Skipped&#xA;&#x9;&#x9;Not applicable&#xA;&#x9;&#x9;Undefined&#xA;&#x9;&#x9;Test instruction&#xA;&#x9;&#x9;Total&#xA;&#x9;&#x9;Skipped&#xA;&#x9;&#x9;Failed&#xA;&#x9;&#x9;Warnings&#xA;&#x9;&#x9;Manual&#xA;&#x9;&#x9;Messages&#xA;&#x9;&#x9;Statistics&#xA;&#x9;&#x9;Parameters&#xA;&#x9;&#x9;Test object&#xA;&#x9;&#x9;Associated test object types&#xA;&#x9;&#x9;Dependency&#xA;&#x9;&#x9;Depends on&#xA;&#x9;&#x9;Level of detail&#xA;&#x9;&#x9;All details&#xA;&#x9;&#x9;Less information&#xA;&#x9;&#x9;Simplified&#xA;&#x9;&#x9;Show&#xA;&#x9;&#x9;All&#xA;&#x9;&#x9;Only failed&#xA;&#x9;&#x9;Only manual&#xA;&#x9;&#x9;Feature Type&#xA;&#x9;&#x9;Feature Count&#xA;&#x9;&#x9;Type&#xA;&#x9;&#x9;Count&#xA;&#x9;&#x9;Log path&#xA;&#x9;&#x9;Log URI&#xA;&#x9;&#x9;Link&#xA;&#x9;&#x9;Open in new tab&#xA;&#x9;" class="ui-mobile ui-mobile-rendering">
4
   <head>
5
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6
      <meta http-equiv="X-UA-Compatible" content="IE=Edge">
7
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
      <meta name="web_author" content="interactive instruments GmbH">
9
      <title>ETF Test Report</title>
10
      <link rel="stylesheet" href="https://resources.etf-validator.net/report/v2/css/de.interactive-instruments.min.css?v2">
11
      <link rel="stylesheet" href="https://resources.etf-validator.net/report/v2/css/de.interactive-instruments.rep.css?v2">
12
      <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css"><script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.3.min.js" integrity="sha256-rsPUGdUPBXgalvIj4YKJrrUlmLXbOb6Cp7cdxn1qeUc=" crossorigin="anonymous"></script><script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js" integrity="sha256-MkfSkbXhZoQ1CyPwjC30mPfLF8iKF5n564n9WvCLX4E=" crossorigin="anonymous"></script></head>
13
   <body class="ui-mobile-viewport ui-overlay-a">
14
      <div data-role="header">
15
         <h1>LU - INSPIRE - Annex III Theme Natural Risk Zones - Floodplain 1983 Mosel - 20191203233000</h1><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/#test-reports" data-ajax="false" data-icon="back" data-iconpos="notext"></a></div>
16
      <div data-role="content">
17
         <div class="ui-grid-b">
18
            <div class="ui-block-a">
19
               <div id="rprtInfo">
20
                  <table>
21
                     <tbody>
22
                        <tr class="ReportDetail">
23
                           <td>Report URI</td>
24
                           <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en" data-ajax="false">Link</a></td>
25
                        </tr>
26
                        <tr>
27
                           <td>Status</td>
28
                           <td>Passed</td>
29
                        </tr>
30
                        <tr>
31
                           <td>Started</td>
32
                           <td>03/12/2019 22:32:38 GMT</td>
33
                        </tr>
34
                        <tr>
35
                           <td>Duration</td>
36
                           <td>47 s</td>
37
                        </tr>
38
                        <tr class="ReportDetail">
39
                           <td>Report version</td>
40
                           <td>2.1.0-b181101</td>
41
                        </tr>
42
                        <tr class="ReportDetail">
43
                           <td>Log URI</td>
44
                           <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/af4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be/log" data-ajax="false">Link</a></td>
45
                        </tr>
46
                     </tbody>
47
                  </table>
48
               </div>
49
            </div>
50
            <div class="ui-block-b">
51
               <div id="rprtStatistics">
52
                  <table id="my-table">
53
                     <thead>
54
                        <tr>
55
                           <th></th>
56
                           <th>Total Count</th>
57
                           <th>Skipped</th>
58
                           <th>Failed</th>
59
                           <th>Warnings</th>
60
                           <th>Manual</th>
61
                        </tr>
62
                     </thead>
63
                     <tbody>
64
                        <tr>
65
                           <td>Test suites</td>
66
                           <td>4</td>
67
                           <td>0</td>
68
                           <td>0</td>
69
                           <td>0</td>
70
                           <td>0</td>
71
                        </tr>
72
                        <tr>
73
                           <td>Test cases</td>
74
                           <td>11</td>
75
                           <td>0</td>
76
                           <td>0</td>
77
                           <td>0</td>
78
                           <td>0</td>
79
                        </tr>
80
                        <tr>
81
                           <td>Assertions</td>
82
                           <td>40</td>
83
                           <td>0</td>
84
                           <td>0</td>
85
                           <td>0</td>
86
                           <td>0</td>
87
                        </tr>
88
                     </tbody>
89
                  </table>
90
               </div>
91
            </div>
92
            <div class="ui-block-c">
93
               <div id="rprtControl">
94
                  <fieldset id="controlgroupLOD" data-role="controlgroup" data-mini="true">
95
                     <legend>Level of detail</legend><label for="cntrlAllDetails">All details</label><input type="radio" name="radio-lod" id="cntrlAllDetails" value="cntrlAllDetails"><label for="cntrlLessInformation">Less information</label><input type="radio" name="radio-lod" id="cntrlLessInformation" value="cntrlLessInformation"><label for="cntrlSimplified">Simplified</label><input type="radio" name="radio-lod" id="cntrlSimplified" value="cntrlSimplified" checked></fieldset>
96
                  <fieldset id="controlgroupShow" data-role="controlgroup" data-mini="true">
97
                     <legend>Show</legend><label for="cntrlShowAll">All</label><input type="radio" name="radio-filter" id="cntrlShowAll" value="cntrlShowAll" checked><label for="cntrlShowOnlyFailed">Only failed</label><input type="radio" name="radio-filter" id="cntrlShowOnlyFailed" value="cntrlShowOnlyFailed"><label for="cntrlShowOnlyManual">Only manual</label><input type="radio" name="radio-filter" id="cntrlShowOnlyManual" value="cntrlShowOnlyManual"></fieldset>
98
               </div>
99
            </div>
100
         </div>
101
         <div id="rprtParameters" data-role="collapsible" data-collapsed-icon="info" class="ReportDetail">
102
            <h3>Parameters</h3>
103
            <table>
104
               <tbody>
105
                  <tr>
106
                     <td>tests_to_execute</td>
107
                     <td>.*</td>
108
                  </tr>
109
                  <tr>
110
                     <td>files_to_test</td>
111
                     <td>.*</td>
112
                  </tr>
113
               </tbody>
114
            </table>
115
         </div>
116
         <div id="rprtTestobject" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
117
            <h3>Test object: xml.xml</h3>
118
            <p>Web Test Object</p><a target="_blank" href="https://catalog.inspire.geoportail.lu/geonetwork/srv/api/records/1E24890D-25F4-4608-8969-24C54ED9BB66/formatters/xml">https://catalog.inspire.geoportail.lu/geonetwork/srv/api/records/1E24890D-25F4-4608-8969-24C54ED9BB66/formatters/xml</a><p>Files: 1</p>
119
            <p>Size: 25 KB</p>
120
            <p>Associated test object types: </p>
121
            <ul>
122
               <li>Metadata records  (A set of XML documents. Each document contains one or more gmd:MD_Metadata elements.)</li>
123
            </ul>
124
         </div>
125
         <div id="rprtStatReport" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
126
            <h3>Metadata record statistics</h3>
127
            <table>
128
               <tbody>
129
                  <tr>
130
                     <th>Type</th>
131
                     <th>Total Count</th>
132
                  </tr>
133
                  <tr>
134
                     <td>all</td>
135
                     <td>1</td>
136
                  </tr>
137
                  <tr>
138
                     <td>dataset</td>
139
                     <td>1</td>
140
                  </tr>
141
               </tbody>
142
            </table>
143
         </div>
144
         <div id="rprtLogFile" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
145
            <h3>Log path: Common Requirements for ISO/TC 19139:2007 based INSPIRE metadata records.</h3>
146
            <pre>Testing 1 records
147
Executing Test Suite: /etf/projects/inspire-ets-repository/ets-repository-staging/metadata/2.0/common/ets-md-common-bsxets.xml
148
Statistics table: 0 ms
149
Test Suite 'Common Requirements for ISO/TC 19139:2007 based INSPIRE metadata records.' started
150
Test Case 'General requirements' started
151
Test Assertion 'md common req C.1: XML Schema': PASSED - 21879 ms
152
Test Assertion 'md common req C.2: Root Element': PASSED - 0 ms
153
Test Assertion 'md common req C.5: Language Code': PASSED - 0 ms
154
Test Assertion 'md common req C.6: Metadata Point of Contact': PASSED - 0 ms
155
Test Assertion 'md common req C.7: Metadata Date': PASSED - 0 ms
156
Test Case 'General requirements' finished: PASSED
157
Test Case 'Identification' started
158
Test Assertion 'md common req C.8: Resource Title': PASSED - 1 ms
159
Test Assertion 'md common req C.9: Resource Abstract': PASSED - 0 ms
160
Email Char: 1
161
Email Anch: 0
162
Test Assertion 'md common req C.10: Responsible Organization': PASSED - 0 ms
163
Test Assertion 'md common req C.11: Temporal Reference': PASSED - 0 ms
164
Test Assertion 'md common req C.12: Max One Date of Creation': PASSED - 0 ms
165
Test Assertion 'md common req C.13: Not More than one Date of Last Revision': PASSED - 0 ms
166
Test Assertion 'md common req C.14: Temporal Extent': PASSED - 0 ms
167
Test Assertion 'md common req C.15: Keyword Originating CV': PASSED - 0 ms
168
Test Assertion 'md common req C.16: Group Keywords by CV': PASSED - 0 ms
169
Test Assertion 'md common req C.17: Limitations on Public Access': PASSED - 0 ms
170
Test Assertion 'md common req C.18: Conditions for Access and Use': PASSED - 0 ms
171
Test Assertion 'md common req C.19: Geographical Bounding Box': PASSED - 0 ms
172
Test Case 'Identification' finished: PASSED
173
Test Case 'Data quality' started
174
Test Assertion 'md common req C.20: Dataset Conformity': PASSED - 0 ms
175
Test Assertion 'md common req C.21: Dataset Conformity Specifications': PASSED - 0 ms
176
Test Assertion 'md common req C.22: Conformity Degree': PASSED - 0 ms
177
Test Case 'Data quality' finished: PASSED
178
Test Suite 'Common Requirements for ISO/TC 19139:2007 based INSPIRE metadata records.' finished: PASSED
179
</pre>
180
         </div>
181
         <div id="rprtLogFile" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
182
            <h3>Log path: Conformance Class 1: INSPIRE data sets and data set series baseline metadata.</h3>
183
            <pre>Testing 1 records
184
Executing Test Suite: /etf/projects/inspire-ets-repository/ets-repository-staging/metadata/2.0/datasets-and-series/ets-md-datasets-and-series-bsxets.xml
185
Statistics table: 0 ms
186
Test Suite 'Conformance Class 1: INSPIRE data sets and data set series baseline metadata.' started
187
Test Case 'General Metadata' started
188
Test Assertion 'md datasets-and-series 1.1: Resource Type': PASSED - 0 ms
189
Test Case 'General Metadata' finished: PASSED
190
Test Case 'Identification' started
191
Test Assertion 'md datasets-and-series 1.2: Only One Data Identification': PASSED - 0 ms
192
Test Assertion 'md datasets-and-series 1.3: Dataset UID': PASSED - 1 ms
193
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.bg.atom'
194
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.cs.atom'
195
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.da.atom'
196
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.de.atom'
197
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.et.atom'
198
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.el.atom'
199
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.en.atom'
200
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.es.atom'
201
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.fr.atom'
202
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.hr.atom'
203
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.it.atom'
204
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.lv.atom'
205
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.lt.atom'
206
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.hu.atom'
207
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.mt.atom'
208
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.nl.atom'
209
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.pl.atom'
210
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.pt.atom'
211
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.ro.atom'
212
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.sk.atom'
213
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.sl.atom'
214
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.fi.atom'
215
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.sv.atom'
216
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.en.atom'
217
Test Assertion 'md datasets-and-series 1.4: INSPIRE Theme Keyword': PASSED - 2631 ms
218
Test Assertion 'md datasets-and-series 1.5: Spatial Resolution': PASSED - 0 ms
219
Test Assertion 'md datasets-and-series 1.6: Resource Language': PASSED - 0 ms
220
Test Assertion 'md datasets-and-series 1.7: Topic Category': PASSED - 0 ms
221
Test Case 'Identification' finished: PASSED
222
Test Case 'Distribution' started
223
Test Assertion 'md datasets-and-series 1.8: Resource Locator': PASSED - 0 ms
224
Test Assertion 'md datasets-and-series 1.9: Data Quality Info Section': PASSED - 0 ms
225
Test Assertion 'md datasets-and-series 1.10: Dataset Conformity': PASSED - 1564 ms
226
Test Assertion 'md datasets-and-series 1.11: Lineage': PASSED - 0 ms
227
Test Case 'Distribution' finished: PASSED
228
Test Suite 'Conformance Class 1: INSPIRE data sets and data set series baseline metadata.' finished: PASSED
229
</pre>
230
         </div>
231
         <div id="rprtLogFile" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
232
            <h3>Log path: Conformance Class 2: INSPIRE data sets and data set series interoperability metadata.</h3>
233
            <pre>Testing 1 records
234
Executing Test Suite: /etf/projects/inspire-ets-repository/ets-repository-staging/metadata/2.0/datasets-and-series/ets-md-isdss-bsxets.xml
235
Statistics table: 0 ms
236
Test Suite 'Conformance Class 2: INSPIRE data sets and data set series interoperability metadata.' started
237
Test Case 'General Metadata' started
238
Test Assertion 'md isdss 2.1: Coordinate Reference System': PASSED - 0 ms
239
Test Assertion 'md isdss 2.2: Coordinate Reference System Identifiers': PASSED - 0 ms
240
Test Assertion 'md isdss 2.3: Temporal Reference Systems': PASSED - 0 ms
241
Test Case 'General Metadata' finished: PASSED
242
Test Case 'Identification' started
243
Test Assertion 'md isdss 2.4: Spatial Representation Type': PASSED - 0 ms
244
Test Assertion 'md isdss 2.5: Character Encoding': PASSED - 0 ms
245
Test Case 'Identification' finished: PASSED
246
Test Case 'Distribution' started
247
Test Assertion 'md isdss 2.6: Data Encoding': PASSED - 1 ms
248
Test Case 'Distribution' finished: PASSED
249
Test Case 'Data Quality' started
250
Test Assertion 'md isdss 2.7: Topological Consistency Quantitative Results': PASSED - 0 ms
251
Test Assertion 'md isdss 2.8: Topological Consistency Descriptive Results': PASSED - 0 ms
252
Test Case 'Data Quality' finished: PASSED
253
Test Suite 'Conformance Class 2: INSPIRE data sets and data set series interoperability metadata.' finished: PASSED
254
</pre>
255
         </div>
256
         <div id="rprtLogFile" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
257
            <h3>Log path: Conformance class: XML encoding of ISO 19115/19119 metadata</h3>
258
            <pre>Testing 1 records
259
Executing Test Suite: /etf/projects/inspire-ets-repository/ets-repository-staging/metadata/1.3/xml/ets-md-xml-bsxets.xml
260
Statistics table: 0 ms
261
Test Suite 'Conformance class: XML encoding of ISO 19115/19119 metadata' started
262
Test Case 'Schema validation' started
263
Test Assertion 'md-xml.a.1: Validate XML documents': PASSED - 21572 ms
264
Test Case 'Schema validation' finished: PASSED
265
Test Suite 'Conformance class: XML encoding of ISO 19115/19119 metadata' finished: PASSED
266
</pre>
267
         </div>
268
         <div class="TestSuite" data-role="collapsible" data-theme="h" data-content-theme="h">
269
            <h2>Common Requirements for ISO/TC 19139:2007 based INSPIRE metadata records.
270
               <div class="ui-li-count">3</div>
271
            </h2><br/><br/><b>This is a draft version. It has limitations and is expected to contain errors.</b> Please report any issues or problems <a href="https://github.com/inspire-eu-validation/community/wiki/Your-feedback" target="_blank">in GitHub</a>.<br/><br/>
272
Known limitations are documented in the description of the applicable test case or test assertion.<br/><br/>
273
There is a general limitation in all assertions that polymorphism and containment by reference (see the <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/README#ref_TG_MD" target="_blank">Technical Guidance</a>, sub-clauses A.3, A.4 and A.5) are not supported. However, the current Abstract Test Suite does not support polymorphism and references either (all XPath expressions do not support polymorhism or references; in addition, schema validation is only executed against the ISO/OGC schemas without extensions). It is therefore unclear if this is really a limitation or if the sections in the technical guidance are outdated.
274
<br/><br/>
275
Source: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common" target="_blank">Common Requirements for ISO/TC 19139:2007 based INSPIRE metadata records</a><br/><br/><br><br><table>
276
               <tbody>
277
                  <tr>
278
                     <td>Status</td>
279
                     <td>Passed</td>
280
                  </tr>
281
                  <tr>
282
                     <td>Duration</td>
283
                     <td>21 s</td>
284
                  </tr>
285
                  <tr class="ReportDetail">
286
                     <td>Test suite ID</td>
287
                     <td>EID59692c11-df86-49ad-be7f-94a1e1ddd8da</td>
288
                  </tr>
289
                  <tr class="ReportDetail">
290
                     <td>Author</td>
291
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
292
                  </tr>
293
                  <tr class="ReportDetail">
294
                     <td>Date created</td>
295
                     <td>30/06/2018 00:00:00 GMT</td>
296
                  </tr>
297
                  <tr>
298
                     <td>Version</td>
299
                     <td>0.1.1</td>
300
                  </tr>
301
                  <tr class="ReportDetail">
302
                     <td>Last editor</td>
303
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
304
                  </tr>
305
                  <tr class="ReportDetail">
306
                     <td>Last updated</td>
307
                     <td>16/05/2019 11:40:00 GMT</td>
308
                  </tr>
309
                  <tr class="ReportDetail">
310
                     <td>Reference</td>
311
                     <td><a class="ui-link" href="https://github.com/inspire-eu-validation/ets-repository/tree/master/metadata/2.0">Link</a></td>
312
                  </tr>
313
                  <tr class="ReportDetail">
314
                     <td>Hash</td>
315
                     <td>CBF29CE484222325</td>
316
                  </tr>
317
               </tbody>
318
            </table><br><div class="TestModulePlaceHolder">
319
               <div data-role="collapsible" data-enhanced="true" id="EID61e7ffc0-c181-11e8-a355-529269fb1459" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
320
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">General requirements
321
                        <div class="ui-li-count">5</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
322
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Execute tests that apply for all metadata records on elements that are directly child elements of the root node of the XML document: MD_Metadata node.<br><br><table>
323
                        <tbody>
324
                           <tr>
325
                              <td>Status</td>
326
                              <td>Passed</td>
327
                           </tr>
328
                           <tr>
329
                              <td>Duration</td>
330
                              <td>21 s</td>
331
                           </tr>
332
                           <tr class="ReportDetail">
333
                              <td>Test case ID</td>
334
                              <td>EID61e7ffc0-c181-11e8-a355-529269fb1459</td>
335
                           </tr>
336
                        </tbody>
337
                     </table><br><div class="TestStepPlaceHolder">
338
                        <div data-role="collapsible" data-enhanced="true" id="EID7b7ae86c-9401-4789-9203-60d4c5683b24" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
339
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.1: XML Schema<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
340
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Performs a schema validation of the document.</p>
341
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/xml-schema" target="_blank">XML Schema</a></p><br><br><table>
342
                                 <tbody>
343
                                    <tr>
344
                                       <td>Status</td>
345
                                       <td>Passed</td>
346
                                    </tr>
347
                                    <tr>
348
                                       <td>Duration</td>
349
                                       <td>21 s</td>
350
                                    </tr>
351
                                    <tr class="ReportDetail">
352
                                       <td>Assertion ID</td>
353
                                       <td>EID7c93c4d2-3942-4eb4-b5d3-4735d40262d8</td>
354
                                    </tr>
355
                                    <tr class="DoNotShowInSimpleView">
356
                                       <td>Assertion URI</td>
357
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID7b7ae86c-9401-4789-9203-60d4c5683b24" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID7b7ae86c-9401-4789-9203-60d4c5683b24'); return false;">Link</a></td>
358
                                    </tr>
359
                                 </tbody>
360
                              </table><br><div class="ReportDetail Expression"><label for="EID7b7ae86c-9401-4789-9203-60d4c5683b24.expression">Expression:</label><textarea id="EID7b7ae86c-9401-4789-9203-60d4c5683b24.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=    
361
                                                                                (for $record in $records
362
                                                                                let $rid := $record/gmd:fileIdentifier/*/text()
363
                                                                                let $result_0 := try{ validate:xsd($record, 'https://inspire.ec.europa.eu/draft-schemas/inspire-md-schemas-temp/apiso-inspire/apiso-inspire.xsd') } catch * {  $err:description }
364
                                                                                let $result_1 := try{ 
365
                                                                                        if (not(string-length($result_0) = 0)) then validate:xsd($record, 'http://www.isotc211.org/2005/gmd/gmd.xsd')
366
                                                                                        else ()
367
                                                                                } catch * {  $err:description }
368
                                                                                let $result_2 := try{
369
                                                                                        if (not(string-length($result_0) = 0 and string-length($result_1) = 0)) then validate:xsd($record, 'http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd')
370
                                                                                        else ()
371
                                                                                } catch * { $err:description }
372
                                                                                return
373
                                                                                if(not(string-length($result_0) = 0 or string-length($result_1) = 0 or string-length($result_2) = 0)) then
374
                                                                                        local:addMessage('TR.errorValidatingSchema',  map { 'filename': local:filename($record), 'id': $rid, 'description': concat($result_0, $result_1, $result_2) })
375
                                                                                else ()
376
                                                                                )[position() le $limitErrors]
377
                                                                        return
378
                                                                        (if ($messages) then 'FAILED' else 'PASSED',
379
                                                                         local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
380
                                                                         $messages)</textarea></div>
381
                           </div>
382
                        </div>
383
                        <div data-role="collapsible" data-enhanced="true" id="EIDa99266a2-9145-46bb-b747-b1c99b3501e4" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
384
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.2: Root Element<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
385
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the specification of a metadata is encoded through a root element MD_Metadata.</p>
386
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/root-element" target="_blank">Root Element</a></p><br><br><table>
387
                                 <tbody>
388
                                    <tr>
389
                                       <td>Status</td>
390
                                       <td>Passed</td>
391
                                    </tr>
392
                                    <tr>
393
                                       <td>Duration</td>
394
                                       <td>0.001 s</td>
395
                                    </tr>
396
                                    <tr class="ReportDetail">
397
                                       <td>Assertion ID</td>
398
                                       <td>EIDba885e87-dfec-4206-9a94-5620af734d44</td>
399
                                    </tr>
400
                                    <tr class="DoNotShowInSimpleView">
401
                                       <td>Assertion URI</td>
402
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDa99266a2-9145-46bb-b747-b1c99b3501e4" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDa99266a2-9145-46bb-b747-b1c99b3501e4'); return false;">Link</a></td>
403
                                    </tr>
404
                                 </tbody>
405
                              </table><br><div class="ReportDetail Expression"><label for="EIDa99266a2-9145-46bb-b747-b1c99b3501e4.expression">Expression:</label><textarea id="EIDa99266a2-9145-46bb-b747-b1c99b3501e4.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=
406
                                                                                (for $record in $records
407
                                                                                let $rid := $record/gmd:fileIdentifier/*/text()
408
                                                                                return
409
                                                                                if(not($record/node-name() = QName('http://www.isotc211.org/2005/gmd','gmd:MD_Metadata'))) then
410
                                                                                        local:addMessage('TR.invalidRootElement',  map { 'filename': local:filename($record), 'id': namespace-uri($record) })
411
                                                                                else ()
412
                                                                                )[position() le $limitErrors]
413
                                                                        return
414
                                                                        (if ($messages) then 'FAILED' else 'PASSED',
415
                                                                         local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
416
                                                                         $messages)</textarea></div>
417
                           </div>
418
                        </div>
419
                        <div data-role="collapsible" data-enhanced="true" id="EIDde4301e6-b051-4fdb-b5d0-b18a68dad1f4" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
420
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.5: Language Code<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
421
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that a resource language is given pointing to one of the official languages of the Community expressed in conformity with ISO 639-2</p>
422
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/metadata-language-code" target="_blank">Metadata Language</a></p><br><br><table>
423
                                 <tbody>
424
                                    <tr>
425
                                       <td>Status</td>
426
                                       <td>Passed</td>
427
                                    </tr>
428
                                    <tr>
429
                                       <td>Duration</td>
430
                                       <td>0.001 s</td>
431
                                    </tr>
432
                                    <tr class="ReportDetail">
433
                                       <td>Assertion ID</td>
434
                                       <td>EIDebdda4b4-0bb4-4255-a36a-db4fe540065c</td>
435
                                    </tr>
436
                                    <tr class="DoNotShowInSimpleView">
437
                                       <td>Assertion URI</td>
438
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDde4301e6-b051-4fdb-b5d0-b18a68dad1f4" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDde4301e6-b051-4fdb-b5d0-b18a68dad1f4'); return false;">Link</a></td>
439
                                    </tr>
440
                                 </tbody>
441
                              </table><br><div class="ReportDetail Expression"><label for="EIDde4301e6-b051-4fdb-b5d0-b18a68dad1f4.expression">Expression:</label><textarea id="EIDde4301e6-b051-4fdb-b5d0-b18a68dad1f4.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $recordsToInspect := $records[gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = ('dataset','series','service')]
442
                                                                        let $codes := ('bul', 'hrv', 'cze', 'dan', 'dut', 'eng', 'est', 'fin', 'fre', 'ger', 'gre', 'hun', 'gle', 'ita', 'lav', 'lit', 'mlt', 'pol', 'por', 'rum', 'slo', 'slv', 'spa', 'swe')
443
                                                                        let $messages :=    
444
                                                                                if (not($recordsToInspect)) then ()
445
                                                                                else
446
                                                                                (for $record in $recordsToInspect    
447
                                                                                let $rid := $record/gmd:fileIdentifier/*/text()
448
                                                                                let $languageCodes := $record/gmd:language/gmd:LanguageCode         
449
                                                                                return
450
                                                                                if (not($languageCodes)) then
451
                                                                                        local:addMessage('TR.noLanguageCode',  map { 'filename': local:filename($record), 'id': $rid })
452
                                                                                else if (count($languageCodes) != 1) then
453
                                                                                        local:addMessage('TR.wrongLanguageCodeNumber',  map { 'filename': local:filename($record), 'id': $rid })
454
                                                                                else if ($languageCodes/@codeList != 'http://www.loc.gov/standards/iso639-2/' and $languageCodes/@codeList != 'http://www.loc.gov/standards/iso639-2') then
455
                                                                                        local:addMessage('TR.wrongCodeList_Param',  map { 'filename': local:filename($record), 'id': $rid, 'param': 'http://www.loc.gov/standards/iso639-2/ or http://www.loc.gov/standards/iso639-2'})
456
                                                                                else if ($languageCodes/@codeListValue[not(. = $codes)]) then
457
                                                                                        local:addMessage('TR.invalidLanguageCode',  map { 'filename': local:filename($record), 'id': $rid, 'invalidCodes' : $languageCodes/@codeListValue/string()})
458
                                                                                else ()
459
                                                                                )[position() le $limitErrors]
460
                                                                        return
461
                                                                        (if ($messages) then 'FAILED' else 'PASSED',
462
                                                                         local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
463
                                                                         $messages)</textarea></div>
464
                           </div>
465
                        </div>
466
                        <div data-role="collapsible" data-enhanced="true" id="EIDee2228ae-6162-4933-b74b-49fe33196add" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
467
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.6: Metadata Point of Contact<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
468
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the description of the organisation responsible for the creation and maintenance of the metadata is provided.</p>
469
                                                                                <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/md-point-of-contact" target="_blank">Metadata Point of Contact</a></p><br><br><table>
470
                                 <tbody>
471
                                    <tr>
472
                                       <td>Status</td>
473
                                       <td>Passed</td>
474
                                    </tr>
475
                                    <tr>
476
                                       <td>Duration</td>
477
                                       <td>0.001 s</td>
478
                                    </tr>
479
                                    <tr class="ReportDetail">
480
                                       <td>Assertion ID</td>
481
                                       <td>EIDead447bf-7ace-4b13-b9b1-a80f8566c9cb</td>
482
                                    </tr>
483
                                    <tr class="DoNotShowInSimpleView">
484
                                       <td>Assertion URI</td>
485
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDee2228ae-6162-4933-b74b-49fe33196add" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDee2228ae-6162-4933-b74b-49fe33196add'); return false;">Link</a></td>
486
                                    </tr>
487
                                 </tbody>
488
                              </table><br><div class="ReportDetail Expression"><label for="EIDee2228ae-6162-4933-b74b-49fe33196add.expression">Expression:</label><textarea id="EIDee2228ae-6162-4933-b74b-49fe33196add.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages := 
489
                (for $record in $records
490
                 let $rid := $record/gmd:fileIdentifier/*/text()
491
                 let $pocs := $record/gmd:contact/gmd:CI_ResponsibleParty
492
                 return
493
                 if(not($pocs)) then 
494
                        local:addMessage('TR.noMetadataContact', map { 'filename': local:filename($record), 'id': $rid })
495
                 else
496
                 for $poc in $pocs
497
                 let $orgName := $poc/gmd:organisationName
498
                 let $email := $poc/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress
499
                 return
500
            if (not($orgName) or not(string-length($orgName/gco:CharacterString/text()) != 0 or string-length($orgName/gmx:Anchor/text()) != 0)) then
501
                                local:addMessage('TR.noMetadataContactOrganisationName', map { 'filename': local:filename($record), 'id': $rid })
502
            else if (not($email) or not(string-length($email/gco:CharacterString/text()) != 0 or string-length($email/gmx:Anchor/text()) != 0)) then 
503
                                local:addMessage('TR.noMetadataContactEmailAddress', map { 'filename': local:filename($record), 'id': $rid })
504
                         else if (not($poc/gmd:role) or not($poc/gmd:role/gmd:CI_RoleCode/@codeListValue = 'pointOfContact')) then
505
                                local:addMessage('TR.noMetadataContactRole', map { 'filename': local:filename($record), 'id': $rid, 'pocs': fn:string-join($pocs/gmd:role/*/@codeListValue) })
506
                         else ()
507
                )[position() le $limitErrors]
508
        return
509
        (if ($messages) then 'FAILED' else 'PASSED',
510
         local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
511
         $messages)</textarea></div>
512
                           </div>
513
                        </div>
514
                        <div data-role="collapsible" data-enhanced="true" id="EIDa6610059-9f7a-4ca9-b496-406b79c68fdc" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
515
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.7: Metadata Date<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
516
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the document indicates the date when the metadata record was created or updated.</p>
517
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/md-date" target="_blank">Metadata Date</a></p><br><br><table>
518
                                 <tbody>
519
                                    <tr>
520
                                       <td>Status</td>
521
                                       <td>Passed</td>
522
                                    </tr>
523
                                    <tr>
524
                                       <td>Duration</td>
525
                                       <td>0.001 s</td>
526
                                    </tr>
527
                                    <tr class="ReportDetail">
528
                                       <td>Assertion ID</td>
529
                                       <td>EID0b6c9678-31d1-4c7a-8183-6a4f4da60017</td>
530
                                    </tr>
531
                                    <tr class="DoNotShowInSimpleView">
532
                                       <td>Assertion URI</td>
533
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDa6610059-9f7a-4ca9-b496-406b79c68fdc" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDa6610059-9f7a-4ca9-b496-406b79c68fdc'); return false;">Link</a></td>
534
                                    </tr>
535
                                 </tbody>
536
                              </table><br><div class="ReportDetail Expression"><label for="EIDa6610059-9f7a-4ca9-b496-406b79c68fdc.expression">Expression:</label><textarea id="EIDa6610059-9f7a-4ca9-b496-406b79c68fdc.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $levels := ('dataset', 'series', 'service')
537
let $recordsToInspect := $records[gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = $levels]
538
let $regex := '^(\d{4})(-(\d{2}))??(-(\d{2}))??(T(\d{2}):(\d{2})(:(\d{2}))??(\.(\d+))??(([\+\-]{1}\d{2}:\d{2})|Z)??)??$'
539
let $messages :=
540
        (for $record in $recordsToInspect
541
        let $rid := $record/gmd:fileIdentifier/*/text()
542
        return
543
                if (count($record/gmd:dateStamp) != 1 or not(count($record/gmd:dateStamp/gco:DateTime) + count($record/gmd:dateStamp/gco:Date) = 1)) then
544
                        local:addMessage('TR.oneDateStamp', map { 'filename': local:filename($record), 'id': $rid })
545
                else if(count($record/gmd:dateStamp/gco:DateTime) = 1) then
546
                        if (not(matches($record/gmd:dateStamp/gco:DateTime, $regex))) then
547
                                local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
548
                        else()
549
                else if(count($record/gmd:dateStamp/gco:Date) = 1) then
550
                        if (not(matches($record/gmd:dateStamp/gco:Date, $regex))) then
551
                                local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
552
                        else()
553
                else ()
554
        )[position() le $limitErrors]
555
return
556
(if ($messages) then 'FAILED' else 'PASSED',
557
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
558
 $messages)</textarea></div>
559
                           </div>
560
                        </div>
561
                     </div>
562
                  </div>
563
               </div>
564
               <div data-role="collapsible" data-enhanced="true" id="EID61e80286-c181-11e8-a355-529269fb1459" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
565
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">Identification
566
                        <div class="ui-li-count">12</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
567
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Execute tests that apply for all metadata records on elements that are child elements of the section of the XML document: Identification Info (property of the gmd:MD_Metadata element). This section contains information specific to the dataset / dataset series.<br><br><table>
568
                        <tbody>
569
                           <tr>
570
                              <td>Status</td>
571
                              <td>Passed</td>
572
                           </tr>
573
                           <tr>
574
                              <td>Duration</td>
575
                              <td>0.001 s</td>
576
                           </tr>
577
                           <tr class="ReportDetail">
578
                              <td>Test case ID</td>
579
                              <td>EID61e80286-c181-11e8-a355-529269fb1459</td>
580
                           </tr>
581
                        </tbody>
582
                     </table><br><div class="TestStepPlaceHolder">
583
                        <div data-role="collapsible" data-enhanced="true" id="EID36bdef21-95be-44f2-8cc7-6fc1dfd548d3" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
584
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.8: Resource Title<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
585
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that a non-empty title of the described data is provided.</p>
586
                                                                <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/resource-title" target="_blank">Resource Title</a></p><br><br><table>
587
                                 <tbody>
588
                                    <tr>
589
                                       <td>Status</td>
590
                                       <td>Passed</td>
591
                                    </tr>
592
                                    <tr>
593
                                       <td>Duration</td>
594
                                       <td>0.001 s</td>
595
                                    </tr>
596
                                    <tr class="ReportDetail">
597
                                       <td>Assertion ID</td>
598
                                       <td>EID34195fe7-0d77-46bb-b74e-489463cadd2f</td>
599
                                    </tr>
600
                                    <tr class="DoNotShowInSimpleView">
601
                                       <td>Assertion URI</td>
602
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID36bdef21-95be-44f2-8cc7-6fc1dfd548d3" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID36bdef21-95be-44f2-8cc7-6fc1dfd548d3'); return false;">Link</a></td>
603
                                    </tr>
604
                                 </tbody>
605
                              </table><br><div class="ReportDetail Expression"><label for="EID36bdef21-95be-44f2-8cc7-6fc1dfd548d3.expression">Expression:</label><textarea id="EID36bdef21-95be-44f2-8cc7-6fc1dfd548d3.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=
606
        (for $record in $records
607
        let $rid := $record/gmd:fileIdentifier/*/text()
608
        let $title := 
609
                if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
610
                        $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:citation/gmd:CI_Citation/gmd:title
611
                else
612
                        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title
613
        let $rid := $record/gmd:fileIdentifier/*/text()
614
        return
615
                if (not($title)) then
616
                        local:addMessage('TR.noTitle', map { 'filename': local:filename($record), 'id': $rid })
617
                else if (count($title) != 1) then
618
                        local:addMessage('TR.noTitle', map { 'filename': local:filename($record), 'id': $rid })
619
        else if (not($title) or not(string-length($title/gco:CharacterString/text()) != 0 or string-length($title/gmx:Anchor/text()) != 0)) then
620
                        local:addMessage('TR.emptyTitle', map { 'filename': local:filename($record), 'id': $rid })
621
                else ()
622
        )[position() le $limitErrors]
623
return
624
(if ($messages) then 'FAILED' else 'PASSED',
625
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
626
 $messages)</textarea></div>
627
                           </div>
628
                        </div>
629
                        <div data-role="collapsible" data-enhanced="true" id="EID85e77870-a833-44f7-8881-d1409275d9ff" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
630
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.9: Resource Abstract<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
631
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that a resource abstract is provided.</p>
632
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/resource-abstract" target="_blank">Resource Abstract</a></p><br><br><table>
633
                                 <tbody>
634
                                    <tr>
635
                                       <td>Status</td>
636
                                       <td>Passed</td>
637
                                    </tr>
638
                                    <tr>
639
                                       <td>Duration</td>
640
                                       <td>0.001 s</td>
641
                                    </tr>
642
                                    <tr class="ReportDetail">
643
                                       <td>Assertion ID</td>
644
                                       <td>EID346ca433-1f21-4e4e-8fec-524d24fd6647</td>
645
                                    </tr>
646
                                    <tr class="DoNotShowInSimpleView">
647
                                       <td>Assertion URI</td>
648
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID85e77870-a833-44f7-8881-d1409275d9ff" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID85e77870-a833-44f7-8881-d1409275d9ff'); return false;">Link</a></td>
649
                                    </tr>
650
                                 </tbody>
651
                              </table><br><div class="ReportDetail Expression"><label for="EID85e77870-a833-44f7-8881-d1409275d9ff.expression">Expression:</label><textarea id="EID85e77870-a833-44f7-8881-d1409275d9ff.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=
652
        (
653
        for $record in $records
654
        let $rid := $record/gmd:fileIdentifier/*/text()
655
        let $abstract := 
656
                if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
657
                        $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:abstract
658
                else
659
                        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract
660
        return
661
        if (not($abstract)) then
662
                local:addMessage('TR.noAbstract', map { 'filename': local:filename($record), 'id': $rid })
663
        else if (count($abstract) != 1) then
664
                local:addMessage('TR.noAbstract', map { 'filename': local:filename($record), 'id': $rid })
665
    else if (not($abstract) or not(string-length($abstract/gco:CharacterString/text()) != 0 or string-length($abstract/gmx:Anchor/text()) != 0)) then
666
                local:addMessage('TR.emptyAbstract', map { 'filename': local:filename($record), 'id': $rid })
667
        else ()
668
        )[position() le $limitErrors]
669
return
670
(if ($messages) then 'FAILED' else 'PASSED',
671
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
672
 $messages)</textarea></div>
673
                           </div>
674
                        </div>
675
                        <div data-role="collapsible" data-enhanced="true" id="EID9d3ccf0e-05d1-410d-9aee-d91108f56b13" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
676
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.10: Responsible Organization<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
677
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the responsible organization metadata is provided</p>
678
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/responsible-organisation" target="_blank">Responsible Organization</a></p><br><br><table>
679
                                 <tbody>
680
                                    <tr>
681
                                       <td>Status</td>
682
                                       <td>Passed</td>
683
                                    </tr>
684
                                    <tr>
685
                                       <td>Duration</td>
686
                                       <td>0.001 s</td>
687
                                    </tr>
688
                                    <tr class="ReportDetail">
689
                                       <td>Assertion ID</td>
690
                                       <td>EID87ee2219-2ba5-4a27-91ac-2b3bf5730012</td>
691
                                    </tr>
692
                                    <tr class="DoNotShowInSimpleView">
693
                                       <td>Assertion URI</td>
694
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID9d3ccf0e-05d1-410d-9aee-d91108f56b13" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID9d3ccf0e-05d1-410d-9aee-d91108f56b13'); return false;">Link</a></td>
695
                                    </tr>
696
                                 </tbody>
697
                              </table><br><div class="ReportDetail Expression"><label for="EID9d3ccf0e-05d1-410d-9aee-d91108f56b13.expression">Expression:</label><textarea id="EID9d3ccf0e-05d1-410d-9aee-d91108f56b13.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $iso19115_CIRoleCode := ('resourceProvider','custodian','owner','user','distributor','originator','pointOfContact','principalInvestigator','processor','publisher','author')
698
let $messages := 
699
                (for $record in $records
700
                 let $rid := $record/gmd:fileIdentifier/*/text()
701
                 let $pocs := 
702
                        if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
703
                            $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:pointOfContact/gmd:CI_ResponsibleParty
704
                        else
705
                            $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact/gmd:CI_ResponsibleParty
706
                 return
707
                    if(not($pocs)) then
708
                             local:addMessage('TR.missingResponsibleParty', map { 'filename': local:filename($record), 'id': $rid })
709
                    else
710
                                for $poc in $pocs
711
                                let $orgName := $poc/gmd:organisationName
712
                                let $email := 
713
                                    for $y in $poc/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address
714
                    return $y/gmd:electronicMailAddress
715
                                let $emailChar := 
716
                                        for $y in $poc/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress
717
                                    return
718
                                                if ($y/gco:CharacterString/text() != '') then
719
                                                         $y
720
                                                else ()
721
                                let $emailAnc := 
722
                                        for $y in $poc/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress
723
                                    return
724
                                                if ($y/gmx:Anchor/text() != '') then
725
                                                         $y
726
                                                else ()
727
                        let $a := local:log('Email Char: ' || count($emailChar))
728
                    let $b := local:log('Email Anch: ' || count($emailAnc))
729

    
730
                                return
731
                    if (not($orgName) or not(string-length($orgName/gco:CharacterString/text()) != 0 or string-length($orgName/gmx:Anchor/text()) != 0)) then
732
                                            local:addMessage('TR.noMetadataContactOrganisationName', map { 'filename': local:filename($record), 'id': $rid })
733
                    else if (count($email) = 0 or count($emailChar) + count($emailAnc) != count($email)) then
734
                                            local:addMessage('TR.noMetadataContactEmailAddress', map { 'filename': local:filename($record), 'id': $rid })
735
                                    else if (not($poc/gmd:role) or not($poc/gmd:role/gmd:CI_RoleCode/@codeListValue = $iso19115_CIRoleCode)) then
736
                                            local:addMessage('TR.noPointOfContactRole', map { 'filename': local:filename($record), 'id': $rid })
737
                                    else ()
738
                )[position() le $limitErrors]
739
        return
740
        (if ($messages) then 'FAILED' else 'PASSED',
741
         local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
742
         $messages)</textarea></div>
743
                           </div>
744
                        </div>
745
                        <div data-role="collapsible" data-enhanced="true" id="EIDa5f42e10-33c4-44da-9afa-90b62ffd5e17" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
746
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.11: Temporal Reference<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
747
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that there is at least one temporal reference and it is codified correctly.</p>
748
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/temporal-reference" target="_blank">Temporal Reference</a></p><br><br><table>
749
                                 <tbody>
750
                                    <tr>
751
                                       <td>Status</td>
752
                                       <td>Passed</td>
753
                                    </tr>
754
                                    <tr>
755
                                       <td>Duration</td>
756
                                       <td>0.001 s</td>
757
                                    </tr>
758
                                    <tr class="ReportDetail">
759
                                       <td>Assertion ID</td>
760
                                       <td>EID01ae1fe1-1990-4716-ae09-88d1208b408c</td>
761
                                    </tr>
762
                                    <tr class="DoNotShowInSimpleView">
763
                                       <td>Assertion URI</td>
764
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDa5f42e10-33c4-44da-9afa-90b62ffd5e17" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDa5f42e10-33c4-44da-9afa-90b62ffd5e17'); return false;">Link</a></td>
765
                                    </tr>
766
                                 </tbody>
767
                              </table><br><div class="ReportDetail Expression"><label for="EIDa5f42e10-33c4-44da-9afa-90b62ffd5e17.expression">Expression:</label><textarea id="EIDa5f42e10-33c4-44da-9afa-90b62ffd5e17.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $regexDate := '^((?:(?:1[6-9]|2[0-9])\d{2})(-)(?:(?:(?:0[13578]|1[02])(-)31)|((0[1,3-9]|1[0-2])(-)(29|30))))$|^(?:(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(-)02(-)29)$|^(?:(?:1[6-9]|2[0-9])\d{2})(-)(?:(?:0[1-9])|(?:1[0-2]))(-)(?:0[1-9]|1\d|2[0-8])$'
768
let $regexDateTime := '^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z)?$'
769
let $messages := 
770
        (for $record in $records
771
        let $rid := $record/gmd:fileIdentifier/*/text()
772
        let $ci_dates := $record/gmd:identificationInfo[1]/*/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date
773
        return
774
        (if(not($ci_dates/gmd:date)) then
775
                local:addMessage('TR.noRelevantDate', map { 'filename': local:filename($record), 'id': $rid })
776
        else 
777
                for $ci_date in $ci_dates
778
                let $dateType := $ci_date/gmd:dateType/gmd:CI_DateTypeCode
779
                return
780
                if (not($ci_date/gmd:date/gco:Date or $ci_date/gmd:date/gco:DateTime)) then
781
                        local:addMessage('TR.noRelevantDate', map { 'filename': local:filename($record), 'id': $rid })
782
                else if ($ci_date/gmd:date/gco:Date and not(matches($ci_date/gmd:date/gco:Date/text(),$regexDate))) then
783
                        local:addMessage('TR.invalidDateFormat', map { 'filename': local:filename($record), 'id': $rid }) 
784
                else if ($ci_date/gmd:date/gco:DateTime and not(matches($ci_date/gmd:date/gco:DateTime/text(),$regexDateTime))) then
785
                        local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
786
                else if (not($dateType)) then
787
                        local:addMessage('TR.noDateType', map { 'filename': local:filename($record), 'id': $rid })
788
                else if (not($dateType/@codeListValue = ('publication','revision','creation'))) then
789
                        local:addMessage('TR.noDateTypeForSpecification', map { 'filename': local:filename($record), 'id': $rid })
790
                else())
791
        )[position() le $limitErrors]
792
return
793
(if ($messages) then 'FAILED' else 'PASSED',
794
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
795
 $messages)</textarea></div>
796
                           </div>
797
                        </div>
798
                        <div data-role="collapsible" data-enhanced="true" id="EIDa7d34555-e495-4313-ad1b-3fbd954701d0" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
799
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.12: Max One Date of Creation<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
800
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that not more than one date of creation for the metadata is given</p>
801
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/max-1-date-of-creation" target="_blank">Max One Date of Creation</a></p><br><br><table>
802
                                 <tbody>
803
                                    <tr>
804
                                       <td>Status</td>
805
                                       <td>Passed</td>
806
                                    </tr>
807
                                    <tr>
808
                                       <td>Duration</td>
809
                                       <td>0.001 s</td>
810
                                    </tr>
811
                                    <tr class="ReportDetail">
812
                                       <td>Assertion ID</td>
813
                                       <td>EID109cce73-7e80-432e-a3e0-450e231f4120</td>
814
                                    </tr>
815
                                    <tr class="DoNotShowInSimpleView">
816
                                       <td>Assertion URI</td>
817
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDa7d34555-e495-4313-ad1b-3fbd954701d0" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDa7d34555-e495-4313-ad1b-3fbd954701d0'); return false;">Link</a></td>
818
                                    </tr>
819
                                 </tbody>
820
                              </table><br><div class="ReportDetail Expression"><label for="EIDa7d34555-e495-4313-ad1b-3fbd954701d0.expression">Expression:</label><textarea id="EIDa7d34555-e495-4313-ad1b-3fbd954701d0.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $regex := '^((?:(?:1[6-9]|2[0-9])\d{2})(-)(?:(?:(?:0[13578]|1[02])(-)31)|((0[1,3-9]|1[0-2])(-)(29|30))))$|^(?:(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(-)02(-)29)$|^(?:(?:1[6-9]|2[0-9])\d{2})(-)(?:(?:0[1-9])|(?:1[0-2]))(-)(?:0[1-9]|1\d|2[0-8])$'
821

    
822
let $dt := ('CI_DateTypeCode','http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_DateTypeCode')        
823
let $messages := 
824
        (for $record in $records
825
         let $rid := $record/gmd:fileIdentifier/*/text()
826
         let $temporalReferences := $record/gmd:identificationInfo[1]/*/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date
827
         let $creationTempRefs := $temporalReferences[gmd:dateType/*/@codeListValue = ('creation')]
828
         return
829
 if(count($creationTempRefs) ne 1 and count($creationTempRefs) ne 0) then
830
                local:addMessage('TR.moreThanOneCreationDate', map { 'filename': local:filename($record), 'id': $rid })
831
         else (for $date in $creationTempRefs
832
   return 
833
   if (not(matches($date/gmd:date/gco:Date/text(),$regex))) then
834
        local:addMessage('TR.invalidDateFormat', map { 'filename': local:filename($record), 'id': $rid }) 
835
   else())
836
        )[position() le $limitErrors]
837
return
838
(if ($messages) then 'FAILED' else 'PASSED',
839
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
840
 $messages)</textarea></div>
841
                           </div>
842
                        </div>
843
                        <div data-role="collapsible" data-enhanced="true" id="EID8b793822-f520-499f-810e-3df94dae1f60" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
844
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.13: Not More than one Date of Last Revision<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
845
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that not more than one date of last revision for the metadata is given.</p>
846
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/max-1-date-of-last-revision" target="_blank">Max one Date of Last Revision</a></p><br><br><table>
847
                                 <tbody>
848
                                    <tr>
849
                                       <td>Status</td>
850
                                       <td>Passed</td>
851
                                    </tr>
852
                                    <tr>
853
                                       <td>Duration</td>
854
                                       <td>0.001 s</td>
855
                                    </tr>
856
                                    <tr class="ReportDetail">
857
                                       <td>Assertion ID</td>
858
                                       <td>EID6b4e043c-7624-4b3c-8b0c-bec547d2f8f6</td>
859
                                    </tr>
860
                                    <tr class="DoNotShowInSimpleView">
861
                                       <td>Assertion URI</td>
862
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID8b793822-f520-499f-810e-3df94dae1f60" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID8b793822-f520-499f-810e-3df94dae1f60'); return false;">Link</a></td>
863
                                    </tr>
864
                                 </tbody>
865
                              </table><br><div class="ReportDetail Expression"><label for="EID8b793822-f520-499f-810e-3df94dae1f60.expression">Expression:</label><textarea id="EID8b793822-f520-499f-810e-3df94dae1f60.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $regex := '^((?:(?:1[6-9]|2[0-9])\d{2})(-)(?:(?:(?:0[13578]|1[02])(-)31)|((0[1,3-9]|1[0-2])(-)(29|30))))$|^(?:(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(-)02(-)29)$|^(?:(?:1[6-9]|2[0-9])\d{2})(-)(?:(?:0[1-9])|(?:1[0-2]))(-)(?:0[1-9]|1\d|2[0-8])$'
866

    
867
let $dt := ('CI_DateTypeCode','http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_DateTypeCode')        
868
let $messages := 
869
        (for $record in $records
870
         let $rid := $record/gmd:fileIdentifier/*/text()
871
         let $temporalReferences := $record/gmd:identificationInfo[1]/*/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date
872
         let $revisionTempRefs := $temporalReferences[gmd:dateType/*/@codeListValue = ('revision')]
873
         return
874
 if(count($revisionTempRefs) ne 1 and count($revisionTempRefs) ne 0) then
875
                local:addMessage('TR.moreThanOneCreationDate', map { 'filename': local:filename($record), 'id': $rid })
876
         else (for $date in $revisionTempRefs
877
   return 
878
   if (not(matches($date/gmd:date/gco:Date/text(),$regex))) then
879
        local:addMessage('TR.invalidDateFormat', map { 'filename': local:filename($record), 'id': $rid }) 
880
   else())
881
        )[position() le $limitErrors]
882
return
883
(if ($messages) then 'FAILED' else 'PASSED',
884
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
885
 $messages)</textarea></div>
886
                           </div>
887
                        </div>
888
                        <div data-role="collapsible" data-enhanced="true" id="EID328f28dc-1a4d-4f1a-825c-ca28583da37c" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
889
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.14: Temporal Extent<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
890
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test if a temporal reference is provided using the temporary extension. The temporal reference will be coded using an individual date or a period of time between two dates.</p>
891
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/temporal-extent" target="_blank">Temporal Extent</a></p><br><br><table>
892
                                 <tbody>
893
                                    <tr>
894
                                       <td>Status</td>
895
                                       <td>Passed</td>
896
                                    </tr>
897
                                    <tr>
898
                                       <td>Duration</td>
899
                                       <td>0.001 s</td>
900
                                    </tr>
901
                                    <tr class="ReportDetail">
902
                                       <td>Assertion ID</td>
903
                                       <td>EID76f8fb3a-c00f-11e8-a355-529269fb1459</td>
904
                                    </tr>
905
                                    <tr class="DoNotShowInSimpleView">
906
                                       <td>Assertion URI</td>
907
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID328f28dc-1a4d-4f1a-825c-ca28583da37c" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID328f28dc-1a4d-4f1a-825c-ca28583da37c'); return false;">Link</a></td>
908
                                    </tr>
909
                                 </tbody>
910
                              </table><br><div class="ReportDetail Expression"><label for="EID328f28dc-1a4d-4f1a-825c-ca28583da37c.expression">Expression:</label><textarea id="EID328f28dc-1a4d-4f1a-825c-ca28583da37c.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages := 
911
        (for $record in $records
912
         let $rid := $record/gmd:fileIdentifier/*/text()
913
         let $regex := '^(\d{4})(-(\d{2}))??(-(\d{2}))??(T(\d{2}):(\d{2})(:(\d{2}))??(\.(\d+))??(([\+\-]{1}\d{2}:\d{2})|Z)??)??$'
914
         let $temporalExtentextents := $record/gmd:identificationInfo[1]/*/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent
915
         return
916
                 for $extent in $temporalExtentextents
917
                let $timePosition := $extent/*:TimeInstant/*:timePosition
918
                let $timePeriod := $extent/*:TimePeriod
919
                let $beginPosition := $extent/*:TimePeriod/*:beginPosition
920
                let $endPosition := $extent/*:TimePeriod/*:endPosition
921
                return
922
                if ($timePosition) then
923
                        if (not(matches($timePosition/text(), $regex))) then
924
                                local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
925
                        else ()
926
                else if($timePeriod) then
927
                        if (not($beginPosition/@indeterminatePosition) and not(matches($beginPosition/text(), $regex))) then
928
                                local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
929
                        else if ($beginPosition/@indeterminatePosition and not($beginPosition/@indeterminatePosition = 'unknown')) then
930
                                local:addMessage('TR.wrongIndeterminatePosition', map { 'filename': local:filename($record), 'id': $rid })
931
                        else if (not($endPosition/@indeterminatePosition) and not(matches($endPosition/text(), $regex))) then
932
                                local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
933
                        else if ($endPosition/@indeterminatePosition and not($endPosition/@indeterminatePosition = 'unknown' or $endPosition/@indeterminatePosition = 'now')) then
934
                                local:addMessage('TR.wrongIndeterminatePosition', map { 'filename': local:filename($record), 'id': $rid })
935
                        else ()
936
                else
937
                        local:addMessage('TR.noTimePositionOrPeriod', map { 'filename': local:filename($record), 'id': $rid })
938
        )[position() le $limitErrors]
939
return
940
(if ($messages) then 'FAILED' else 'PASSED',
941
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
942
 $messages)</textarea></div>
943
                           </div>
944
                        </div>
945
                        <div data-role="collapsible" data-enhanced="true" id="EID347befe9-af9e-4ddb-8358-ec6567615645" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
946
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.15: Keyword Originating CV<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
947
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the citation of the source controlled vocabulary when giving the value of a keyword is provided correctly.</p>
948
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/keyword-originating-cv" target="_blank">Keyword Originating CV</a></p><br><br><table>
949
                                 <tbody>
950
                                    <tr>
951
                                       <td>Status</td>
952
                                       <td>Passed</td>
953
                                    </tr>
954
                                    <tr>
955
                                       <td>Duration</td>
956
                                       <td>0.001 s</td>
957
                                    </tr>
958
                                    <tr class="ReportDetail">
959
                                       <td>Assertion ID</td>
960
                                       <td>EID76f8ff36-c00f-11e8-a355-529269fb1459</td>
961
                                    </tr>
962
                                    <tr class="DoNotShowInSimpleView">
963
                                       <td>Assertion URI</td>
964
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID347befe9-af9e-4ddb-8358-ec6567615645" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID347befe9-af9e-4ddb-8358-ec6567615645'); return false;">Link</a></td>
965
                                    </tr>
966
                                 </tbody>
967
                              </table><br><div class="ReportDetail Expression"><label for="EID347befe9-af9e-4ddb-8358-ec6567615645.expression">Expression:</label><textarea id="EID347befe9-af9e-4ddb-8358-ec6567615645.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $regex := '^((?:(?:1[6-9]|2[0-9])\d{2})(-)(?:(?:(?:0[13578]|1[02])(-)31)|((0[1,3-9]|1[0-2])(-)(29|30))))$|^(?:(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(-)02(-)29)$|^(?:(?:1[6-9]|2[0-9])\d{2})(-)(?:(?:0[1-9])|(?:1[0-2]))(-)(?:0[1-9]|1\d|2[0-8])$'
968

    
969
let $messages := 
970
        (for $record in $records
971
         let $rid := $record/gmd:fileIdentifier/*/text()
972
         let $thesauri := 
973
                if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
974
                        $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:thesaurusName
975
                else
976
                        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:thesaurusName
977
         return
978
         if(not($thesauri)) then ()
979
         else for $thesaurus in $thesauri
980
         let $title := $thesaurus/gmd:CI_Citation/gmd:title
981
         let $keywords := string-join($thesaurus/../gmd:keyword/*[1]/text(), '; ')
982
         let $date := $thesaurus/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date
983
         let $dateTypeCode := $thesaurus/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode
984
         return 
985
                 if (not($title)) then local:addMessage('TR.noTitleForThesaurus', map { 'filename': local:filename($record), 'id': $rid})
986
        else if (not(string-length($title/gco:CharacterString/text()) != 0 or string-length($title/gmx:Anchor/text()) != 0)) then local:addMessage('TR.emptyTitleForThesaurus', map { 'filename': local:filename($record), 'id': $rid})
987
                else if (not($date)) then local:addMessage('TR.invalidDateForThesaurus2', map { 'filename': local:filename($record), 'id': $rid, 'thesaurus': $title/*/text(), 'keywords' : $keywords})
988
                 else if (not($dateTypeCode) or $dateTypeCode/@codeListValue != 'publication') then local:addMessage('TR.invalidDateForThesaurus2', map { 'filename': local:filename($record), 'id': $rid, 'thesaurus': $title/*/text(), 'keywords' : $keywords})
989
                else ()
990
        )[position() le $limitErrors]
991
return
992
(if ($messages) then 'FAILED' else 'PASSED',
993
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
994
 $messages)</textarea></div>
995
                           </div>
996
                        </div>
997
                        <div data-role="collapsible" data-enhanced="true" id="EIDccaaa0c4-c353-403e-b06d-4cd73d78cda7" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
998
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.16: Group Keywords by CV<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
999
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that a Keywords element only contain keywords originating from the one cited controlled vocabulary, or its version.</p>
1000
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/group-keywords-by-cv" target="_blank">Group Keywords by CV</a></p><br><br><table>
1001
                                 <tbody>
1002
                                    <tr>
1003
                                       <td>Status</td>
1004
                                       <td>Passed</td>
1005
                                    </tr>
1006
                                    <tr>
1007
                                       <td>Duration</td>
1008
                                       <td>0.001 s</td>
1009
                                    </tr>
1010
                                    <tr class="ReportDetail">
1011
                                       <td>Assertion ID</td>
1012
                                       <td>EID76f901ca-c00f-11e8-a355-529269fb1459</td>
1013
                                    </tr>
1014
                                    <tr class="DoNotShowInSimpleView">
1015
                                       <td>Assertion URI</td>
1016
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDccaaa0c4-c353-403e-b06d-4cd73d78cda7" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDccaaa0c4-c353-403e-b06d-4cd73d78cda7'); return false;">Link</a></td>
1017
                                    </tr>
1018
                                 </tbody>
1019
                              </table><br><div class="ReportDetail Expression"><label for="EIDccaaa0c4-c353-403e-b06d-4cd73d78cda7.expression">Expression:</label><textarea id="EIDccaaa0c4-c353-403e-b06d-4cd73d78cda7.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages := 
1020
        (for $record in $records
1021
         let $rid := $record/gmd:fileIdentifier/*/text()
1022
         let $keywords := 
1023
                if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
1024
                        $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:descriptiveKeywords
1025
                else
1026
                        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords
1027
         let $thesaurusNameTitle := 
1028
                if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
1029
                        $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:title
1030
                else
1031
                        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:title
1032
         return
1033
         if (count($thesaurusNameTitle) != count(distinct-values($thesaurusNameTitle))) then
1034
           local:addMessage('TR.keywordsNotGroupedByVocabulary', map { 'filename': local:filename($record), 'id': $rid })
1035
         else ()
1036
        )[position() le $limitErrors]
1037
return
1038
(if ($messages) then 'FAILED' else 'PASSED',
1039
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1040
 $messages)</textarea></div>
1041
                           </div>
1042
                        </div>
1043
                        <div data-role="collapsible" data-enhanced="true" id="EIDe7666818-8899-4449-a2cf-d6b40c189857" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1044
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.17: Limitations on Public Access<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1045
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that information on the existence of some limitation of public access to spatial data sets and spatial data services is provided.</p>
1046
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/limitations-on-public-access" target="_blank">Limitations on Public Access</a></p><br><br><table>
1047
                                 <tbody>
1048
                                    <tr>
1049
                                       <td>Status</td>
1050
                                       <td>Passed</td>
1051
                                    </tr>
1052
                                    <tr>
1053
                                       <td>Duration</td>
1054
                                       <td>0.001 s</td>
1055
                                    </tr>
1056
                                    <tr class="ReportDetail">
1057
                                       <td>Assertion ID</td>
1058
                                       <td>EIDf7e5c9d6-7a5c-47cc-9c95-1d4f3a5f92eb</td>
1059
                                    </tr>
1060
                                    <tr class="DoNotShowInSimpleView">
1061
                                       <td>Assertion URI</td>
1062
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDe7666818-8899-4449-a2cf-d6b40c189857" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDe7666818-8899-4449-a2cf-d6b40c189857'); return false;">Link</a></td>
1063
                                    </tr>
1064
                                 </tbody>
1065
                              </table><br><div class="ReportDetail Expression"><label for="EIDe7666818-8899-4449-a2cf-d6b40c189857.expression">Expression:</label><textarea id="EIDe7666818-8899-4449-a2cf-d6b40c189857.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=
1066
        (for $record in $records
1067
         let $rid := $record/gmd:fileIdentifier/*/text()
1068
         let $md_legalConstraints_Limitations :=
1069
                for $x in $record/gmd:identificationInfo/*/gmd:resourceConstraints/gmd:MD_LegalConstraints where (count($x/gmd:accessConstraints) != 0)
1070
                let $validAccessConstraints :=
1071
                        for $ac in $x/gmd:accessConstraints
1072
                        where ($ac/gmd:MD_RestrictionCode/@codeListValue = 'otherRestrictions')
1073
                        return $ac
1074
                let $validAnchor :=
1075
                        for $y in $x/gmd:otherConstraints/gmx:Anchor
1076
                        where ($y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1a' or
1077
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1b' or
1078
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1c' or
1079
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1d' or
1080
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1e' or
1081
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1f' or
1082
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1g' or
1083
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1h' or
1084
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations' or
1085
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1a' or
1086
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1b' or
1087
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1c' or
1088
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1d' or
1089
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1e' or
1090
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1f' or
1091
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1g' or
1092
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1h' or
1093
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations')
1094
                        return $y
1095
                let $invalidAnchor :=
1096
                        for $y in $x/gmd:otherConstraints/gmx:Anchor
1097
                        where ($y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply' or
1098
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/conditionsUnknown' or
1099
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply' or
1100
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/conditionsUnknown')
1101
                        return $y
1102
                return
1103
                        if(count($validAnchor) &gt;= 1 and count($validAccessConstraints) = 1) then $x
1104
                        else ()
1105
         return
1106
         if (count($md_legalConstraints_Limitations) != 1) then
1107
                local:addMessage('TR.noValidResourceLimitations', map { 'filename': local:filename($record), 'id': $rid })
1108
         else ()
1109
        )[position() le $limitErrors]
1110
return
1111
(if ($messages) then 'FAILED' else 'PASSED',
1112
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1113
 $messages)</textarea></div>
1114
                           </div>
1115
                        </div>
1116
                        <div data-role="collapsible" data-enhanced="true" id="EID699db139-b2b4-4908-a647-c54d9869dff1" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1117
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.18: Conditions for Access and Use<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1118
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test the technical restrictions of access and use of spatial data sets and services.</p>
1119
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/conditions-for-access-and-use" target="_blank">Conditions for Access and Use</a></p><br><br><table>
1120
                                 <tbody>
1121
                                    <tr>
1122
                                       <td>Status</td>
1123
                                       <td>Passed</td>
1124
                                    </tr>
1125
                                    <tr>
1126
                                       <td>Duration</td>
1127
                                       <td>0.001 s</td>
1128
                                    </tr>
1129
                                    <tr class="ReportDetail">
1130
                                       <td>Assertion ID</td>
1131
                                       <td>EID410b57a6-0314-4506-9352-19042f1723cd</td>
1132
                                    </tr>
1133
                                    <tr class="DoNotShowInSimpleView">
1134
                                       <td>Assertion URI</td>
1135
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID699db139-b2b4-4908-a647-c54d9869dff1" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID699db139-b2b4-4908-a647-c54d9869dff1'); return false;">Link</a></td>
1136
                                    </tr>
1137
                                 </tbody>
1138
                              </table><br><div class="ReportDetail Expression"><label for="EID699db139-b2b4-4908-a647-c54d9869dff1.expression">Expression:</label><textarea id="EID699db139-b2b4-4908-a647-c54d9869dff1.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=
1139
        (for $record in $records
1140
        let $rid := $record/gmd:fileIdentifier/*/text()
1141
        let $md_legalConstraints_Conditions :=
1142
                for $x in $record/gmd:identificationInfo/*/gmd:resourceConstraints/gmd:MD_LegalConstraints
1143
                let $validAccessConstraints :=
1144
                        for $ac in $x/gmd:accessConstraints
1145
                        where ($ac/gmd:MD_RestrictionCode/@codeListValue = 'otherRestrictions')
1146
                        return $ac
1147
                let $validUseConstraints :=
1148
                        for $uc in $x/gmd:useConstraints
1149
                        where ($uc/gmd:MD_RestrictionCode/@codeListValue = 'otherRestrictions')
1150
                        return $uc
1151
                let $validAnchor :=
1152
                        for $y in $x/gmd:otherConstraints/gmx:Anchor
1153
                        where ($y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply' or
1154
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/conditionsUnknown' or
1155
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply' or
1156
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/conditionsUnknown')
1157
                        return $y
1158
                let $invalidAnchor :=
1159
                        for $y in $x/gmd:otherConstraints/gmx:Anchor
1160
                        where ($y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1a' or
1161
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1b' or
1162
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1c' or
1163
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1d' or
1164
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1e' or
1165
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1f' or
1166
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1g' or
1167
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1h' or
1168
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations' or
1169
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1a' or
1170
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1b' or
1171
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1c' or
1172
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1d' or
1173
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1e' or
1174
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1f' or
1175
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1g' or
1176
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1h' or
1177
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations')
1178
                        return $y
1179
                return
1180
                        if(count($validAccessConstraints) &gt;=1 and count($invalidAnchor) &gt;= 1 and ((not(count($x/gmd:otherConstraints/gco:CharacterString) = 0) and not(string-length($x/gmd:otherConstraints/gco:CharacterString) = 0)) or count($validAnchor) = 1)) then $x
1181
                        else if(count($validUseConstraints) = 1 and ((not(count($x/gmd:otherConstraints/gco:CharacterString) = 0) and not(string-length($x/gmd:otherConstraints/gco:CharacterString) = 0)) or count($validAnchor) = 1)) then $x
1182
                         else ()
1183
        return ()
1184
        )[position() le $limitErrors]
1185
return
1186
(if ($messages) then 'FAILED' else 'PASSED',
1187
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1188
 $messages)</textarea></div>
1189
                           </div>
1190
                        </div>
1191
                        <div data-role="collapsible" data-enhanced="true" id="EID6ef1d2c5-dca1-4342-93a9-011f53aee776" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1192
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.19: Geographical Bounding Box<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1193
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the extent of the resource in the geographic space is specified using a geometric bounding box.</p>
1194
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/bounding-box" target="_blank">Bounding Box</a></p><br><br><table>
1195
                                 <tbody>
1196
                                    <tr>
1197
                                       <td>Status</td>
1198
                                       <td>Passed</td>
1199
                                    </tr>
1200
                                    <tr>
1201
                                       <td>Duration</td>
1202
                                       <td>0.001 s</td>
1203
                                    </tr>
1204
                                    <tr class="ReportDetail">
1205
                                       <td>Assertion ID</td>
1206
                                       <td>EID701be21b-1158-4055-9594-67a4e2005e38</td>
1207
                                    </tr>
1208
                                    <tr class="DoNotShowInSimpleView">
1209
                                       <td>Assertion URI</td>
1210
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID6ef1d2c5-dca1-4342-93a9-011f53aee776" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID6ef1d2c5-dca1-4342-93a9-011f53aee776'); return false;">Link</a></td>
1211
                                    </tr>
1212
                                 </tbody>
1213
                              </table><br><div class="ReportDetail Expression"><label for="EID6ef1d2c5-dca1-4342-93a9-011f53aee776.expression">Expression:</label><textarea id="EID6ef1d2c5-dca1-4342-93a9-011f53aee776.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages := 
1214
        for $record in $records
1215
        let $rid := $record/gmd:fileIdentifier/*/text()
1216
        let $extents := 
1217
    if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
1218
                $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox
1219
    else
1220
        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox
1221
        let $regex := '^-?\d+\.\d{2,}'
1222
        let $rid := $record/gmd:fileIdentifier/*/text()
1223
        return
1224
                (if (($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'dataset' or $record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'series') and not($extents)) then
1225
                local:addMessage('TR.noGeographicBoundingBox', map { 'filename': local:filename($record), 'id': $rid })
1226
                else
1227
                (
1228
                for $extent in $extents
1229
                let $west := $extent/gmd:westBoundLongitude/gco:Decimal/text()
1230
                let $east := $extent/gmd:eastBoundLongitude/gco:Decimal/text()
1231
                let $south := $extent/gmd:southBoundLatitude/gco:Decimal/text()
1232
                let $north := $extent/gmd:northBoundLatitude/gco:Decimal/text()
1233
                return
1234
                if (not(($west and matches($west,$regex) and fn:number($west) &gt;= -180 and fn:number($west) &lt;= 180) and
1235
                                        ($east and matches($east,$regex) and fn:number($east) &gt;= -180 and fn:number($east) &lt;= 180) and
1236
                                        ($south and matches($south,$regex) and fn:number($south) &gt;= -90 and fn:number($south) &lt;= 90) and
1237
                                        ($north and matches($north,$regex) and fn:number($north) &gt;= -90 and fn:number($north) &lt;= 90) and
1238
                                        (fn:number($south) &lt;= fn:number($north)))) then
1239
                        local:addMessage('TR.invalidGeographicBoundingBox', map { 'filename': local:filename($record), 'id': $rid, 'west': $west, 'east': $east, 'south': $south, 'north': $north })
1240
                else ()
1241
                )
1242
        )[position() le $limitErrors]
1243
return
1244
(if ($messages) then 'FAILED' else 'PASSED',
1245
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1246
 $messages)</textarea></div>
1247
                           </div>
1248
                        </div>
1249
                     </div>
1250
                  </div>
1251
               </div>
1252
               <div data-role="collapsible" data-enhanced="true" id="EID61e803d0-c181-11e8-a355-529269fb1459" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
1253
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">Data quality
1254
                        <div class="ui-li-count">3</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
1255
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Execute tests that apply for all metadata records on elements that are child 
1256
                                        elements of the section of the XML document: Data Quality Information (property of the gmd:MD_Metadata element). 
1257
                                        This section contains information specific to the quality and lineage (including processing steps and sources) of the 
1258
                                        resource.<br><br><table>
1259
                        <tbody>
1260
                           <tr>
1261
                              <td>Status</td>
1262
                              <td>Passed</td>
1263
                           </tr>
1264
                           <tr>
1265
                              <td>Duration</td>
1266
                              <td>0.001 s</td>
1267
                           </tr>
1268
                           <tr class="ReportDetail">
1269
                              <td>Test case ID</td>
1270
                              <td>EID61e803d0-c181-11e8-a355-529269fb1459</td>
1271
                           </tr>
1272
                        </tbody>
1273
                     </table><br><div class="TestStepPlaceHolder">
1274
                        <div data-role="collapsible" data-enhanced="true" id="EIDc1598c79-ef89-4d6c-9a17-89b0e46e1d78" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1275
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.20: Dataset Conformity<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1276
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the metadata includes information on the degree of conformity with the implementing rules on interoperability of spatial data sets.</p>
1277
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/conformity" target="_blank">Dataset Conformity</a></p><br><br><table>
1278
                                 <tbody>
1279
                                    <tr>
1280
                                       <td>Status</td>
1281
                                       <td>Passed</td>
1282
                                    </tr>
1283
                                    <tr>
1284
                                       <td>Duration</td>
1285
                                       <td>0.001 s</td>
1286
                                    </tr>
1287
                                    <tr class="ReportDetail">
1288
                                       <td>Assertion ID</td>
1289
                                       <td>EIDf55f2448-c4d5-4af0-a83b-40ccd0d2a7df</td>
1290
                                    </tr>
1291
                                    <tr class="DoNotShowInSimpleView">
1292
                                       <td>Assertion URI</td>
1293
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDc1598c79-ef89-4d6c-9a17-89b0e46e1d78" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDc1598c79-ef89-4d6c-9a17-89b0e46e1d78'); return false;">Link</a></td>
1294
                                    </tr>
1295
                                 </tbody>
1296
                              </table><br><div class="ReportDetail Expression"><label for="EIDc1598c79-ef89-4d6c-9a17-89b0e46e1d78.expression">Expression:</label><textarea id="EIDc1598c79-ef89-4d6c-9a17-89b0e46e1d78.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $levels := ('dataset', 'series', 'service')
1297
let $recordsToInspect := $records[gmd:hierarchyLevel/*/@codeListValue = $levels]
1298
let $messages := 
1299
        (for $record in $recordsToInspect
1300
         let $rid := $record/gmd:fileIdentifier/*/text()
1301
         let $confResult := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult
1302
         return 
1303
         if (not($confResult)) then
1304
                local:addMessage('TR.noConformityStatement', map { 'filename': local:filename($record), 'id': $rid })
1305
         else ()
1306
        )[position() le $limitErrors]
1307
return
1308
(if ($messages) then 'FAILED' else 'PASSED',
1309
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1310
 $messages)</textarea></div>
1311
                           </div>
1312
                        </div>
1313
                        <div data-role="collapsible" data-enhanced="true" id="EIDfc07d77e-61d2-4724-bb3a-b6665094e000" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1314
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.21: Dataset Conformity Specifications<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1315
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the DQ_ConformanceResult element is correctly specified through a citation of the INSPIRE Implementing Rule and a specification document or Conformance Class using CI_Citation element: including its official title and the date of publication of the document.</p>
1316
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/conformity-specification" target="_blank">Dataset Conformity Specifications</a></p><br><br><table>
1317
                                 <tbody>
1318
                                    <tr>
1319
                                       <td>Status</td>
1320
                                       <td>Passed</td>
1321
                                    </tr>
1322
                                    <tr>
1323
                                       <td>Duration</td>
1324
                                       <td>0.001 s</td>
1325
                                    </tr>
1326
                                    <tr class="ReportDetail">
1327
                                       <td>Assertion ID</td>
1328
                                       <td>EID1f9ddbc5-679b-44b0-bd6f-db14c9c348a9</td>
1329
                                    </tr>
1330
                                    <tr class="DoNotShowInSimpleView">
1331
                                       <td>Assertion URI</td>
1332
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDfc07d77e-61d2-4724-bb3a-b6665094e000" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDfc07d77e-61d2-4724-bb3a-b6665094e000'); return false;">Link</a></td>
1333
                                    </tr>
1334
                                 </tbody>
1335
                              </table><br><div class="ReportDetail Expression"><label for="EIDfc07d77e-61d2-4724-bb3a-b6665094e000.expression">Expression:</label><textarea id="EIDfc07d77e-61d2-4724-bb3a-b6665094e000.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $regex := '^((?:(?:1[6-9]|2[0-9])\d{2})(-)(?:(?:(?:0[13578]|1[02])(-)31)|((0[1,3-9]|1[0-2])(-)(29|30))))$|^(?:(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(-)02(-)29)$|^(?:(?:1[6-9]|2[0-9])\d{2})(-)(?:(?:0[1-9])|(?:1[0-2]))(-)(?:0[1-9]|1\d|2[0-8])$'
1336
let $levels := ('dataset', 'series', 'service')
1337
let $recordsToInspect := $records[gmd:hierarchyLevel/*/@codeListValue = $levels]
1338
let $messages := 
1339
        (for $record in $recordsToInspect
1340
        let $rid := $record/gmd:fileIdentifier/*/text()
1341
        let $result := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult
1342
        return 
1343
        if (not($result)) then
1344
                local:addMessage('TR.noConformityStatement', map { 'filename': local:filename($record), 'id': $rid })
1345
        else if (not($result/gmd:specification/gmd:CI_Citation)) then
1346
                local:addMessage('TR.missingCitationSection', map { 'filename': local:filename($record), 'id': $rid })
1347
        else
1348
                 (for $res in $result
1349
                return
1350
                if(not($res/gmd:specification/gmd:CI_Citation)) then
1351
                        local:addMessage('TR.noCitationForSpecification', map { 'filename': local:filename($record), 'id': $rid })
1352
                else
1353
                for $citation in $res/gmd:specification/gmd:CI_Citation
1354
                        let $title := $citation/gmd:title
1355
                        let $date := $citation/gmd:date
1356
                        let $dateTypeCode := $citation/gmd:date/gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode
1357
                        return
1358
                        if (not($title) or not(string-length($title/gco:CharacterString/text()) != 0 or string-length($title/gmx:Anchor/text()) != 0)) then
1359
                                local:addMessage('TR.noTitleForSpecification', map { 'filename': local:filename($record), 'id': $rid })
1360
                        else if ($title/gmd:PT_FreeText) then
1361
                                for $localisedCharacterString in $title/gmd:PT_FreeText/gmd:textGroup/gmd:LocalisedCharacterString
1362
                                        return
1363
                                        if (string-length($localisedCharacterString) = 0) then
1364
                                        local:addMessage('TR.emptyFreeText', map{'filename': local:filename($record), 'id': $rid, 'path': '/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/$citation/gmd:title/gmd:PT_FreeText'})
1365
                                        else ()
1366
                        else if (not($date)) then
1367
                                local:addMessage('TR.noDateTypeForSpecification', map { 'filename': local:filename($record), 'id': $rid })
1368
                        else if (not($dateTypeCode)) then
1369
                                local:addMessage('TR.noDateTypeForSpecification', map { 'filename': local:filename($record), 'id': $rid })
1370
                        else if (not($dateTypeCode/@codeListValue = ('publication'))) then
1371
                                local:addMessage('TR.noDateTypeForSpecification', map { 'filename': local:filename($record), 'id': $rid })
1372
                        else if (not(matches($date/gmd:CI_Date/gmd:date/gco:Date/text(), $regex))) then
1373
                                local:addMessage('TR.invalidDateFormat', map { 'filename': local:filename($record), 'id': $rid})
1374
                        else ())
1375
        )[position() le $limitErrors]
1376
return
1377
(if ($messages) then 'FAILED' else 'PASSED',
1378
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1379
 $messages)</textarea></div>
1380
                           </div>
1381
                        </div>
1382
                        <div data-role="collapsible" data-enhanced="true" id="EID19fd8308-da53-4537-b680-ace6240331fd" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1383
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md common req C.22: Conformity Degree<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1384
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that each Conformance Result includes the degree of declared conformity against this specification using a property with value "true" for a conformant resource and "false" for non-conformant resource.</p>
1385
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/conformity-degree" target="_blank">Conformity Degree</a></p><br><br><table>
1386
                                 <tbody>
1387
                                    <tr>
1388
                                       <td>Status</td>
1389
                                       <td>Passed</td>
1390
                                    </tr>
1391
                                    <tr>
1392
                                       <td>Duration</td>
1393
                                       <td>0.001 s</td>
1394
                                    </tr>
1395
                                    <tr class="ReportDetail">
1396
                                       <td>Assertion ID</td>
1397
                                       <td>EID614cd750-a8a2-4256-908c-e452c2b4e506</td>
1398
                                    </tr>
1399
                                    <tr class="DoNotShowInSimpleView">
1400
                                       <td>Assertion URI</td>
1401
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID19fd8308-da53-4537-b680-ace6240331fd" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID19fd8308-da53-4537-b680-ace6240331fd'); return false;">Link</a></td>
1402
                                    </tr>
1403
                                 </tbody>
1404
                              </table><br><div class="ReportDetail Expression"><label for="EID19fd8308-da53-4537-b680-ace6240331fd.expression">Expression:</label><textarea id="EID19fd8308-da53-4537-b680-ace6240331fd.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages := 
1405
        (for $record in $records
1406
         let $rid := $record/gmd:fileIdentifier/*/text()
1407
         let $result := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult
1408
         return 
1409
         if (not($result)) then
1410
                local:addMessage('TR.noConformityStatement', map { 'filename': local:filename($record), 'id': $rid })
1411
         else
1412
                 (for $res in $result
1413
                let $pass := $res/gmd:pass
1414
                return
1415
                if ($pass) then
1416
                        if($pass/gco:Boolean) then
1417
                                if (not($pass/gco:Boolean/text() = 'true' or $pass/gco:Boolean/text() = 'false')) then
1418
                                        local:addMessage('TR.declareNoConformityEvaluationAsUnknown', map { 'filename': local:filename($record), 'id': $rid })
1419
                                else ()
1420
                        else if (not($pass/@gco:nilReason)) then
1421
                                local:addMessage('TR.declareNoConformityEvaluationAsUnknown', map { 'filename': local:filename($record), 'id': $rid })
1422
                        else if (not($pass/@gco:nilReason = 'unknown')) then
1423
                                local:addMessage('TR.declareNoConformityEvaluationAsUnknown', map { 'filename': local:filename($record), 'id': $rid })
1424
                        else ()
1425
                else 
1426
                        local:addMessage('TR.declareNoConformityEvaluationAsUnknown', map { 'filename': local:filename($record), 'id': $rid })
1427
                )
1428
        )[position() le $limitErrors]
1429
return
1430
(if ($messages) then 'FAILED' else 'PASSED',
1431
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1432
 $messages)</textarea></div>
1433
                           </div>
1434
                        </div>
1435
                     </div>
1436
                  </div>
1437
               </div>
1438
            </div>
1439
         </div>
1440
         <div class="TestSuite" data-role="collapsible" data-theme="h" data-content-theme="h">
1441
            <h2>Conformance Class 1: INSPIRE data sets and data set series baseline metadata.
1442
               <div class="ui-li-count">3</div>
1443
            </h2><br/><br/><b>This is a draft version. It has limitations and is expected to contain errors.</b> Please report any issues or problems <a href="https://github.com/inspire-eu-validation/community/wiki/Your-feedback" target="_blank">in GitHub</a>.<br/><br/>
1444
Known limitations are documented in the description of the applicable test case or test assertion.<br/><br/>
1445
There is a general limitation in all assertions that polymorphism and containment by reference (see the <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/README#ref_TG_MD" target="_blank">Technical Guidance</a>, sub-clauses A.3, A.4 and A.5) are not supported. However, the current Abstract Test Suite does not support polymorphism and references either (all XPath expressions do not support polymorhism or references; in addition, schema validation is only executed against the ISO/OGC schemas without extensions). It is therefore unclear if this is really a limitation or if the sections in the technical guidance are outdated.
1446
<br/><br/>
1447
Source: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series" target="_blank">Conformance Class 1: 'Baseline metadata for data sets and data set series'</a><br/><br/>
1448
Pre-requisite conformance classes: Common Requirements<br><br><table>
1449
               <tbody>
1450
                  <tr>
1451
                     <td>Status</td>
1452
                     <td>Passed</td>
1453
                  </tr>
1454
                  <tr>
1455
                     <td>Duration</td>
1456
                     <td>4 s</td>
1457
                  </tr>
1458
                  <tr class="ReportDetail">
1459
                     <td>Test suite ID</td>
1460
                     <td>EIDe4a95862-9cc9-436b-9fdd-a0115d342350</td>
1461
                  </tr>
1462
                  <tr class="ReportDetail">
1463
                     <td>Author</td>
1464
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
1465
                  </tr>
1466
                  <tr class="ReportDetail">
1467
                     <td>Date created</td>
1468
                     <td>30/06/2018 00:00:00 GMT</td>
1469
                  </tr>
1470
                  <tr>
1471
                     <td>Version</td>
1472
                     <td>0.1.0</td>
1473
                  </tr>
1474
                  <tr class="ReportDetail">
1475
                     <td>Last editor</td>
1476
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
1477
                  </tr>
1478
                  <tr class="ReportDetail">
1479
                     <td>Last updated</td>
1480
                     <td>30/08/2018 20:45:00 GMT</td>
1481
                  </tr>
1482
                  <tr class="ReportDetail">
1483
                     <td>Reference</td>
1484
                     <td><a class="ui-link" href="https://github.com/inspire-eu-validation/ets-repository/tree/master/metadata/2.0">Link</a></td>
1485
                  </tr>
1486
                  <tr class="ReportDetail">
1487
                     <td>Hash</td>
1488
                     <td>CBF29CE484222325</td>
1489
                  </tr>
1490
               </tbody>
1491
            </table><br><div class="TestModulePlaceHolder">
1492
               <div data-role="collapsible" data-enhanced="true" id="EIDf6fb6d58-03ec-432f-a456-984d093721e4" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
1493
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">General Metadata
1494
                        <div class="ui-li-count">1</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
1495
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Execute tests that apply for all dataset / dataset series metadata records on elements that are directly child elements of the root node of the XML document: MD_Metadata node.<br><br><table>
1496
                        <tbody>
1497
                           <tr>
1498
                              <td>Status</td>
1499
                              <td>Passed</td>
1500
                           </tr>
1501
                           <tr>
1502
                              <td>Duration</td>
1503
                              <td>0.001 s</td>
1504
                           </tr>
1505
                           <tr class="ReportDetail">
1506
                              <td>Test case ID</td>
1507
                              <td>EIDf6fb6d58-03ec-432f-a456-984d093721e4</td>
1508
                           </tr>
1509
                        </tbody>
1510
                     </table><br><div class="TestStepPlaceHolder">
1511
                        <div data-role="collapsible" data-enhanced="true" id="EIDa6ae3ab8-0863-4a4e-b185-1b837829d292" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1512
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.1: Resource Type<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1513
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that a resource type is provided as a dataset or series.</p>
1514
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/resource-type" target="_blank">Resource Type</a></p><br><br><table>
1515
                                 <tbody>
1516
                                    <tr>
1517
                                       <td>Status</td>
1518
                                       <td>Passed</td>
1519
                                    </tr>
1520
                                    <tr>
1521
                                       <td>Duration</td>
1522
                                       <td>0.001 s</td>
1523
                                    </tr>
1524
                                    <tr class="ReportDetail">
1525
                                       <td>Assertion ID</td>
1526
                                       <td>EID9f5d8bbf-59d3-4278-82d3-c9df32d8f42d</td>
1527
                                    </tr>
1528
                                    <tr class="DoNotShowInSimpleView">
1529
                                       <td>Assertion URI</td>
1530
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDa6ae3ab8-0863-4a4e-b185-1b837829d292" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDa6ae3ab8-0863-4a4e-b185-1b837829d292'); return false;">Link</a></td>
1531
                                    </tr>
1532
                                 </tbody>
1533
                              </table><br><div class="ReportDetail Expression"><label for="EIDa6ae3ab8-0863-4a4e-b185-1b837829d292.expression">Expression:</label><textarea id="EIDa6ae3ab8-0863-4a4e-b185-1b837829d292.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $values := ('dataset', 'series')
1534
let $recordsWithErrors := $records[not(gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = $values)][position() le $limitErrors]
1535
return
1536
(if ($recordsWithErrors) then 'FAILED' else 'PASSED',
1537
 local:error-statistics('TR.recordsWithErrors', count($recordsWithErrors)),
1538
 for $record in $recordsWithErrors
1539
   let $rid := $record/gmd:fileIdentifier/gco:CharacterString/text()
1540
   order by $rid
1541
   let $levels := $record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue
1542
   return
1543
     local:addMessage('TR.hierarchyLevel', map { 'filename': local:filename($record), 'id': $rid, 'hierarchyLevels': fn:string-join($levels,', ') })
1544
)</textarea></div>
1545
                           </div>
1546
                        </div>
1547
                     </div>
1548
                  </div>
1549
               </div>
1550
               <div data-role="collapsible" data-enhanced="true" id="EID979c19da-48f9-416d-b751-37ef13912bc6" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
1551
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">Identification
1552
                        <div class="ui-li-count">6</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
1553
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Execute tests that apply for all dataset / dataset series metadata records on elements that are child elements of the section of the XML document: Identification Info (property of the gmd:MD_Metadata element). This section contains information specific to the dataset / dataset series.<br><br><table>
1554
                        <tbody>
1555
                           <tr>
1556
                              <td>Status</td>
1557
                              <td>Passed</td>
1558
                           </tr>
1559
                           <tr>
1560
                              <td>Duration</td>
1561
                              <td>2.632 s</td>
1562
                           </tr>
1563
                           <tr class="ReportDetail">
1564
                              <td>Test case ID</td>
1565
                              <td>EID979c19da-48f9-416d-b751-37ef13912bc6</td>
1566
                           </tr>
1567
                        </tbody>
1568
                     </table><br><div class="TestStepPlaceHolder">
1569
                        <div data-role="collapsible" data-enhanced="true" id="EIDdbfd469a-e94c-4a35-b9e0-7c2676bf4dc4" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1570
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.2: Only One Data Identification<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1571
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the identification info section of the metadata for data sets and data set series is provided correctly.</p>
1572
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/only-one-md-data-identification" target="_blank">Only One Data Identification</a></p><br><br><table>
1573
                                 <tbody>
1574
                                    <tr>
1575
                                       <td>Status</td>
1576
                                       <td>Passed</td>
1577
                                    </tr>
1578
                                    <tr>
1579
                                       <td>Duration</td>
1580
                                       <td>0.001 s</td>
1581
                                    </tr>
1582
                                    <tr class="ReportDetail">
1583
                                       <td>Assertion ID</td>
1584
                                       <td>EIDfeb08775-3d07-4849-bd27-3a549c92d289</td>
1585
                                    </tr>
1586
                                    <tr class="DoNotShowInSimpleView">
1587
                                       <td>Assertion URI</td>
1588
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDdbfd469a-e94c-4a35-b9e0-7c2676bf4dc4" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDdbfd469a-e94c-4a35-b9e0-7c2676bf4dc4'); return false;">Link</a></td>
1589
                                    </tr>
1590
                                 </tbody>
1591
                              </table><br><div class="ReportDetail Expression"><label for="EIDdbfd469a-e94c-4a35-b9e0-7c2676bf4dc4.expression">Expression:</label><textarea id="EIDdbfd469a-e94c-4a35-b9e0-7c2676bf4dc4.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages := (
1592
        for $record in $records
1593
        let $rid := $record/gmd:fileIdentifier/gco:CharacterString/text()
1594
        return
1595
        if(count($record/gmd:identificationInfo[1]/gmd:MD_DataIdentification) != 1) then
1596
                local:addMessage('TR.identificationInfo', map { 'filename': local:filename($record), 'id': $rid, 'identificationInfo': fn:string-join($record/gmd:identificationInfo[1]/gmd:MD_DataIdentification,', ') })
1597
        else ()
1598
)[position() le $limitErrors]
1599
return
1600
(if ($messages) then 'FAILED' else 'PASSED',
1601
local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1602
$messages)</textarea></div>
1603
                           </div>
1604
                        </div>
1605
                        <div data-role="collapsible" data-enhanced="true" id="EID9ca051b5-7a15-4e79-972b-4684c4efa743" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1606
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.3: Dataset UID<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1607
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that every dataset or dataset series has an Unique Resource Identifier.</p>
1608
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/dataset-uid" target="_blank">Dataset UID</a></p><br><br><table>
1609
                                 <tbody>
1610
                                    <tr>
1611
                                       <td>Status</td>
1612
                                       <td>Passed</td>
1613
                                    </tr>
1614
                                    <tr>
1615
                                       <td>Duration</td>
1616
                                       <td>0.001 s</td>
1617
                                    </tr>
1618
                                    <tr class="ReportDetail">
1619
                                       <td>Assertion ID</td>
1620
                                       <td>EID06911d33-b5a3-4b76-b8ee-d473ebf3c8f4</td>
1621
                                    </tr>
1622
                                    <tr class="DoNotShowInSimpleView">
1623
                                       <td>Assertion URI</td>
1624
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID9ca051b5-7a15-4e79-972b-4684c4efa743" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID9ca051b5-7a15-4e79-972b-4684c4efa743'); return false;">Link</a></td>
1625
                                    </tr>
1626
                                 </tbody>
1627
                              </table><br><div class="ReportDetail Expression"><label for="EID9ca051b5-7a15-4e79-972b-4684c4efa743.expression">Expression:</label><textarea id="EID9ca051b5-7a15-4e79-972b-4684c4efa743.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $levels := ('dataset', 'series')
1628
let $allIdent := 
1629
        for $rec in $records
1630
                for $x in $rec/gmd:identificationInfo[1]/*/gmd:citation/gmd:CI_Citation/gmd:identifier/*/gmd:code/*
1631
                return
1632
                if($x/node-name() = QName('http://www.isotc211.org/2005/gco','gco:CharacterString')) then $x/text()
1633
                else if ($x/node-name() = QName('http://www.isotc211.org/2005/gmx','gmx:Anchor')) then $x/@xlink:href
1634
                else ()
1635
let $distinctRecordIdentifiers := distinct-values($allIdent)
1636
let $duplicateDistinctRecordIdentifiers := $distinctRecordIdentifiers[index-of($distinctRecordIdentifiers,.)[2]]
1637
let $messages :=    
1638
    (for $record in $records
1639
        let $rid := $record/gmd:fileIdentifier/gco:CharacterString/text()
1640
        let $identifiers := $record/gmd:identificationInfo[1]/*/gmd:citation/gmd:CI_Citation/gmd:identifier/*/gmd:code
1641
                let $emptyIdentifiers :=
1642
                        for $identifier in $identifiers
1643
            return
1644
                        if (not($identifier)) then
1645
                                $identifier
1646
            else if ($identifier/gco:CharacterString and not(string-length($identifier/gco:CharacterString/text()) != 0)) then
1647
                                $identifier
1648
                        else if ($identifier/gmx:Anchor and string-length($identifier/gmx:Anchor/@xlink:href) = 0) then
1649
                $identifier
1650
            else ()
1651
        return
1652
        if (not($identifiers)) then
1653
            local:addMessage('TR.noIdentifier', map { 'filename': local:filename($record), 'id': $rid })
1654
                else if(count($emptyIdentifiers) != 0) then
1655
                        local:addMessage('TR.emptyIdentifier', map { 'filename': local:filename($record), 'id': $rid })
1656
                else if(count($distinctRecordIdentifiers) != count($identifiers)) then
1657
            local:addMessage('TR.duplicateIdentifier', map { 'filename': local:filename($record), 'id': $rid, 'identifier': fn:string-join($allIdent,'; ') })
1658
        else ()
1659
    )[position() le $limitErrors]
1660
return
1661
(if ($messages) then 'FAILED' else 'PASSED',
1662
local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1663
$messages)</textarea></div>
1664
                           </div>
1665
                        </div>
1666
                        <div data-role="collapsible" data-enhanced="true" id="EID6156cd10-58a4-429b-a22e-6ae7ffeb27f2" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1667
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.4: INSPIRE Theme Keyword<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1668
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the INSPIRE Data Themes, which the data belongs to, are declared using at least one keyword from the INSPIRE Spatial Data Themes vocabulary.</p>
1669
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/inspire-theme-keyword" target="_blank">INSPIRE Theme Keyword</a></p><br><br><table>
1670
                                 <tbody>
1671
                                    <tr>
1672
                                       <td>Status</td>
1673
                                       <td>Passed</td>
1674
                                    </tr>
1675
                                    <tr>
1676
                                       <td>Duration</td>
1677
                                       <td>2.631 s</td>
1678
                                    </tr>
1679
                                    <tr class="ReportDetail">
1680
                                       <td>Assertion ID</td>
1681
                                       <td>EID84892cf0-e7db-4705-9b40-c27a856eacee</td>
1682
                                    </tr>
1683
                                    <tr class="DoNotShowInSimpleView">
1684
                                       <td>Assertion URI</td>
1685
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID6156cd10-58a4-429b-a22e-6ae7ffeb27f2" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID6156cd10-58a4-429b-a22e-6ae7ffeb27f2'); return false;">Link</a></td>
1686
                                    </tr>
1687
                                 </tbody>
1688
                              </table><br><div class="ReportDetail Expression"><label for="EID6156cd10-58a4-429b-a22e-6ae7ffeb27f2.expression">Expression:</label><textarea id="EID6156cd10-58a4-429b-a22e-6ae7ffeb27f2.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $levels := ('dataset', 'series')
1689
let $THEMES_TITLE := 'GEMET - INSPIRE themes, version 1.0'
1690
let $messages :=
1691
        (try{
1692
                let $officialLanguages := ('bg','cs','da','de','et','el','en','es','fr','hr','it','lv','lt','hu','mt','nl','pl','pt','ro','sk','sl','fi','sv')
1693
                let $inspireThemesCodeListURL := 'http://inspire.ec.europa.eu/theme'
1694
                let $codeTitles := local:get-code-titles($inspireThemesCodeListURL,$officialLanguages)
1695
                let $codeValues := local:get-code-list-values($inspireThemesCodeListURL)
1696
                let $codes := ($codeTitles,$codeValues)
1697
                for $record in $records
1698
                        let $rid := $record/gmd:fileIdentifier/*/text()
1699
                        let $relevantDescriptiveKeywordsBlocks := $record/gmd:identificationInfo[1]/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords[gmd:thesaurusName/gmd:CI_Citation/gmd:title/*/text() = $THEMES_TITLE]
1700
                        return
1701
                        if (count($relevantDescriptiveKeywordsBlocks) = 0) then
1702
                                local:addMessage('TR.wrongKeywordFromINSPIREThemesTitle', map { 'filename': local:filename($record), 'id': $rid })
1703
                        else
1704
                                if ($relevantDescriptiveKeywordsBlocks[not(some $keyword in ./gmd:keyword/*/text() satisfies $keyword = $codes) ]) then
1705
                                        local:addMessage('TR.noKeywordFromINSPIREThemes',  map { 'filename': local:filename($record), 'id': $rid, 'url': $inspireThemesCodeListURL, 'keywords': fn:string-join($relevantDescriptiveKeywordsBlocks/gmd:keyword/*/text(),'; ') })
1706
                                else ()
1707
        } catch * {                                                       
1708
                local:addMessage('TR.systemError',  map { 'text': $err:description })                                 
1709
        }
1710
        )[position() le $limitErrors]
1711
return
1712
(if ($messages) then 'FAILED' else 'PASSED',
1713
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1714
 $messages)</textarea></div>
1715
                           </div>
1716
                        </div>
1717
                        <div data-role="collapsible" data-enhanced="true" id="EID995a45e5-7608-4529-9a30-29b4f2beb0c4" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1718
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.5: Spatial Resolution<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1719
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the spatial resolution is defined using either an scale or a distance resolution.</p>
1720
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/spatial-resolution" target="_blank">Spatial Resolution</a></p><br><br><table>
1721
                                 <tbody>
1722
                                    <tr>
1723
                                       <td>Status</td>
1724
                                       <td>Passed</td>
1725
                                    </tr>
1726
                                    <tr>
1727
                                       <td>Duration</td>
1728
                                       <td>0.001 s</td>
1729
                                    </tr>
1730
                                    <tr class="ReportDetail">
1731
                                       <td>Assertion ID</td>
1732
                                       <td>EID82a0442f-0185-4d6a-9b4e-0b7356613de7</td>
1733
                                    </tr>
1734
                                    <tr class="DoNotShowInSimpleView">
1735
                                       <td>Assertion URI</td>
1736
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID995a45e5-7608-4529-9a30-29b4f2beb0c4" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID995a45e5-7608-4529-9a30-29b4f2beb0c4'); return false;">Link</a></td>
1737
                                    </tr>
1738
                                 </tbody>
1739
                              </table><br><div class="ReportDetail Expression"><label for="EID995a45e5-7608-4529-9a30-29b4f2beb0c4.expression">Expression:</label><textarea id="EID995a45e5-7608-4529-9a30-29b4f2beb0c4.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $regex_integer := '(^\d{1,40}$)'
1740
let $messages :=
1741
        (for $record in $records
1742
                let $countResolutions := count($record/gmd:identificationInfo[1]/*/gmd:spatialResolution)
1743
                let $countScale := count($record/gmd:identificationInfo[1]/*/gmd:spatialResolution/gmd:MD_Resolution/gmd:equivalentScale)
1744
                let $countDistance := count($record/gmd:identificationInfo[1]/*/gmd:spatialResolution/gmd:MD_Resolution/gmd:distance)
1745
                let $invalidScale :=
1746
                        for $x in $record/gmd:identificationInfo[1]/*/gmd:spatialResolution/gmd:MD_Resolution/gmd:equivalentScale/gmd:MD_RepresentativeFraction/gmd:denominator/gco:Integer
1747
                        return
1748
                        if(matches($x/text(), $regex_integer)) then ()
1749
                        else $x
1750
                let $invalidDistance :=
1751
                        for $x in $record/gmd:identificationInfo[1]/*/gmd:spatialResolution/gmd:MD_Resolution/gmd:distance/gco:Distance
1752
                        return
1753
                        if(xs:double($x/text())) then ()
1754
                        else $x
1755
                let $rid := $record/gmd:fileIdentifier/*/text()
1756
                return
1757
                if (($countResolutions &gt; 0) and ($countScale = 0) and ($countDistance = 0)) then
1758
                        local:addMessage('TR.noResolutions', map { 'filename': local:filename($record), 'id': $rid })
1759
                else if(count($invalidScale) != 0) then
1760
                        local:addMessage('TR.invalidScale', map { 'filename': local:filename($record), 'id': $rid, 'invalid': fn:string-join($invalidScale,'; ')})
1761
                else if(count($invalidDistance) != 0) then
1762
                        local:addMessage('TR.invalidDistance', map { 'filename': local:filename($record), 'id': $rid, 'invalid': fn:string-join($invalidDistance,'; ')})
1763
                else
1764
                        for $spatialResolution in $record/gmd:identificationInfo[1]/*/gmd:spatialResolution
1765
                        return
1766
                        if (count($spatialResolution/gmd:MD_Resolution/gmd:equivalentScale) &gt; 0 and count($spatialResolution/gmd:MD_Resolution/gmd:distance) &gt; 0) then
1767
                                local:addMessage('TR.mixedResolutions', map { 'filename': local:filename($record), 'id': $rid })
1768
                        else ()
1769
        )[position() le $limitErrors]
1770
return
1771
(if ($messages) then 'FAILED' else 'PASSED',
1772
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1773
 $messages)</textarea></div>
1774
                           </div>
1775
                        </div>
1776
                        <div data-role="collapsible" data-enhanced="true" id="EID191433b7-413b-4ba0-b4a6-72bafbe7662e" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1777
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.6: Resource Language<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1778
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that a resource language is provided.</p>
1779
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/resource-language" target="_blank">Resource Language</a></p><br><br><table>
1780
                                 <tbody>
1781
                                    <tr>
1782
                                       <td>Status</td>
1783
                                       <td>Passed</td>
1784
                                    </tr>
1785
                                    <tr>
1786
                                       <td>Duration</td>
1787
                                       <td>0.001 s</td>
1788
                                    </tr>
1789
                                    <tr class="ReportDetail">
1790
                                       <td>Assertion ID</td>
1791
                                       <td>EID095d416e-3dfe-4936-83d4-71028e3d0c4c</td>
1792
                                    </tr>
1793
                                    <tr class="DoNotShowInSimpleView">
1794
                                       <td>Assertion URI</td>
1795
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID191433b7-413b-4ba0-b4a6-72bafbe7662e" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID191433b7-413b-4ba0-b4a6-72bafbe7662e'); return false;">Link</a></td>
1796
                                    </tr>
1797
                                 </tbody>
1798
                              </table><br><div class="ReportDetail Expression"><label for="EID191433b7-413b-4ba0-b4a6-72bafbe7662e.expression">Expression:</label><textarea id="EID191433b7-413b-4ba0-b4a6-72bafbe7662e.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $codes := ('aar','abk','ace','ach','ada','ady','afa','afh','afr','ain','aka','akk','alb','ale','alg','alt','amh','ang','anp','apa','ara','arc','arg','arm','arn','arp','art','arw','asm','ast','ath','aus','ava','ave','awa','aym','aze','bad','bai','bak','bal','bam','ban','baq','bas','bat','bej','bel','bem','ben','ber','bho','bih','bik','bin','bis','bla','bnt','bos','bra','bre','btk','bua','bug','bul','bur','byn','cad','cai','car','cat','cau','ceb','cel','cha','chb','che','chg','chi','chk','chm','chn','cho','chp','chr','chu','chv','chy','cmc','cop','cor','cos','cpe','cpf','cpp','cre','crh','crp','csb','cus','cze','dak','dan','dar','day','del','den','dgr','din','div','doi','dra','dsb','dua','dum','dut','dyu','dzo','efi','egy','eka','elx','eng','enm','epo','est','ewe','ewo','fan','fao','fat','fij','fil','fin','fiu','fon','fre','frm','fro','frr','frs','fry','ful','fur','gaa','gay','gba','gem','geo','ger','gez','gil','gla','gle','glg','glv','gmh','goh','gon','gor','got','grb','grc','gre','grn','gsw','guj','gwi','hai','hat','hau','haw','heb','her','hil','him','hin','hit','hmn','hmo','hrv','hsb','hun','hup','iba','ibo','ice','ido','iii','ijo','iku','ile','ilo','ina','inc','ind','ine','inh','ipk','ira','iro','ita','jav','jbo','jpn','jpr','jrb','kaa','kab','kac','kal','kam','kan','kar','kas','kau','kaw','kaz','kbd','kha','khi','khm','kho','kik','kin','kir','kmb','kok','kom','kon','kor','kos','kpe','krc','krl','kro','kru','kua','kum','kur','kut','lad','lah','lam','lao','lat','lav','lez','lim','lin','lit','lol','loz','ltz','lua','lub','lug','lui','lun','luo','lus','mac','mad','mag','mah','mai','mak','mal','man','mao','map','mar','mas','may','mdf','mdr','men','mga','mic','min','mis','mkh','mlg','mlt','mnc','mni','mno','moh','mon','mos','mul','mun','mus','mwl','mwr','myn','myv','nah','nai','nap','nau','nav','nbl','nde','ndo','nds','nep','new','nia','nia','nic','niu','nno','nob','nog','non','nor','nqo','nso','nub','nwc','nya','nym','nyn','nyo','nzi','oci','oji','ori','orm','osa','oss','ota','oto','paa','pag','pal','pam','pan','pap','pau','peo','per','phi','phn','pli','pol','pon','por','pra','pro','pus','qaa-qtz','que','raj','rap','rar','roa','roh','rom','rum','run','rup','rus','sad','sag','sah','sai','sal','sam','san','sas','sat','scn','sco','sel','sem','sga','sgn','shn','sid','sin','sio','sit','sla','slo','slv','sma','sme','smi','smj','smn','smo','sms','sna','snd','snk','sog','som','son','sot','spa','srd','srn','srp','srr','ssa','ssw','suk','sun','sus','sux','swa','swe','syc','syr','tah','tai','tam','tat','tel','tem','ter','tet','tgk','tgl','tha','tib','tig','tir','tiv','tkl','tlh','tli','tmh','tog','ton','tpi','tsi','tsn','tso','tuk','tum','tup','tur','tut','tvl','twi','tyv','udm','uga','uig','ukr','umb','und','urd','uzb','vai','ven','vie','vol','vot','wak','wal','war','was','wel','wen','wln','wol','xal','xho','yao','yap','yid','yor','ypk','zap','zbl','zen','zha','znd','zul','zun','zxx','zza')
1799
let $messages :=            
1800
        (for $record in $records                     
1801
                let $rid := $record/gmd:fileIdentifier/*/text()
1802
                let $languageCodes := $record/gmd:identificationInfo[1]/*/gmd:language/gmd:LanguageCode                  
1803
                return
1804
                if (not($languageCodes)) then
1805
                        local:addMessage('TR.noLanguageCode',  map { 'filename': local:filename($record), 'id': $rid })
1806
                else                 
1807
                        let $wrongCodeValues := $languageCodes/@codeListValue[not(. = $codes)]
1808
                        let $wrongCodeList := $languageCodes/@codeList[not(. = 'http://www.loc.gov/standards/iso639-2/')]
1809
                        return
1810
                        if ($wrongCodeValues) then
1811
                                local:addMessage('TR.invalidLanguageCode',  map { 'filename': local:filename($record), 'id': $rid, 'invalidCodes' : string-join($wrongCodeValues,', ') })
1812
                        else if($wrongCodeList) then
1813
                                local:addMessage('TR.wrongCodeList_Param',  map { 'filename': local:filename($record), 'id': $rid, 'param': 'http://www.loc.gov/standards/iso639-2/'})
1814
                        else ()             
1815
        )[position() le $limitErrors]
1816
return
1817
(if ($messages) then 'FAILED' else 'PASSED',
1818
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1819
 $messages)</textarea></div>
1820
                           </div>
1821
                        </div>
1822
                        <div data-role="collapsible" data-enhanced="true" id="EID2a96c2fa-ffa3-4854-845c-9ac3ea1454c5" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1823
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.7: Topic Category<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1824
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that at least one Topic category describing the category of the resource is provided.</p>
1825
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/topic-category" target="_blank">Topic Category</a></p><br><br><table>
1826
                                 <tbody>
1827
                                    <tr>
1828
                                       <td>Status</td>
1829
                                       <td>Passed</td>
1830
                                    </tr>
1831
                                    <tr>
1832
                                       <td>Duration</td>
1833
                                       <td>0.001 s</td>
1834
                                    </tr>
1835
                                    <tr class="ReportDetail">
1836
                                       <td>Assertion ID</td>
1837
                                       <td>EIDae4bda0e-1dec-4e66-97b8-d4c43b66d2b8</td>
1838
                                    </tr>
1839
                                    <tr class="DoNotShowInSimpleView">
1840
                                       <td>Assertion URI</td>
1841
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID2a96c2fa-ffa3-4854-845c-9ac3ea1454c5" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID2a96c2fa-ffa3-4854-845c-9ac3ea1454c5'); return false;">Link</a></td>
1842
                                    </tr>
1843
                                 </tbody>
1844
                              </table><br><div class="ReportDetail Expression"><label for="EID2a96c2fa-ffa3-4854-845c-9ac3ea1454c5.expression">Expression:</label><textarea id="EID2a96c2fa-ffa3-4854-845c-9ac3ea1454c5.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $codes := ('biota','boundaries','climatologyMeteorologyAtmosphere','economy','elevation','environment','farming','geoscientificInformation','health','imageryBaseMapsEarthCover','inlandWaters','intelligenceMilitary','location','oceans','planningCadastre','society','structure','transportation','utilitiesCommunication')
1845
let $messages :=    
1846
    (for $record in $records
1847
        let $rid := $record/gmd:fileIdentifier/*/text()
1848
                let $topicCategories := $record/gmd:identificationInfo[1]/gmd:MD_DataIdentification/gmd:topicCategory
1849
        return
1850
                if (count($topicCategories) = 0) then
1851
            local:addMessage('TR.noTopicCategory',  map { 'filename': local:filename($record), 'id': $rid})
1852
        else
1853
                        for $topicCategory in $topicCategories
1854
                        return
1855
                        if(not($topicCategory/gmd:MD_TopicCategoryCode)) then
1856
                    local:addMessage('TR.noTopicCategory',  map { 'filename': local:filename($record), 'id': $rid})
1857
                        else if (not($topicCategory/gmd:MD_TopicCategoryCode = $codes)) then
1858
                local:addMessage('TR.invalidTopicCode',  map { 'filename': local:filename($record), 'id': $rid, 'invalidCodes' : $topicCategory/gmd:MD_TopicCategoryCode/text() })
1859
                        else()
1860
    )[position() le $limitErrors] 
1861
return
1862
(if ($messages) then 'FAILED' else 'PASSED',
1863
local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1864
$messages)</textarea></div>
1865
                           </div>
1866
                        </div>
1867
                     </div>
1868
                  </div>
1869
               </div>
1870
               <div data-role="collapsible" data-enhanced="true" id="EID646900b2-9564-44b9-8576-cfcab22e3419" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
1871
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">Distribution
1872
                        <div class="ui-li-count">4</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
1873
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Execute tests that apply for all dataset / dataset series metadata records on elements that are child elements of the section of the XML document: Distribution Information (property of the gmd:MD_Metadata element). This section contains information about who makes a resource available and how to get it.<br><br><table>
1874
                        <tbody>
1875
                           <tr>
1876
                              <td>Status</td>
1877
                              <td>Passed</td>
1878
                           </tr>
1879
                           <tr>
1880
                              <td>Duration</td>
1881
                              <td>1.564 s</td>
1882
                           </tr>
1883
                           <tr class="ReportDetail">
1884
                              <td>Test case ID</td>
1885
                              <td>EID646900b2-9564-44b9-8576-cfcab22e3419</td>
1886
                           </tr>
1887
                        </tbody>
1888
                     </table><br><div class="TestStepPlaceHolder">
1889
                        <div data-role="collapsible" data-enhanced="true" id="EID4b3e4051-2d07-4813-b99a-17eb503825bd" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1890
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.8: Resource Locator<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1891
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test if there is a resource or the url that points to a resource that provides additional information about the set data set or data set series.</p>
1892
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/resource-locator" target="_blank">Resource Locator</a></p><br><br><table>
1893
                                 <tbody>
1894
                                    <tr>
1895
                                       <td>Status</td>
1896
                                       <td>Passed</td>
1897
                                    </tr>
1898
                                    <tr>
1899
                                       <td>Duration</td>
1900
                                       <td>0.001 s</td>
1901
                                    </tr>
1902
                                    <tr class="ReportDetail">
1903
                                       <td>Assertion ID</td>
1904
                                       <td>EID4f536f56-3118-474e-81b4-c0e36344a70b</td>
1905
                                    </tr>
1906
                                    <tr class="DoNotShowInSimpleView">
1907
                                       <td>Assertion URI</td>
1908
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID4b3e4051-2d07-4813-b99a-17eb503825bd" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID4b3e4051-2d07-4813-b99a-17eb503825bd'); return false;">Link</a></td>
1909
                                    </tr>
1910
                                 </tbody>
1911
                              </table><br><div class="ReportDetail Expression"><label for="EID4b3e4051-2d07-4813-b99a-17eb503825bd.expression">Expression:</label><textarea id="EID4b3e4051-2d07-4813-b99a-17eb503825bd.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $regex_url := '(http://|https://|ftp://)([a-z0-9]{1})((\.[a-z0-9-])|([a-z0-9-]))*\.([a-z0-9-]{1,4})(/?)'
1912
let $messages :=         
1913
        (for $record in $records
1914
                let $rid := $record/gmd:fileIdentifier/*/text()
1915
                return
1916
                for $onLine in $record/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource
1917
                        let $url := $onLine/gmd:linkage/gmd:URL
1918
                        return
1919
            if (not(string-length($url/text()) != 0)) then
1920
                                local:addMessage('TR.linkageWithoutURL', map { 'filename': local:filename($record), 'id': $rid })
1921
                        else if (not(matches($url/text(), $regex_url))) then
1922
                                        local:addMessage('TR.invalidURL', map { 'filename': local:filename($record), 'id': $rid, 'url': $url/text()})
1923
                        else ()
1924
        )[position() le $limitErrors]
1925
return
1926
(if ($messages) then 'FAILED' else 'PASSED',
1927
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1928
 $messages)</textarea></div>
1929
                           </div>
1930
                        </div>
1931
                        <div data-role="collapsible" data-enhanced="true" id="EID09ecd5c8-63c7-48e0-a926-441feffd2455" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1932
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.9: Data Quality Info Section<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1933
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that one citation of the product specification or user requirement against which data is being evaluated is provided.</p>
1934
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/one-data-quality-element" target="_blank">Data Quality Info Section</a></p><br><br><table>
1935
                                 <tbody>
1936
                                    <tr>
1937
                                       <td>Status</td>
1938
                                       <td>Passed</td>
1939
                                    </tr>
1940
                                    <tr>
1941
                                       <td>Duration</td>
1942
                                       <td>0.001 s</td>
1943
                                    </tr>
1944
                                    <tr class="ReportDetail">
1945
                                       <td>Assertion ID</td>
1946
                                       <td>EIDc7ef6d4f-a03b-4797-85e2-3b4a49e0c5ff</td>
1947
                                    </tr>
1948
                                    <tr class="DoNotShowInSimpleView">
1949
                                       <td>Assertion URI</td>
1950
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID09ecd5c8-63c7-48e0-a926-441feffd2455" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID09ecd5c8-63c7-48e0-a926-441feffd2455'); return false;">Link</a></td>
1951
                                    </tr>
1952
                                 </tbody>
1953
                              </table><br><div class="ReportDetail Expression"><label for="EID09ecd5c8-63c7-48e0-a926-441feffd2455.expression">Expression:</label><textarea id="EID09ecd5c8-63c7-48e0-a926-441feffd2455.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=
1954
        (for $record in $records
1955
                let $rid := $record/gmd:fileIdentifier/*/text()
1956
                let $dataQuality := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality
1957
                let $levels := ('dataset', 'series')
1958
                let $MD_ScopeCode := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:scope/gmd:DQ_Scope/gmd:level/gmd:MD_ScopeCode
1959
                return          
1960
                if (count($dataQuality) != 1) then
1961
                        local:addMessage('TR.wrongNumberOfDataQuality', map { 'filename': local:filename($record), 'id': $rid })
1962
                else if (not($MD_ScopeCode/@codeListValue = $levels)) then
1963
                        local:addMessage('TR.invalidCodeList', map { 'filename': local:filename($record), 'id': $rid })
1964
                else ()
1965
        )[position() le $limitErrors]
1966
return
1967
(if ($messages) then 'FAILED' else 'PASSED',
1968
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1969
 $messages)</textarea></div>
1970
                           </div>
1971
                        </div>
1972
                        <div data-role="collapsible" data-enhanced="true" id="EIDdf1fe8d5-1ef2-4180-ade5-4e0fad447e57" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1973
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.10: Dataset Conformity<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
1974
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the metadata contains a citation of the implementing rules on interoperability of spatial data sets (Regulation 1089/2010).</p>
1975
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/conformity" target="_blank">Dataset Conformity</a></p>
1976
                                                                        <p>To fulfill this requirement, the evaluated metadata dataset shall be encoded according to the following common requirements of the Technical Guide:</p>
1977
                                                                        <p><a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/conformity" target="_blank"> Common ATS (C.20): 'Dataset Conformity'</a></p>
1978
                                                                        <p><a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/conformity-specification" target="_blank"> Common ATS (C.21): 'Dataset Conformity Specifications'</a></p>
1979
                                                                        <p><a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/conformity-degree" target="_blank"> Common ATS (C.22): 'Conformity Degree '</a></p><br><br><table>
1980
                                 <tbody>
1981
                                    <tr>
1982
                                       <td>Status</td>
1983
                                       <td>Passed</td>
1984
                                    </tr>
1985
                                    <tr>
1986
                                       <td>Duration</td>
1987
                                       <td>1.564 s</td>
1988
                                    </tr>
1989
                                    <tr class="ReportDetail">
1990
                                       <td>Assertion ID</td>
1991
                                       <td>EID8f663265-32b8-4c99-8997-2d40f6ce5b93</td>
1992
                                    </tr>
1993
                                    <tr class="DoNotShowInSimpleView">
1994
                                       <td>Assertion URI</td>
1995
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDdf1fe8d5-1ef2-4180-ade5-4e0fad447e57" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDdf1fe8d5-1ef2-4180-ade5-4e0fad447e57'); return false;">Link</a></td>
1996
                                    </tr>
1997
                                 </tbody>
1998
                              </table><br><div class="ReportDetail Expression"><label for="EIDdf1fe8d5-1ef2-4180-ade5-4e0fad447e57.expression">Expression:</label><textarea id="EIDdf1fe8d5-1ef2-4180-ade5-4e0fad447e57.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $enum_files := ('enum_bul', 'enum_cze', 'enum_dan', 'enum_dut', 'enum_eng', 'enum_est', 'enum_est', 'enum_fre', 'enum_fre', 'enum_ger', 'enum_gle', 'enum_gre', 'enum_hun', 'enum_ita', 'enum_lav', 'enum_lit', 'enum_mlt', 'enum_pol', 'enum_por', 'enum_rum', 'enum_slo', 'enum_slv', 'enum_spa', 'enum_swe')
1999
let $conformityText := for $x in $enum_files
2000
        return fn:doc(concat('http://inspire.ec.europa.eu/schemas/common/1.0/enums/', $x, '.xsd'))/xs:schema/xs:complexType[starts-with(@name, 'citationInspireInteroperabilityRegulation')]/xs:complexContent/xs:restriction[@base = 'citationConformity']/xs:sequence/xs:element[@name = 'Title']/xs:simpleType/xs:restriction/xs:enumeration/@value
2001
let $conformityTextLower := for $x in $conformityText return normalize-space(lower-case($x))
2002
let $messages :=
2003
        (for $record in $records
2004
                let $rid := $record/gmd:fileIdentifier/*/text()
2005
                let $confResults := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:title/*/text()[contains(.,'1089/2010')]
2006
        let $valid := 
2007
            (for $confResult in $confResults
2008
                return
2009
                if (normalize-space(lower-case($confResult)) = $conformityTextLower) then
2010
                    $confResult
2011
                else()
2012
            )
2013
                return
2014
                if (count($valid) = 0) then
2015
                        local:addMessage('TR.wrongNumberOfSpecificationForPurpose', map { 'filename': local:filename($record), 'id': $rid })
2016
                else()
2017
        )[position() le $limitErrors]
2018
return
2019
(if ($messages) then 'FAILED' else 'PASSED',
2020
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2021
 $messages)</textarea></div>
2022
                           </div>
2023
                        </div>
2024
                        <div data-role="collapsible" data-enhanced="true" id="EID653400c6-9a25-481e-84db-f223f9067858" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2025
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md datasets-and-series 1.11: Lineage<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
2026
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that exactly one explanation about the lineage of a dataset is provided.</p>
2027
                                                                        <p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/datasets-and-series/lineage" target="_blank">Lineage</a></p><br><br><table>
2028
                                 <tbody>
2029
                                    <tr>
2030
                                       <td>Status</td>
2031
                                       <td>Passed</td>
2032
                                    </tr>
2033
                                    <tr>
2034
                                       <td>Duration</td>
2035
                                       <td>0.001 s</td>
2036
                                    </tr>
2037
                                    <tr class="ReportDetail">
2038
                                       <td>Assertion ID</td>
2039
                                       <td>EID366b8ce9-9a73-47b8-96da-3d24166a0f3f</td>
2040
                                    </tr>
2041
                                    <tr class="DoNotShowInSimpleView">
2042
                                       <td>Assertion URI</td>
2043
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID653400c6-9a25-481e-84db-f223f9067858" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID653400c6-9a25-481e-84db-f223f9067858'); return false;">Link</a></td>
2044
                                    </tr>
2045
                                 </tbody>
2046
                              </table><br><div class="ReportDetail Expression"><label for="EID653400c6-9a25-481e-84db-f223f9067858.expression">Expression:</label><textarea id="EID653400c6-9a25-481e-84db-f223f9067858.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=    
2047
    (for $record in $records
2048
        let $rid := $record/gmd:fileIdentifier/*/text()
2049
                let $lineageStatement := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:lineage/gmd:LI_Lineage/gmd:statement
2050
        return   
2051
        if (count($lineageStatement) != 1) then
2052
            local:addMessage('TR.wrongNumberOfLineageStatements',  map { 'filename': local:filename($record), 'id': $rid, 'count': string(count($lineageStatement)) })
2053
        else if (not($lineageStatement) or not(string-length($lineageStatement/gco:CharacterString/text()) != 0 or string-length($lineageStatement/gmx:Anchor/text()) != 0)) then
2054
            local:addMessage('TR.emptyLineageStatement',  map { 'filename': local:filename($record), 'id': $rid })
2055
        else ()         
2056
    )[position() le $limitErrors] 
2057
return
2058
(if ($messages) then 'FAILED' else 'PASSED',
2059
local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2060
$messages)</textarea></div>
2061
                           </div>
2062
                        </div>
2063
                     </div>
2064
                  </div>
2065
               </div>
2066
            </div>
2067
         </div>
2068
         <div class="TestSuite" data-role="collapsible" data-theme="h" data-content-theme="h">
2069
            <h2>Conformance Class 2: INSPIRE data sets and data set series interoperability metadata.
2070
               <div class="ui-li-count">4</div>
2071
            </h2>This test suite examines metadata records against the requirements for metadata in INSPIRE.<br/><br/><b>This is a draft version. It has limitations and is expected to contain errors.</b> Please report any issues or problems <a href="https://github.com/inspire-eu-validation/community/wiki/Your-feedback" target="_blank">in GitHub</a>.<br/><br/>        
2072
Known limitations are documented in the description of the applicable test case or test assertion.<br/><br/>
2073
There is a general limitation in all assertions that polymorphism and containment by reference (see the <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/common/README#ref_TG_MD" target="_blank">Technical Guidance</a>, sub-clauses A.3, A.4 and A.5) are not supported. However, the current Abstract Test Suite does not support polymorphism and references either (all XPath expressions do not support polymorhism or references; in addition, schema validation is only executed against the ISO/OGC schemas without extensions). It is therefore unclear if this is really a limitation or if the sections in the technical guidance are outdated.
2074
<br/><br/>
2075
Source: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/isdss" target="_blank">Conformance Class 2: 'INSPIRE data sets and data set series interoperability metadata'</a><br/><br/>
2076
Pre-requisite conformance classes: Conformance Class 1<br><br><table>
2077
               <tbody>
2078
                  <tr>
2079
                     <td>Status</td>
2080
                     <td>Passed</td>
2081
                  </tr>
2082
                  <tr>
2083
                     <td>Duration</td>
2084
                     <td>0.001 s</td>
2085
                  </tr>
2086
                  <tr class="ReportDetail">
2087
                     <td>Test suite ID</td>
2088
                     <td>EID2be1480a-fe42-40b2-9420-eb0e69385c80</td>
2089
                  </tr>
2090
                  <tr class="ReportDetail">
2091
                     <td>Author</td>
2092
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
2093
                  </tr>
2094
                  <tr class="ReportDetail">
2095
                     <td>Date created</td>
2096
                     <td>30/06/2018 00:00:00 GMT</td>
2097
                  </tr>
2098
                  <tr>
2099
                     <td>Version</td>
2100
                     <td>0.1.0</td>
2101
                  </tr>
2102
                  <tr class="ReportDetail">
2103
                     <td>Last editor</td>
2104
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
2105
                  </tr>
2106
                  <tr class="ReportDetail">
2107
                     <td>Last updated</td>
2108
                     <td>30/08/2018 20:45:00 GMT</td>
2109
                  </tr>
2110
                  <tr class="ReportDetail">
2111
                     <td>Reference</td>
2112
                     <td><a class="ui-link" href="https://github.com/inspire-eu-validation/ets-repository/tree/master/metadata/2.0">Link</a></td>
2113
                  </tr>
2114
                  <tr class="ReportDetail">
2115
                     <td>Hash</td>
2116
                     <td>CBF29CE484222325</td>
2117
                  </tr>
2118
               </tbody>
2119
            </table><br><div class="TestModulePlaceHolder">
2120
               <div data-role="collapsible" data-enhanced="true" id="EID57034804-54da-448a-ac31-6ee56b93a82b" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
2121
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">General Metadata
2122
                        <div class="ui-li-count">3</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
2123
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Execute tests that apply for all dataset / dataset series metadata records on elements 
2124
                                        that are directly child elements of the root node of the XML document: MD_Metadata node.<br><br><table>
2125
                        <tbody>
2126
                           <tr>
2127
                              <td>Status</td>
2128
                              <td>Passed</td>
2129
                           </tr>
2130
                           <tr>
2131
                              <td>Duration</td>
2132
                              <td>0.001 s</td>
2133
                           </tr>
2134
                           <tr class="ReportDetail">
2135
                              <td>Test case ID</td>
2136
                              <td>EID57034804-54da-448a-ac31-6ee56b93a82b</td>
2137
                           </tr>
2138
                        </tbody>
2139
                     </table><br><div class="TestStepPlaceHolder">
2140
                        <div data-role="collapsible" data-enhanced="true" id="EID4137f859-7dc6-4b08-a181-f3bff600de68" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2141
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md isdss 2.1: Coordinate Reference System<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
2142
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the coordinate reference system identifiers are provided.</p>
2143
<p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/isdss/crs" target="_blank">Coordinate Reference System</a></p><br><br><table>
2144
                                 <tbody>
2145
                                    <tr>
2146
                                       <td>Status</td>
2147
                                       <td>Passed</td>
2148
                                    </tr>
2149
                                    <tr>
2150
                                       <td>Duration</td>
2151
                                       <td>0.001 s</td>
2152
                                    </tr>
2153
                                    <tr class="ReportDetail">
2154
                                       <td>Assertion ID</td>
2155
                                       <td>EID02c29a8c-874b-4fa6-b08d-75a0759d85a3</td>
2156
                                    </tr>
2157
                                    <tr class="DoNotShowInSimpleView">
2158
                                       <td>Assertion URI</td>
2159
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID4137f859-7dc6-4b08-a181-f3bff600de68" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID4137f859-7dc6-4b08-a181-f3bff600de68'); return false;">Link</a></td>
2160
                                    </tr>
2161
                                 </tbody>
2162
                              </table><br><div class="ReportDetail Expression"><label for="EID4137f859-7dc6-4b08-a181-f3bff600de68.expression">Expression:</label><textarea id="EID4137f859-7dc6-4b08-a181-f3bff600de68.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=  
2163
        (for $record in $records
2164
                let $rid := $record/gmd:fileIdentifier/*/text()
2165
                let $crsIdentifiers := $record/gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier
2166
                return                          
2167
                if (count($crsIdentifiers) = 0)  then
2168
                        local:addMessage('TR.noCrsIdentifier', map { 'filename': local:filename($record), 'id': $rid })
2169
                else                         
2170
                        for $crs in $crsIdentifiers
2171
                                let $code := $crs/gmd:code
2172
                                let $codeSpace := $crs/gmd:codeSpace
2173
                                 return
2174
                if (not($code) or not(string-length($code/gco:CharacterString/text()) != 0 or string-length($code/gmx:Anchor/text()) != 0)) then
2175
                                        local:addMessage('TR.noCrsCode',  map { 'filename': local:filename($record), 'id': $rid})
2176
                else if ($codeSpace and not(string-length($codeSpace/gco:CharacterString/text()) != 0 or string-length($codeSpace/gmx:Anchor/text()) != 0)) then
2177
                                        local:addMessage('TR.noCrsCodeSpace',  map { 'filename': local:filename($record), 'id': $rid})
2178
                                else ()         
2179
        )[position() le $limitErrors] 
2180
return
2181
(if ($messages) then 'FAILED' else 'PASSED',
2182
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2183
 $messages)</textarea></div>
2184
                           </div>
2185
                        </div>
2186
                        <div data-role="collapsible" data-enhanced="true" id="EIDf2bd1f5e-3e08-4fcd-b9ff-ad14cabd1d7c" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2187
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md isdss 2.2: Coordinate Reference System Identifiers<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
2188
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the default coordinate reference systems uses a correct identifier.</p>
2189
<p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/isdss/crs-id" target="_blank">Coordinate Reference System Identifiers</a></p><br><br><table>
2190
                                 <tbody>
2191
                                    <tr>
2192
                                       <td>Status</td>
2193
                                       <td>Passed</td>
2194
                                    </tr>
2195
                                    <tr>
2196
                                       <td>Duration</td>
2197
                                       <td>0.001 s</td>
2198
                                    </tr>
2199
                                    <tr class="ReportDetail">
2200
                                       <td>Assertion ID</td>
2201
                                       <td>EID9cc67cd3-19cf-4475-b2aa-dcbedab9f685</td>
2202
                                    </tr>
2203
                                    <tr class="DoNotShowInSimpleView">
2204
                                       <td>Assertion URI</td>
2205
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDf2bd1f5e-3e08-4fcd-b9ff-ad14cabd1d7c" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDf2bd1f5e-3e08-4fcd-b9ff-ad14cabd1d7c'); return false;">Link</a></td>
2206
                                    </tr>
2207
                                 </tbody>
2208
                              </table><br><div class="ReportDetail Expression"><label for="EIDf2bd1f5e-3e08-4fcd-b9ff-ad14cabd1d7c.expression">Expression:</label><textarea id="EIDf2bd1f5e-3e08-4fcd-b9ff-ad14cabd1d7c.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $urlOpengis := 'http://www.opengis.net/def/crs/EPSG/0/'
2209
let $epsgCodes := ('4936','4937','4258','3035','3034','3038','3039','3040','3041','3042','3043','3044','3045','3046','3047','3048','3049','3050','3051','5730','5861','5715','7409')
2210
let $httpURIIdentifier :=
2211
        for $x in $epsgCodes
2212
        return
2213
        concat($urlOpengis, $x)
2214
let $messages :=          
2215
        (for $record in $records
2216
                let $rid := $record/gmd:fileIdentifier/*/text()
2217
                let $crsIdentifiers := $record/gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier
2218
                return
2219
                        for $crs in $crsIdentifiers
2220
                                let $code := $crs/gmd:code
2221
                                let $codeSpace := $crs/gmd:codeSpace
2222
                                let $defaultEpsgCode :=
2223
                                        for $x in $epsgCodes
2224
                                                return
2225
                                                if(contains($code/gco:CharacterString/text(), $x)) then $code/gco:CharacterString
2226
                                                else if(contains($code/gmx:Anchor/text(), $x)) then $code/gmx:Anchor/@xlink:href
2227
                                                else ()
2228
                                 return
2229
                                if (not(count($defaultEpsgCode) = 0)) then
2230
                                        if (not($code[gco:CharacterString = $httpURIIdentifier] or $code[gmx:Anchor/@xlink:href = $httpURIIdentifier])) then
2231
                                                local:addMessage('TR.invalidCrsCode',  map { 'filename': local:filename($record), 'id': $rid })
2232
                                        else if($codeSpace) then
2233
                                                local:addMessage('TR.invalidCrsCode',  map { 'filename': local:filename($record), 'id': $rid })
2234
                                        else ()
2235
                                else ()
2236
        )[position() le $limitErrors] 
2237
return
2238
(if ($messages) then 'FAILED' else 'PASSED',
2239
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2240
 $messages)</textarea></div>
2241
                           </div>
2242
                        </div>
2243
                        <div data-role="collapsible" data-enhanced="true" id="EID050b3e7f-1895-4441-8b79-39cc04a328c4" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2244
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md isdss 2.3: Temporal Reference Systems<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
2245
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test if the temporal reference system(s) is provided correctly.</p>
2246
<p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/isdss/temporal-rs" target="_blank">Temporal Reference Systems</a></p><br><br><table>
2247
                                 <tbody>
2248
                                    <tr>
2249
                                       <td>Status</td>
2250
                                       <td>Passed</td>
2251
                                    </tr>
2252
                                    <tr>
2253
                                       <td>Duration</td>
2254
                                       <td>0.001 s</td>
2255
                                    </tr>
2256
                                    <tr class="ReportDetail">
2257
                                       <td>Assertion ID</td>
2258
                                       <td>EIDef8d3d22-be0f-4618-88a2-2bc0bbfc8077</td>
2259
                                    </tr>
2260
                                    <tr class="DoNotShowInSimpleView">
2261
                                       <td>Assertion URI</td>
2262
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID050b3e7f-1895-4441-8b79-39cc04a328c4" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID050b3e7f-1895-4441-8b79-39cc04a328c4'); return false;">Link</a></td>
2263
                                    </tr>
2264
                                 </tbody>
2265
                              </table><br><div class="ReportDetail Expression"><label for="EID050b3e7f-1895-4441-8b79-39cc04a328c4.expression">Expression:</label><textarea id="EID050b3e7f-1895-4441-8b79-39cc04a328c4.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=          
2266
        (for $record in $records
2267
                let $rid := $record/gmd:fileIdentifier/*/text()
2268
                let $crsIdentifiers := $record/gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier
2269
                return
2270
                if (not($crsIdentifiers)) then
2271
                                local:addMessage('TR.noCrsCode',  map { 'filename': local:filename($record), 'id': $rid })
2272
                else
2273
                        for $crs in $crsIdentifiers
2274
                        let $code := $crs/gmd:code
2275
                        let $codeSpace := $crs/gmd:codeSpace
2276
                        return
2277
            if (not($code) or not(string-length($code/gco:CharacterString/text()) != 0 or string-length($code/gmx:Anchor/text()) != 0)) then
2278
                                local:addMessage('TR.noCrsCode',  map { 'filename': local:filename($record), 'id': $rid })
2279
            else if (($codeSpace) and not(string-length($codeSpace/gco:CharacterString/text()) != 0 or string-length($codeSpace/gmx:Anchor/text()) != 0)) then
2280
                                local:addMessage('TR.noCrsCodeSpace',  map { 'filename': local:filename($record), 'id': $rid })
2281
                        else ()                
2282
        )[position() le $limitErrors] 
2283
return
2284
(if ($messages) then 'FAILED' else 'PASSED',
2285
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2286
 $messages)</textarea></div>
2287
                           </div>
2288
                        </div>
2289
                     </div>
2290
                  </div>
2291
               </div>
2292
               <div data-role="collapsible" data-enhanced="true" id="EID8d0318a3-c5e9-45d5-b3af-8c054b0068f5" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
2293
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">Identification
2294
                        <div class="ui-li-count">2</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
2295
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Execute tests that apply for all dataset / dataset series metadata records on 
2296
                                        elements that are child elements of the section of the XML document: Identification Info 
2297
                                        (property of the gmd:MD_Metadata element). This section contains information specific to the dataset / dataset series.<br><br><table>
2298
                        <tbody>
2299
                           <tr>
2300
                              <td>Status</td>
2301
                              <td>Passed</td>
2302
                           </tr>
2303
                           <tr>
2304
                              <td>Duration</td>
2305
                              <td>0.001 s</td>
2306
                           </tr>
2307
                           <tr class="ReportDetail">
2308
                              <td>Test case ID</td>
2309
                              <td>EID8d0318a3-c5e9-45d5-b3af-8c054b0068f5</td>
2310
                           </tr>
2311
                        </tbody>
2312
                     </table><br><div class="TestStepPlaceHolder">
2313
                        <div data-role="collapsible" data-enhanced="true" id="EIDda7f20a6-ceeb-425d-a591-893a07e4408b" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2314
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md isdss 2.4: Spatial Representation Type<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
2315
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test the type of spatial representation of the data.</p>
2316
<p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/isdss/spatial-representation-type" target="_blank">Spatial Representation Type</a></p><br><br><table>
2317
                                 <tbody>
2318
                                    <tr>
2319
                                       <td>Status</td>
2320
                                       <td>Passed</td>
2321
                                    </tr>
2322
                                    <tr>
2323
                                       <td>Duration</td>
2324
                                       <td>0.001 s</td>
2325
                                    </tr>
2326
                                    <tr class="ReportDetail">
2327
                                       <td>Assertion ID</td>
2328
                                       <td>EIDf330358c-8d29-4069-976a-3afb9590ea51</td>
2329
                                    </tr>
2330
                                    <tr class="DoNotShowInSimpleView">
2331
                                       <td>Assertion URI</td>
2332
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDda7f20a6-ceeb-425d-a591-893a07e4408b" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDda7f20a6-ceeb-425d-a591-893a07e4408b'); return false;">Link</a></td>
2333
                                    </tr>
2334
                                 </tbody>
2335
                              </table><br><div class="ReportDetail Expression"><label for="EIDda7f20a6-ceeb-425d-a591-893a07e4408b.expression">Expression:</label><textarea id="EIDda7f20a6-ceeb-425d-a591-893a07e4408b.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $codes := ('vector','grid','tin','textTable')
2336
let $messages :=          
2337
        (for $record in $records
2338
                let $rid := $record/gmd:fileIdentifier/*/text()
2339
                let $spatialRepTypeCodes := $record/gmd:identificationInfo[1]/gmd:MD_DataIdentification/gmd:spatialRepresentationType/gmd:MD_SpatialRepresentationTypeCode
2340
                return                                          
2341
                if (count($spatialRepTypeCodes) = 0)  then
2342
                        local:addMessage('TR.spatialRepTypeCodes', map { 'filename': local:filename($record), 'id': $rid })
2343
                else 
2344
                        for $typeCode in $spatialRepTypeCodes
2345
                                let $codeListValue := $typeCode/@codeListValue
2346
                                let $invalidCodeValues := $codeListValue[not(. = $codes)]
2347
                                return
2348
                                if ($invalidCodeValues)  then
2349
                                        local:addMessage('TR.invalidSpatialRepresentationCode', map { 'filename': local:filename($record), 'id': $rid })                                
2350
                                else ()                 
2351
        )[position() le $limitErrors] 
2352
return
2353
(if ($messages) then 'FAILED' else 'PASSED',
2354
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2355
 $messages)</textarea></div>
2356
                           </div>
2357
                        </div>
2358
                        <div data-role="collapsible" data-enhanced="true" id="EIDece4b46b-2d5e-45ed-9c7e-17e28e1d7b21" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2359
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md isdss 2.5: Character Encoding<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
2360
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the character encoding for data sets and series is provided correctly.</p>
2361
<p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/isdss/character-encoding" target="_blank">Character Encoding</a></p><br><br><table>
2362
                                 <tbody>
2363
                                    <tr>
2364
                                       <td>Status</td>
2365
                                       <td>Passed</td>
2366
                                    </tr>
2367
                                    <tr>
2368
                                       <td>Duration</td>
2369
                                       <td>0.001 s</td>
2370
                                    </tr>
2371
                                    <tr class="ReportDetail">
2372
                                       <td>Assertion ID</td>
2373
                                       <td>EID83d11da2-265d-4080-bdc3-c25a325b824d</td>
2374
                                    </tr>
2375
                                    <tr class="DoNotShowInSimpleView">
2376
                                       <td>Assertion URI</td>
2377
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EIDece4b46b-2d5e-45ed-9c7e-17e28e1d7b21" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDece4b46b-2d5e-45ed-9c7e-17e28e1d7b21'); return false;">Link</a></td>
2378
                                    </tr>
2379
                                 </tbody>
2380
                              </table><br><div class="ReportDetail Expression"><label for="EIDece4b46b-2d5e-45ed-9c7e-17e28e1d7b21.expression">Expression:</label><textarea id="EIDece4b46b-2d5e-45ed-9c7e-17e28e1d7b21.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $codes := ('ucs2','ucs4','utf7','utf8','8859part1','8859part2','8859part3','8859part4','8859part5','8859part6','8859part7','8859part8','8859part9','8859part10','8859part11','8859part12','8859part13','8859part14','8859part15','8859part16','jis','shiftJIS','eucJP','usAscii','eucKR','big5','GB2312')
2381
let $messages :=                  
2382
        (for $record in $records
2383
                let $rid := $record/gmd:fileIdentifier/*/text()
2384
                let $characterCodes := $record/gmd:identificationInfo[1]/gmd:MD_DataIdentification/gmd:characterSet/gmd:MD_CharacterSetCode
2385
                return                                                                                  
2386
                        for $characterCode in $characterCodes
2387
                                let $codeListValue := $characterCode/@codeListValue
2388
                                let $invalidCodeValues := $codeListValue[not(. = $codes)]
2389
                                return
2390
                                if ($invalidCodeValues) then
2391
                                        local:addMessage('TR.invalidEncodingCode', map { 'filename': local:filename($record), 'id': $rid})
2392
                                else ()                         
2393
        )[position() le $limitErrors] 
2394
return
2395
(if ($messages) then 'FAILED' else 'PASSED',
2396
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2397
 $messages)</textarea></div>
2398
                           </div>
2399
                        </div>
2400
                     </div>
2401
                  </div>
2402
               </div>
2403
               <div data-role="collapsible" data-enhanced="true" id="EIDde81899f-3d21-4795-926e-93a731d68edf" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
2404
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">Distribution
2405
                        <div class="ui-li-count">1</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
2406
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Execute tests that apply for all dataset / dataset series metadata records on elements that are child 
2407
                                        elements of the section of the XML document: Distribution Information (property of the gmd:MD_Metadata element). 
2408
                                        This section contains information about who makes a resource available and how to get it.<br><br><table>
2409
                        <tbody>
2410
                           <tr>
2411
                              <td>Status</td>
2412
                              <td>Passed</td>
2413
                           </tr>
2414
                           <tr>
2415
                              <td>Duration</td>
2416
                              <td>0.001 s</td>
2417
                           </tr>
2418
                           <tr class="ReportDetail">
2419
                              <td>Test case ID</td>
2420
                              <td>EIDde81899f-3d21-4795-926e-93a731d68edf</td>
2421
                           </tr>
2422
                        </tbody>
2423
                     </table><br><div class="TestStepPlaceHolder">
2424
                        <div data-role="collapsible" data-enhanced="true" id="EID807a8386-5e3a-4cf2-870c-2bfe821d9b2e" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2425
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md isdss 2.6: Data Encoding<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
2426
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Evaluate encoding and the storage or transmission format for data sets and series.</p>
2427
<p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/isdss/data-encoding" target="_blank">Data Encoding</a></p><br><br><table>
2428
                                 <tbody>
2429
                                    <tr>
2430
                                       <td>Status</td>
2431
                                       <td>Passed</td>
2432
                                    </tr>
2433
                                    <tr>
2434
                                       <td>Duration</td>
2435
                                       <td>0.001 s</td>
2436
                                    </tr>
2437
                                    <tr class="ReportDetail">
2438
                                       <td>Assertion ID</td>
2439
                                       <td>EID67230a54-f9b0-49d9-8928-fc5cf5d3ea8a</td>
2440
                                    </tr>
2441
                                    <tr class="DoNotShowInSimpleView">
2442
                                       <td>Assertion URI</td>
2443
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID807a8386-5e3a-4cf2-870c-2bfe821d9b2e" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID807a8386-5e3a-4cf2-870c-2bfe821d9b2e'); return false;">Link</a></td>
2444
                                    </tr>
2445
                                 </tbody>
2446
                              </table><br><div class="ReportDetail Expression"><label for="EID807a8386-5e3a-4cf2-870c-2bfe821d9b2e.expression">Expression:</label><textarea id="EID807a8386-5e3a-4cf2-870c-2bfe821d9b2e.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=
2447
        (for $record in $records
2448
                let $rid := $record/gmd:fileIdentifier/*/text()
2449
                let $distFormats := $record/gmd:distributionInfo[1]/gmd:MD_Distribution/gmd:distributionFormat
2450
                return
2451
                if (count($distFormats) = 0) then
2452
                        local:addMessage('TR.noDistFormat', map { 'filename': local:filename($record), 'id': $rid })
2453
                else
2454
                        for $format in $distFormats
2455
                                let $name := $format/gmd:MD_Format/gmd:name
2456
                                let $version := $format/gmd:MD_Format/gmd:version
2457
                                return
2458
                if (not($name) or not(string-length($name/gco:CharacterString/text()) != 0 or string-length($name/gmx:Anchor/text()) != 0)) then
2459
                                        local:addMessage('TR.emptyName', map { 'filename': local:filename($record), 'id': $rid })
2460
                                else if(string-length(normalize-space($version/*/text())) != 0) then
2461
                    if (not($version) or not(string-length($version/gco:CharacterString/text()) != 0 or string-length($version/gmx:Anchor/text()) != 0)) then
2462
                                                local:addMessage('TR.emptyVersion', map { 'filename': local:filename($record), 'id': $rid })         
2463
                                        else ()
2464
                                else
2465
                                        if (not($version/@gco:nilReason = 'unknown' or $version/@gco:nilReason = 'inapplicable')) then
2466
                                                local:addMessage('TR.invalidVersion', map { 'filename': local:filename($record), 'id': $rid }) 
2467
                                        else () 
2468
        )[position() le $limitErrors] 
2469
return
2470
(if ($messages) then 'FAILED' else 'PASSED',
2471
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2472
 $messages)</textarea></div>
2473
                           </div>
2474
                        </div>
2475
                     </div>
2476
                  </div>
2477
               </div>
2478
               <div data-role="collapsible" data-enhanced="true" id="EIDb7cf88c8-4ebe-4fdb-93e6-58794455c3fa" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
2479
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">Data Quality
2480
                        <div class="ui-li-count">2</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
2481
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Execute tests that apply for all dataset / dataset series metadata records on elements that are child 
2482
                                        elements of the section of the XML document: Data Quality Information (property of the gmd:MD_Metadata element). 
2483
                                        This section contains information specific to the quality and lineage (including processing steps and sources) of the 
2484
                                        resource.<br><br><table>
2485
                        <tbody>
2486
                           <tr>
2487
                              <td>Status</td>
2488
                              <td>Passed</td>
2489
                           </tr>
2490
                           <tr>
2491
                              <td>Duration</td>
2492
                              <td>0.001 s</td>
2493
                           </tr>
2494
                           <tr class="ReportDetail">
2495
                              <td>Test case ID</td>
2496
                              <td>EIDb7cf88c8-4ebe-4fdb-93e6-58794455c3fa</td>
2497
                           </tr>
2498
                        </tbody>
2499
                     </table><br><div class="TestStepPlaceHolder">
2500
                        <div data-role="collapsible" data-enhanced="true" id="EID3c66a367-9f4c-45dd-a585-27f1b6972f53" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2501
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md isdss 2.7: Topological Consistency Quantitative Results<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
2502
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the topological consistency quantitative results is provided correctly.</p>
2503
<p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/isdss/topological-consistency-quantitative-results" target="_blank">Topological Consistency Quantitative Results</a></p><br><br><table>
2504
                                 <tbody>
2505
                                    <tr>
2506
                                       <td>Status</td>
2507
                                       <td>Passed</td>
2508
                                    </tr>
2509
                                    <tr>
2510
                                       <td>Duration</td>
2511
                                       <td>0.001 s</td>
2512
                                    </tr>
2513
                                    <tr class="ReportDetail">
2514
                                       <td>Assertion ID</td>
2515
                                       <td>EID0c1ad661-f3bf-49a5-b38a-3dd68e2c7bfd</td>
2516
                                    </tr>
2517
                                    <tr class="DoNotShowInSimpleView">
2518
                                       <td>Assertion URI</td>
2519
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID3c66a367-9f4c-45dd-a585-27f1b6972f53" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID3c66a367-9f4c-45dd-a585-27f1b6972f53'); return false;">Link</a></td>
2520
                                    </tr>
2521
                                 </tbody>
2522
                              </table><br><div class="ReportDetail Expression"><label for="EID3c66a367-9f4c-45dd-a585-27f1b6972f53.expression">Expression:</label><textarea id="EID3c66a367-9f4c-45dd-a585-27f1b6972f53.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=                          
2523
        (for $record in $records
2524
                let $rid := $record/gmd:fileIdentifier/*/text()
2525
                let $results := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_TopologicalConsistency/gmd:result/gmd:DQ_QuantitativeResult
2526
                return
2527
                for $result in $results
2528
                        let $measureName := $result/../../gmd:nameOfMeasure/*[1]/text()
2529
                        let $valueRecord := $result/gmd:value/gco:Record
2530
                        let $type := $result/gmd:value/gco:Record/@xsi:type
2531
                        return
2532
                        if (not($result/gmd:valueUnit)) then
2533
                                local:addMessage('TR.noValueUnit', map { 'filename': local:filename($record), 'id': $rid, 'measureName': $measureName })
2534
                        else if (not($valueRecord)) then
2535
                                local:addMessage('TR.noValueRecord', map { 'filename': local:filename($record), 'id': $rid, 'measureName': $measureName })
2536
                        else if (not($type)) then
2537
                                local:addMessage('TR.noTypeRecord', map { 'filename': local:filename($record), 'id': $rid, 'measureName': $measureName })
2538
                        else ()
2539
        )[position() le $limitErrors]
2540
return
2541
(if ($messages) then 'FAILED' else 'PASSED',
2542
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2543
 $messages)</textarea></div>
2544
                           </div>
2545
                        </div>
2546
                        <div data-role="collapsible" data-enhanced="true" id="EID93352c31-6891-4efc-b349-76115e46067e" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2547
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md isdss 2.8: Topological Consistency Descriptive Results<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
2548
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that the topological consistency descriptive results is provided correctly.</p>
2549
<p>More information: <a href="http://inspire.ec.europa.eu/id/ats/metadata/2.0/isdss/topological-consistency-descriptive-results" target="_blank">Topological Consistency Descriptive Results</a></p><br><br><table>
2550
                                 <tbody>
2551
                                    <tr>
2552
                                       <td>Status</td>
2553
                                       <td>Passed</td>
2554
                                    </tr>
2555
                                    <tr>
2556
                                       <td>Duration</td>
2557
                                       <td>0.001 s</td>
2558
                                    </tr>
2559
                                    <tr class="ReportDetail">
2560
                                       <td>Assertion ID</td>
2561
                                       <td>EID9fa0176c-5cc8-458b-9795-45f9a949cc56</td>
2562
                                    </tr>
2563
                                    <tr class="DoNotShowInSimpleView">
2564
                                       <td>Assertion URI</td>
2565
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID93352c31-6891-4efc-b349-76115e46067e" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID93352c31-6891-4efc-b349-76115e46067e'); return false;">Link</a></td>
2566
                                    </tr>
2567
                                 </tbody>
2568
                              </table><br><div class="ReportDetail Expression"><label for="EID93352c31-6891-4efc-b349-76115e46067e.expression">Expression:</label><textarea id="EID93352c31-6891-4efc-b349-76115e46067e.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $titleINSPIRE := 'INSPIRE Data Specifications - Base Models - Generic Network Model'
2569
let $messages :=
2570
        (for $record in $records
2571
                let $rid := $record/gmd:fileIdentifier/*/text()
2572
                let $results := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_TopologicalConsistency/gmd:result/gmd:DQ_ConformanceResult
2573
                return
2574
                for $result in $results
2575
                        let $measureName := $result/../../gmd:nameOfMeasure/*[1]/text()
2576
                        let $title := $result/gmd:specification/gmd:CI_Citation/gmd:title/*/text()
2577
                        let $date := $result/gmd:specification/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/*/text()
2578
                        let $dateTypeCode := $result/gmd:specification/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue
2579
                        let $pass := $result/gmd:pass
2580
                        let $explanation := $result/gmd:explanation
2581
                        return
2582
                        if (not($title = $titleINSPIRE)) then
2583
                                local:addMessage('TR.invalidTitle', map { 'filename': local:filename($record), 'id': $rid })
2584
                        else if (not($date)) then
2585
                                local:addMessage('TR.noDateElement', map { 'filename': local:filename($record), 'id': $rid })
2586
                        else if (not($dateTypeCode = 'publication')) then
2587
                                local:addMessage('TR.noDateCodeList', map { 'filename': local:filename($record), 'id': $rid })
2588
                        else if (not($pass = 'false')) then
2589
                                local:addMessage('TR.invalidPass', map { 'filename': local:filename($record), 'id': $rid })
2590
                        else if (not($explanation)) then
2591
                                local:addMessage('TR.noExplanation', map { 'filename': local:filename($record), 'id': $rid })
2592
            else if (not(string-length($explanation/gco:CharacterString/text()) != 0 or string-length($explanation/gmx:Anchor/text()) != 0)) then
2593
                                local:addMessage('TR.emptyExplanation', map { 'filename': local:filename($record), 'id': $rid })
2594
                        else ()
2595
        )[position() le $limitErrors]
2596
return
2597
(if ($messages) then 'FAILED' else 'PASSED',
2598
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2599
 $messages)</textarea></div>
2600
                           </div>
2601
                        </div>
2602
                     </div>
2603
                  </div>
2604
               </div>
2605
            </div>
2606
         </div>
2607
         <div class="TestSuite" data-role="collapsible" data-theme="h" data-content-theme="h">
2608
            <h2>Conformance class: XML encoding of ISO 19115/19119 metadata
2609
               <div class="ui-li-count">1</div>
2610
            </h2>This test suite examines XML documents containing gmd:MD_Metadata records against basic requirements for the encoding for metadata in INSPIRE.<br/><br/>
2611
<b>This is a draft version. It has limitations and is expected to contain errors.</b> Please report any issues or problems <a href="https://github.com/inspire-eu-validation/community/wiki/Your-feedback" target="_blank">in GitHub</a>.<br/><br/>
2612
Source: <a href="http://inspire.ec.europa.eu/id/ats/metadata/1.3/xml-encoding" target="_blank">Conformance Class 'XML encoding of ISO 19115/19119 metadata'</a><br><br><table>
2613
               <tbody>
2614
                  <tr>
2615
                     <td>Status</td>
2616
                     <td>Passed</td>
2617
                  </tr>
2618
                  <tr>
2619
                     <td>Duration</td>
2620
                     <td>21 s</td>
2621
                  </tr>
2622
                  <tr class="ReportDetail">
2623
                     <td>Test suite ID</td>
2624
                     <td>EIDe3500038-e37c-4dcf-806c-6bc82d585b3b</td>
2625
                  </tr>
2626
                  <tr class="ReportDetail">
2627
                     <td>Author</td>
2628
                     <td>interactive instruments GmbH</td>
2629
                  </tr>
2630
                  <tr class="ReportDetail">
2631
                     <td>Date created</td>
2632
                     <td>30/08/2016 00:00:00 GMT</td>
2633
                  </tr>
2634
                  <tr>
2635
                     <td>Version</td>
2636
                     <td>0.2.0</td>
2637
                  </tr>
2638
                  <tr class="ReportDetail">
2639
                     <td>Last editor</td>
2640
                     <td>interactive instruments GmbH</td>
2641
                  </tr>
2642
                  <tr class="ReportDetail">
2643
                     <td>Last updated</td>
2644
                     <td>21/02/2017 17:00:00 GMT</td>
2645
                  </tr>
2646
                  <tr class="ReportDetail">
2647
                     <td>Reference</td>
2648
                     <td><a class="ui-link" href="https://github.com/inspire-eu-validation/ets-repository/tree/master/metadata/xml">Link</a></td>
2649
                  </tr>
2650
                  <tr class="ReportDetail">
2651
                     <td>Hash</td>
2652
                     <td>CBF29CE484222325</td>
2653
                  </tr>
2654
               </tbody>
2655
            </table><br><div class="TestModulePlaceHolder">
2656
               <div data-role="collapsible" data-enhanced="true" id="EID242272e0-3f0a-4e9c-9643-657c4d6d304a" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed TestCase SuccessfulTestCase">
2657
                  <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-plus ui-btn-h ui-mini">Schema validation
2658
                        <div class="ui-li-count">1</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
2659
                  <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h">Validation of the XML documents under test against the ISO/OGC metadata schemas.<br><br><table>
2660
                        <tbody>
2661
                           <tr>
2662
                              <td>Status</td>
2663
                              <td>Passed</td>
2664
                           </tr>
2665
                           <tr>
2666
                              <td>Duration</td>
2667
                              <td>21 s</td>
2668
                           </tr>
2669
                           <tr class="ReportDetail">
2670
                              <td>Test case ID</td>
2671
                              <td>EID242272e0-3f0a-4e9c-9643-657c4d6d304a</td>
2672
                           </tr>
2673
                        </tbody>
2674
                     </table><br><div class="TestStepPlaceHolder">
2675
                        <div data-role="collapsible" data-enhanced="true" id="EID45070d11-b248-42d1-9e40-8bab61efda72" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2676
                           <h5 class="ui-collapsible-heading ui-collapsible-heading-collapsed"><a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-check ui-btn-h ui-mini">md-xml.a.1: Validate XML documents<span class="ui-collapsible-heading-status"> click to expand contents</span></a></h5>
2677
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Validate each document against the schema(s) specified in the xsi:schemaLocation attribute using strict XML schema validation.</p>
2678
<p>Official XML schemas are currently found in two separate locations:</p>
2679
<ul>
2680
<li>ISO repository for publicly available standards. The ISO 19139 schemas can be found at <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/">http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/</a>.</li>
2681
<li>OGC Schema repository. The ISO 19139 schemas are located at <a href="http://schemas.opengis.net/iso/19139/20070417/">http://schemas.opengis.net/iso/19139/20070417/</a> and <a href="http://schemas.opengis.net/iso/19139/20060504/">http://schemas.opengis.net/iso/19139/20060504/</a>. The difference in the schemas is the GML version. The version dated "2007-04-17" uses GML 3.2.1, the version dated "2006-06-04" use GML 3.2.0, which was never approved or published by OGC. The major difference is that GML 3.2.0 schemas are defined in the namespace http://www.opengis.net/gml whereas GML 3.2.1 schemas are defined in the namespace http://www.opengis.net/gml/3.2.<br/>
2682
The ISO AP schemas are located at <a href="http://schemas.opengis.net/csw/2.0.2/profiles/apiso/">http://schemas.opengis.net/csw/2.0.2/profiles/apiso/</a>. The ISO AP schemas are bound to the ISO 19139 schemas dated "2006-06-04".<br/>
2683
The schemas located in the ISO repository for publicly available standards are the same as the ISO 19139 schemas dated "2007-04-17".</li>
2684
</ul>
2685
I.e., each document is validated using the following XML schema definition:
2686
<ul>
2687
<li>If the parameter 'encoding' is 'CSW ISO AP 1.0.0': <a href="http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd" target="_blank">http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd</a></li>
2688
<li>If the parameter 'encoding' is 'ISO/TS 19139': <a href="http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd" target="_blank">http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd</a></li>
2689
<li>If no encoding information is provided with the test, the encoding is determined by inspecting the schemaLocation based on the schema documents used for the 'http://www.isotc211.org/2005/gmd' namespace. If this information cannot be determined, assume 'CSW ISO AP 1.0.0'.</li>
2690
</ul>
2691
<p><b>Known limitations:</b></p>
2692
<ul>
2693
<li>Note that validation is done on a file-by-file basis and access to many remote schema files is time consuming. I.e. it will be <em>much</em> faster to validate a single document with many metadata records than many files with a single record each.</li>
2694
</ul>
2695
<p>Source: <a href="http://inspire.ec.europa.eu/id/ats/metadata/1.3/xml-encoding/schema-validation" target="_blank">Abstract Test Case 'Schema validation'</a></p><br><br><table>
2696
                                 <tbody>
2697
                                    <tr>
2698
                                       <td>Status</td>
2699
                                       <td>Passed</td>
2700
                                    </tr>
2701
                                    <tr>
2702
                                       <td>Duration</td>
2703
                                       <td>21 s</td>
2704
                                    </tr>
2705
                                    <tr class="ReportDetail">
2706
                                       <td>Assertion ID</td>
2707
                                       <td>EID04c71089-1d8c-4e67-897c-11908e78e2d4</td>
2708
                                    </tr>
2709
                                    <tr class="DoNotShowInSimpleView">
2710
                                       <td>Assertion URI</td>
2711
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EIDaf4dc401-cbe5-4c0f-9c8f-eeb40fe4b3be.html?lang=en#EID45070d11-b248-42d1-9e40-8bab61efda72" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID45070d11-b248-42d1-9e40-8bab61efda72'); return false;">Link</a></td>
2712
                                    </tr>
2713
                                 </tbody>
2714
                              </table><br><div class="ReportDetail Expression"><label for="EID45070d11-b248-42d1-9e40-8bab61efda72.expression">Expression:</label><textarea id="EID45070d11-b248-42d1-9e40-8bab61efda72.expression" class="Expression ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow" data-mini="true" readonly>let $messages :=
2715
    (
2716
    if ($validationErrors) then
2717
                for $error in $validationErrors
2718
                return local:addMessage('TR.validationError', map { 'text': $error })
2719
        else
2720
                for $file in $db
2721
        return 
2722
            if ($file/element()/@xsi:schemaLocation) then 
2723
                let $result :=
2724
                    if (contains($file/element()/@xsi:schemaLocation, 'http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/gmd/gmd.xsd') or contains($file/element()/@xsi:schemaLocation, 'http://www.isotc211.org/2005/gmd/gmd.xsd') or contains($file/element()/@xsi:schemaLocation, 'http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd')) then
2725
                        try{ 
2726
                                                        validate:xsd($file, 'https://inspire.ec.europa.eu/draft-schemas/inspire-md-schemas-temp/apiso-inspire/apiso-inspire.xsd') } catch * {  $err:description }
2727
                    else
2728
                        try{ validate:xsd($file) } catch * {  $err:description }
2729
                return
2730
                if(not(string-length($result) = 0)) then
2731
                    local:addMessage('TR.invalidSchema',  map { 'filename': local:filename($file), 'count': string($result) })
2732
                else ()
2733
            else
2734
                for $record in $records
2735
                let $rid := $record/gmd:fileIdentifier/*/text()
2736
                let $result := 
2737
                    if ( contains($record/element()/@xsi:schemaLocation, 'http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/gmd/gmd.xsd') or contains($record/element()/@xsi:schemaLocation, 'http://www.isotc211.org/2005/gmd/gmd.xsd') or contains($record/element()/@xsi:schemaLocation, 'http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd')) then
2738
                        try{ validate:xsd($record, 'https://inspire.ec.europa.eu/draft-schemas/inspire-md-schemas-temp/apiso-inspire/apiso-inspire.xsd') } catch * {  $err:description }
2739
                    else
2740
                        try{ validate:xsd($record) } catch * {  $err:description }
2741
                return
2742
                if(not(string-length($result) = 0)) then
2743
                    local:addMessage('TR.xmlSchemaErrorRecord',  map { 'filename': local:filename($record), 'id': $rid, 'error': string($result) })
2744
                else ()
2745
    )[position() le $limitErrors]
2746
return
2747
(if ($messages) then 'FAILED' else 'PASSED',
2748
 local:error-statistics('TR.filesWithErrors', count($messages[@ref eq 'TR.invalidSchema'])),
2749
 local:error-statistics('TR.recordsWithErrors', count($messages[@ref eq 'TR.invalidSchemaRecord'])),
2750
 $messages)</textarea></div>
2751
                           </div>
2752
                        </div>
2753
                     </div>
2754
                  </div>
2755
               </div>
2756
            </div>
2757
         </div>
2758
      </div>
2759
      <div data-role="footer">
2760
         <h1>Report generated by ETF</h1>
2761
      </div>
2762
      <div class="ui-field-contain" id="lodFadinMenu" style="display: none; width: 200px; position: fixed; top: 10px; right: 5px;" data-role="controlgroup"><label for="select-Show">Level of detail</label><select name="select-Show" id="lodFadinMenuSelect" data-mini="true">
2763
            <option value="cntrlAllDetails">All details</option>
2764
            <option value="cntrlLessInformation">Less information</option>
2765
            <option value="cntrlSimplified" selected>Simplified</option></select></div><script>
2766
                        
2767
                        function SelectorCache() {
2768
                                var cache = {};
2769
                                function getFromCache( selector ) {
2770
                                        if ( undefined === cache[ selector ] ) {
2771
                                                cache[ selector ] = $( selector );
2772
                                        }
2773
                                        return cache[ selector ];
2774
                                }
2775
                                return { get: getFromCache };
2776
                        }
2777
                        var cache = new SelectorCache();
2778

2779
                        function hide(elements) {
2780
                                elements.css({ display: 'none' });
2781
                        }
2782

2783
                        function show(elements) {
2784
                                elements.css({ display: '' });
2785
                        }
2786

2787
                        function updateLod(cntrl) {
2788
                                if(cntrl=="cntrlSimplified")
2789
                                {
2790
                                        hide(cache.get('.ReportDetail, .DoNotShowInSimpleView, .XQueryContainsAssertion'));
2791
                                }
2792
                                else if(cntrl=="cntrlLessInformation")
2793
                                {
2794
                                        hide(cache.get('.ReportDetail'));
2795
                                        show(cache.get('.DoNotShowInSimpleView'));
2796
                                }
2797
                                else if(cntrl=="cntrlAllDetails")
2798
                                {
2799
                                        show(cache.get('.ReportDetail, .DoNotShowInSimpleView'));
2800
                                }
2801
                        }
2802
                        
2803
                        
2804
                        cache.get( "input[name=radio-filter]" ).on( "click", function() {
2805
                        
2806
                        var cntrl = $( "input[name=radio-filter]:checked" ).val();
2807
                                if(cntrl=="cntrlShowOnlyFailed")
2808
                                {
2809
                                        hide(cache.get('.SuccessfulTestModule, .ManualTestModule, .SkippedTestModule, .SuccessfulTestCase, .ManualTestCase, .SuccessfulTestStep, .ManualTestStep, .SuccessfulAssertion, .ManualAssertion, .SkippedTestCase, .SkippedTestStep, .SkippedAssertion'));                                        
2810
                                        show(cache.get('.FailedTestCase, .FailedTestStep, .FailedAssertion'));
2811
                                        
2812
                                        if(cache.get('.TestStep, .Assertion').length < 3500) {
2813
                                                cache.get('.TestSuite').collapsible('expand');
2814
                                                cache.get('.FailedTestModule').collapsible('expand');
2815
                                                cache.get('.FailedTestCase').collapsible('expand');
2816
                                                cache.get('.FailedTestStep').collapsible('expand');
2817
                                                cache.get('.FailedAssertion').collapsible('expand');
2818
                                        }
2819
                                }
2820
                                else if(cntrl=="cntrlShowOnlyManual")
2821
                                {
2822
                                        hide(cache.get('.SuccessfulTestModule, .FailedTestModule, .SkippedTestModule, .SuccessfulTestCase, .FailedTestCase, .SkippedTestCase, .SkippedTestStep, .SkippedAssertion, .SuccessfulTestStep, .FailedTestStep, .SuccessfulAssertion, .FailedAssertion'));
2823
                                        show(cache.get('.ManualTestModule, .ManualTestCase, .ManualTestStep, .ManualAssertion'));
2824
                                        
2825
                                        if(cache.get('.TestStep, .Assertion').length < 3500) {
2826
                                                cache.get('.TestSuite').collapsible('expand');
2827
                                                cache.get('.ManualTestModule').collapsible('expand');
2828
                                                cache.get('.ManualTestCase').collapsible('expand');
2829
                                                cache.get('.ManualTestStep').collapsible('expand');
2830
                                                cache.get('.ManualAssertion').collapsible('expand');
2831
                                        }
2832
                                }
2833
                                else if(cntrl=="cntrlShowAll")
2834
                                {
2835
                                        show(cache.get('.SuccessfulTestModule, .FailedTestModule, .ManualTestModule, .SkippedTestModule, .SuccessfulTestCase, .SuccessfulTestStep, .SuccessfulAssertion, .SkippedTestCase, .SkippedTestStep, .SkippedAssertion, .ManualTestCase, .ManualTestStep, .ManualAssertion, .FailedTestCase, .FailedTestStep, .FailedAssertion'));
2836
                                }
2837
                        });
2838
                        
2839
                        $.fn.exists = function(){ return this.length > 0; }
2840
                        
2841
                        $.fn.getParentWithClass = function(className) {
2842
                                var p = this.parent();
2843
                                if(p.exists()) {
2844
                                        return p.hasClass(className) ? p : p.getParentWithClass(className);
2845
                                }
2846
                                consol