etfwebapp-report-B6EE2F5F-381A-4C06-B26D-C4C6B177F7A1.html

Stijn Goedertier, 04 Dec 2019 08:19 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 - Flood hazard maps (extreme) -
16
            20191203233053</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>
17
      <div data-role="content">
18
         <div class="ui-grid-b">
19
            <div class="ui-block-a">
20
               <div id="rprtInfo">
21
                  <table>
22
                     <tbody>
23
                        <tr class="ReportDetail">
24
                           <td>Report URI</td>
25
                           <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en" data-ajax="false">Link</a></td>
26
                        </tr>
27
                        <tr>
28
                           <td>Status</td>
29
                           <td>Passed</td>
30
                        </tr>
31
                        <tr>
32
                           <td>Started</td>
33
                           <td>03/12/2019 22:33:29 GMT</td>
34
                        </tr>
35
                        <tr>
36
                           <td>Duration</td>
37
                           <td>47 s</td>
38
                        </tr>
39
                        <tr class="ReportDetail">
40
                           <td>Report version</td>
41
                           <td>2.1.0-b181101</td>
42
                        </tr>
43
                        <tr class="ReportDetail">
44
                           <td>Log URI</td>
45
                           <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/18a09a5d-434c-4d0d-9333-e4a353cdbd57/log" data-ajax="false">Link</a></td>
46
                        </tr>
47
                     </tbody>
48
                  </table>
49
               </div>
50
            </div>
51
            <div class="ui-block-b">
52
               <div id="rprtStatistics">
53
                  <table id="my-table">
54
                     <thead>
55
                        <tr>
56
                           <th></th>
57
                           <th>Total Count</th>
58
                           <th>Skipped</th>
59
                           <th>Failed</th>
60
                           <th>Warnings</th>
61
                           <th>Manual</th>
62
                        </tr>
63
                     </thead>
64
                     <tbody>
65
                        <tr>
66
                           <td>Test suites</td>
67
                           <td>4</td>
68
                           <td>0</td>
69
                           <td>0</td>
70
                           <td>0</td>
71
                           <td>0</td>
72
                        </tr>
73
                        <tr>
74
                           <td>Test cases</td>
75
                           <td>11</td>
76
                           <td>0</td>
77
                           <td>0</td>
78
                           <td>0</td>
79
                           <td>0</td>
80
                        </tr>
81
                        <tr>
82
                           <td>Assertions</td>
83
                           <td>40</td>
84
                           <td>0</td>
85
                           <td>0</td>
86
                           <td>0</td>
87
                           <td>0</td>
88
                        </tr>
89
                     </tbody>
90
                  </table>
91
               </div>
92
            </div>
93
            <div class="ui-block-c">
94
               <div id="rprtControl">
95
                  <fieldset id="controlgroupLOD" data-role="controlgroup" data-mini="true">
96
                     <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>
97
                  <fieldset id="controlgroupShow" data-role="controlgroup" data-mini="true">
98
                     <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>
99
               </div>
100
            </div>
101
         </div>
102
         <div id="rprtParameters" data-role="collapsible" data-collapsed-icon="info" class="ReportDetail">
103
            <h3>Parameters</h3>
104
            <table>
105
               <tbody>
106
                  <tr>
107
                     <td>tests_to_execute</td>
108
                     <td>.*</td>
109
                  </tr>
110
                  <tr>
111
                     <td>files_to_test</td>
112
                     <td>.*</td>
113
                  </tr>
114
               </tbody>
115
            </table>
116
         </div>
117
         <div id="rprtTestobject" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
118
            <h3>Test object: xml.xml</h3>
119
            <p>Web Test Object</p><a target="_blank" href="https://catalog.inspire.geoportail.lu/geonetwork/srv/api/records/B6EE2F5F-381A-4C06-B26D-C4C6B177F7A1/formatters/xml">https://catalog.inspire.geoportail.lu/geonetwork/srv/api/records/B6EE2F5F-381A-4C06-B26D-C4C6B177F7A1/formatters/xml</a><p>Files: 1</p>
120
            <p>Size: 28 KB</p>
121
            <p>Associated test object types: </p>
122
            <ul>
123
               <li>Metadata records  (A set of XML documents. Each document contains one or more gmd:MD_Metadata elements.)</li>
124
            </ul>
125
         </div>
126
         <div id="rprtStatReport" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
127
            <h3>Metadata record statistics</h3>
128
            <table>
129
               <tbody>
130
                  <tr>
131
                     <th>Type</th>
132
                     <th>Total Count</th>
133
                  </tr>
134
                  <tr>
135
                     <td>all</td>
136
                     <td>1</td>
137
                  </tr>
138
                  <tr>
139
                     <td>dataset</td>
140
                     <td>1</td>
141
                  </tr>
142
               </tbody>
143
            </table>
144
         </div>
145
         <div id="rprtLogFile" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
146
            <h3>Log path: Common Requirements for ISO/TC 19139:2007 based INSPIRE metadata records.</h3>
147
            <pre>Testing 1 records
148
Executing Test Suite: /etf/projects/inspire-ets-repository/ets-repository-staging/metadata/2.0/common/ets-md-common-bsxets.xml
149
Statistics table: 0 ms
150
Test Suite 'Common Requirements for ISO/TC 19139:2007 based INSPIRE metadata records.' started
151
Test Case 'General requirements' started
152
Test Assertion 'md common req C.1: XML Schema': PASSED - 21796 ms
153
Test Assertion 'md common req C.2: Root Element': PASSED - 0 ms
154
Test Assertion 'md common req C.5: Language Code': PASSED - 0 ms
155
Test Assertion 'md common req C.6: Metadata Point of Contact': PASSED - 0 ms
156
Test Assertion 'md common req C.7: Metadata Date': PASSED - 0 ms
157
Test Case 'General requirements' finished: PASSED
158
Test Case 'Identification' started
159
Test Assertion 'md common req C.8: Resource Title': PASSED - 0 ms
160
Test Assertion 'md common req C.9: Resource Abstract': PASSED - 0 ms
161
Email Char: 1
162
Email Anch: 0
163
Test Assertion 'md common req C.10: Responsible Organization': PASSED - 1 ms
164
Test Assertion 'md common req C.11: Temporal Reference': PASSED - 0 ms
165
Test Assertion 'md common req C.12: Max One Date of Creation': PASSED - 0 ms
166
Test Assertion 'md common req C.13: Not More than one Date of Last Revision': PASSED - 0 ms
167
Test Assertion 'md common req C.14: Temporal Extent': PASSED - 0 ms
168
Test Assertion 'md common req C.15: Keyword Originating CV': PASSED - 0 ms
169
Test Assertion 'md common req C.16: Group Keywords by CV': PASSED - 0 ms
170
Test Assertion 'md common req C.17: Limitations on Public Access': PASSED - 0 ms
171
Test Assertion 'md common req C.18: Conditions for Access and Use': PASSED - 0 ms
172
Test Assertion 'md common req C.19: Geographical Bounding Box': PASSED - 0 ms
173
Test Case 'Identification' finished: PASSED
174
Test Case 'Data quality' started
175
Test Assertion 'md common req C.20: Dataset Conformity': PASSED - 0 ms
176
Test Assertion 'md common req C.21: Dataset Conformity Specifications': PASSED - 0 ms
177
Test Assertion 'md common req C.22: Conformity Degree': PASSED - 0 ms
178
Test Case 'Data quality' finished: PASSED
179
Test Suite 'Common Requirements for ISO/TC 19139:2007 based INSPIRE metadata records.' finished: PASSED
180
</pre>
181
         </div>
182
         <div id="rprtLogFile" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
183
            <h3>Log path: Conformance Class 1: INSPIRE data sets and data set series baseline metadata.</h3>
184
            <pre>Testing 1 records
185
Executing Test Suite: /etf/projects/inspire-ets-repository/ets-repository-staging/metadata/2.0/datasets-and-series/ets-md-datasets-and-series-bsxets.xml
186
Statistics table: 0 ms
187
Test Suite 'Conformance Class 1: INSPIRE data sets and data set series baseline metadata.' started
188
Test Case 'General Metadata' started
189
Test Assertion 'md datasets-and-series 1.1: Resource Type': PASSED - 0 ms
190
Test Case 'General Metadata' finished: PASSED
191
Test Case 'Identification' started
192
Test Assertion 'md datasets-and-series 1.2: Only One Data Identification': PASSED - 0 ms
193
Test Assertion 'md datasets-and-series 1.3: Dataset UID': PASSED - 0 ms
194
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.bg.atom'
195
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.cs.atom'
196
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.da.atom'
197
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.de.atom'
198
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.et.atom'
199
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.el.atom'
200
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.en.atom'
201
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.es.atom'
202
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.fr.atom'
203
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.hr.atom'
204
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.it.atom'
205
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.lv.atom'
206
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.lt.atom'
207
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.hu.atom'
208
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.mt.atom'
209
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.nl.atom'
210
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.pl.atom'
211
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.pt.atom'
212
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.ro.atom'
213
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.sk.atom'
214
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.sl.atom'
215
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.fi.atom'
216
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.sv.atom'
217
Checking URL: 'http://inspire.ec.europa.eu/theme/theme.en.atom'
218
Test Assertion 'md datasets-and-series 1.4: INSPIRE Theme Keyword': PASSED - 2394 ms
219
Test Assertion 'md datasets-and-series 1.5: Spatial Resolution': PASSED - 0 ms
220
Test Assertion 'md datasets-and-series 1.6: Resource Language': PASSED - 0 ms
221
Test Assertion 'md datasets-and-series 1.7: Topic Category': PASSED - 0 ms
222
Test Case 'Identification' finished: PASSED
223
Test Case 'Distribution' started
224
Test Assertion 'md datasets-and-series 1.8: Resource Locator': PASSED - 0 ms
225
Test Assertion 'md datasets-and-series 1.9: Data Quality Info Section': PASSED - 0 ms
226
Test Assertion 'md datasets-and-series 1.10: Dataset Conformity': PASSED - 1796 ms
227
Test Assertion 'md datasets-and-series 1.11: Lineage': PASSED - 0 ms
228
Test Case 'Distribution' finished: PASSED
229
Test Suite 'Conformance Class 1: INSPIRE data sets and data set series baseline metadata.' finished: PASSED
230
</pre>
231
         </div>
232
         <div id="rprtLogFile" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
233
            <h3>Log path: Conformance Class 2: INSPIRE data sets and data set series interoperability metadata.</h3>
234
            <pre>Testing 1 records
235
Executing Test Suite: /etf/projects/inspire-ets-repository/ets-repository-staging/metadata/2.0/datasets-and-series/ets-md-isdss-bsxets.xml
236
Statistics table: 1 ms
237
Test Suite 'Conformance Class 2: INSPIRE data sets and data set series interoperability metadata.' started
238
Test Case 'General Metadata' started
239
Test Assertion 'md isdss 2.1: Coordinate Reference System': PASSED - 0 ms
240
Test Assertion 'md isdss 2.2: Coordinate Reference System Identifiers': PASSED - 0 ms
241
Test Assertion 'md isdss 2.3: Temporal Reference Systems': PASSED - 0 ms
242
Test Case 'General Metadata' finished: PASSED
243
Test Case 'Identification' started
244
Test Assertion 'md isdss 2.4: Spatial Representation Type': PASSED - 0 ms
245
Test Assertion 'md isdss 2.5: Character Encoding': PASSED - 1 ms
246
Test Case 'Identification' finished: PASSED
247
Test Case 'Distribution' started
248
Test Assertion 'md isdss 2.6: Data Encoding': PASSED - 0 ms
249
Test Case 'Distribution' finished: PASSED
250
Test Case 'Data Quality' started
251
Test Assertion 'md isdss 2.7: Topological Consistency Quantitative Results': PASSED - 0 ms
252
Test Assertion 'md isdss 2.8: Topological Consistency Descriptive Results': PASSED - 0 ms
253
Test Case 'Data Quality' finished: PASSED
254
Test Suite 'Conformance Class 2: INSPIRE data sets and data set series interoperability metadata.' finished: PASSED
255
</pre>
256
         </div>
257
         <div id="rprtLogFile" data-role="collapsible" data-collapsed-icon="info" class="DoNotShowInSimpleView">
258
            <h3>Log path: Conformance class: XML encoding of ISO 19115/19119 metadata</h3>
259
            <pre>Testing 1 records
260
Executing Test Suite: /etf/projects/inspire-ets-repository/ets-repository-staging/metadata/1.3/xml/ets-md-xml-bsxets.xml
261
Statistics table: 0 ms
262
Test Suite 'Conformance class: XML encoding of ISO 19115/19119 metadata' started
263
Test Case 'Schema validation' started
264
Test Assertion 'md-xml.a.1: Validate XML documents': PASSED - 21720 ms
265
Test Case 'Schema validation' finished: PASSED
266
Test Suite 'Conformance class: XML encoding of ISO 19115/19119 metadata' finished: PASSED
267
</pre>
268
         </div>
269
         <div class="TestSuite" data-role="collapsible" data-theme="h" data-content-theme="h">
270
            <h2>Common Requirements for ISO/TC 19139:2007 based INSPIRE metadata records.
271
               <div class="ui-li-count">3</div>
272
            </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/>
273
Known limitations are documented in the description of the applicable test case or test assertion.<br/><br/>
274
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.
275
<br/><br/>
276
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>
277
               <tbody>
278
                  <tr>
279
                     <td>Status</td>
280
                     <td>Passed</td>
281
                  </tr>
282
                  <tr>
283
                     <td>Duration</td>
284
                     <td>21 s</td>
285
                  </tr>
286
                  <tr class="ReportDetail">
287
                     <td>Test suite ID</td>
288
                     <td>EID59692c11-df86-49ad-be7f-94a1e1ddd8da</td>
289
                  </tr>
290
                  <tr class="ReportDetail">
291
                     <td>Author</td>
292
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
293
                  </tr>
294
                  <tr class="ReportDetail">
295
                     <td>Date created</td>
296
                     <td>30/06/2018 00:00:00 GMT</td>
297
                  </tr>
298
                  <tr>
299
                     <td>Version</td>
300
                     <td>0.1.1</td>
301
                  </tr>
302
                  <tr class="ReportDetail">
303
                     <td>Last editor</td>
304
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
305
                  </tr>
306
                  <tr class="ReportDetail">
307
                     <td>Last updated</td>
308
                     <td>16/05/2019 11:40:00 GMT</td>
309
                  </tr>
310
                  <tr class="ReportDetail">
311
                     <td>Reference</td>
312
                     <td><a class="ui-link" href="https://github.com/inspire-eu-validation/ets-repository/tree/master/metadata/2.0">Link</a></td>
313
                  </tr>
314
                  <tr class="ReportDetail">
315
                     <td>Hash</td>
316
                     <td>CBF29CE484222325</td>
317
                  </tr>
318
               </tbody>
319
            </table><br><div class="TestModulePlaceHolder">
320
               <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">
321
                  <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
322
                        <div class="ui-li-count">5</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
323
                  <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>
324
                        <tbody>
325
                           <tr>
326
                              <td>Status</td>
327
                              <td>Passed</td>
328
                           </tr>
329
                           <tr>
330
                              <td>Duration</td>
331
                              <td>21 s</td>
332
                           </tr>
333
                           <tr class="ReportDetail">
334
                              <td>Test case ID</td>
335
                              <td>EID61e7ffc0-c181-11e8-a355-529269fb1459</td>
336
                           </tr>
337
                        </tbody>
338
                     </table><br><div class="TestStepPlaceHolder">
339
                        <div data-role="collapsible" data-enhanced="true" id="EID1792e1af-d137-4b62-ae77-ae1a66d9fd56" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
340
                           <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>
341
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Performs a schema validation of the document.</p>
342
                                                                        <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>
343
                                 <tbody>
344
                                    <tr>
345
                                       <td>Status</td>
346
                                       <td>Passed</td>
347
                                    </tr>
348
                                    <tr>
349
                                       <td>Duration</td>
350
                                       <td>21 s</td>
351
                                    </tr>
352
                                    <tr class="ReportDetail">
353
                                       <td>Assertion ID</td>
354
                                       <td>EID7c93c4d2-3942-4eb4-b5d3-4735d40262d8</td>
355
                                    </tr>
356
                                    <tr class="DoNotShowInSimpleView">
357
                                       <td>Assertion URI</td>
358
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID1792e1af-d137-4b62-ae77-ae1a66d9fd56" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID1792e1af-d137-4b62-ae77-ae1a66d9fd56'); return false;">Link</a></td>
359
                                    </tr>
360
                                 </tbody>
361
                              </table><br><div class="ReportDetail Expression"><label for="EID1792e1af-d137-4b62-ae77-ae1a66d9fd56.expression">Expression:</label><textarea id="EID1792e1af-d137-4b62-ae77-ae1a66d9fd56.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 :=    
362
                                                                                (for $record in $records
363
                                                                                let $rid := $record/gmd:fileIdentifier/*/text()
364
                                                                                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 }
365
                                                                                let $result_1 := try{ 
366
                                                                                        if (not(string-length($result_0) = 0)) then validate:xsd($record, 'http://www.isotc211.org/2005/gmd/gmd.xsd')
367
                                                                                        else ()
368
                                                                                } catch * {  $err:description }
369
                                                                                let $result_2 := try{
370
                                                                                        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')
371
                                                                                        else ()
372
                                                                                } catch * { $err:description }
373
                                                                                return
374
                                                                                if(not(string-length($result_0) = 0 or string-length($result_1) = 0 or string-length($result_2) = 0)) then
375
                                                                                        local:addMessage('TR.errorValidatingSchema',  map { 'filename': local:filename($record), 'id': $rid, 'description': concat($result_0, $result_1, $result_2) })
376
                                                                                else ()
377
                                                                                )[position() le $limitErrors]
378
                                                                        return
379
                                                                        (if ($messages) then 'FAILED' else 'PASSED',
380
                                                                         local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
381
                                                                         $messages)</textarea></div>
382
                           </div>
383
                        </div>
384
                        <div data-role="collapsible" data-enhanced="true" id="EID04bd1f38-590a-4e47-8a80-21847e9f52a5" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
385
                           <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>
386
                           <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>
387
                                                                        <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>
388
                                 <tbody>
389
                                    <tr>
390
                                       <td>Status</td>
391
                                       <td>Passed</td>
392
                                    </tr>
393
                                    <tr>
394
                                       <td>Duration</td>
395
                                       <td>0.001 s</td>
396
                                    </tr>
397
                                    <tr class="ReportDetail">
398
                                       <td>Assertion ID</td>
399
                                       <td>EIDba885e87-dfec-4206-9a94-5620af734d44</td>
400
                                    </tr>
401
                                    <tr class="DoNotShowInSimpleView">
402
                                       <td>Assertion URI</td>
403
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID04bd1f38-590a-4e47-8a80-21847e9f52a5" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID04bd1f38-590a-4e47-8a80-21847e9f52a5'); return false;">Link</a></td>
404
                                    </tr>
405
                                 </tbody>
406
                              </table><br><div class="ReportDetail Expression"><label for="EID04bd1f38-590a-4e47-8a80-21847e9f52a5.expression">Expression:</label><textarea id="EID04bd1f38-590a-4e47-8a80-21847e9f52a5.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 :=
407
                                                                                (for $record in $records
408
                                                                                let $rid := $record/gmd:fileIdentifier/*/text()
409
                                                                                return
410
                                                                                if(not($record/node-name() = QName('http://www.isotc211.org/2005/gmd','gmd:MD_Metadata'))) then
411
                                                                                        local:addMessage('TR.invalidRootElement',  map { 'filename': local:filename($record), 'id': namespace-uri($record) })
412
                                                                                else ()
413
                                                                                )[position() le $limitErrors]
414
                                                                        return
415
                                                                        (if ($messages) then 'FAILED' else 'PASSED',
416
                                                                         local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
417
                                                                         $messages)</textarea></div>
418
                           </div>
419
                        </div>
420
                        <div data-role="collapsible" data-enhanced="true" id="EID27f496d6-37c3-4758-a3a8-93ef5cc42735" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
421
                           <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>
422
                           <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>
423
                                                                        <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>
424
                                 <tbody>
425
                                    <tr>
426
                                       <td>Status</td>
427
                                       <td>Passed</td>
428
                                    </tr>
429
                                    <tr>
430
                                       <td>Duration</td>
431
                                       <td>0.001 s</td>
432
                                    </tr>
433
                                    <tr class="ReportDetail">
434
                                       <td>Assertion ID</td>
435
                                       <td>EIDebdda4b4-0bb4-4255-a36a-db4fe540065c</td>
436
                                    </tr>
437
                                    <tr class="DoNotShowInSimpleView">
438
                                       <td>Assertion URI</td>
439
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID27f496d6-37c3-4758-a3a8-93ef5cc42735" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID27f496d6-37c3-4758-a3a8-93ef5cc42735'); return false;">Link</a></td>
440
                                    </tr>
441
                                 </tbody>
442
                              </table><br><div class="ReportDetail Expression"><label for="EID27f496d6-37c3-4758-a3a8-93ef5cc42735.expression">Expression:</label><textarea id="EID27f496d6-37c3-4758-a3a8-93ef5cc42735.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')]
443
                                                                        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')
444
                                                                        let $messages :=    
445
                                                                                if (not($recordsToInspect)) then ()
446
                                                                                else
447
                                                                                (for $record in $recordsToInspect    
448
                                                                                let $rid := $record/gmd:fileIdentifier/*/text()
449
                                                                                let $languageCodes := $record/gmd:language/gmd:LanguageCode         
450
                                                                                return
451
                                                                                if (not($languageCodes)) then
452
                                                                                        local:addMessage('TR.noLanguageCode',  map { 'filename': local:filename($record), 'id': $rid })
453
                                                                                else if (count($languageCodes) != 1) then
454
                                                                                        local:addMessage('TR.wrongLanguageCodeNumber',  map { 'filename': local:filename($record), 'id': $rid })
455
                                                                                else if ($languageCodes/@codeList != 'http://www.loc.gov/standards/iso639-2/' and $languageCodes/@codeList != 'http://www.loc.gov/standards/iso639-2') then
456
                                                                                        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'})
457
                                                                                else if ($languageCodes/@codeListValue[not(. = $codes)]) then
458
                                                                                        local:addMessage('TR.invalidLanguageCode',  map { 'filename': local:filename($record), 'id': $rid, 'invalidCodes' : $languageCodes/@codeListValue/string()})
459
                                                                                else ()
460
                                                                                )[position() le $limitErrors]
461
                                                                        return
462
                                                                        (if ($messages) then 'FAILED' else 'PASSED',
463
                                                                         local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
464
                                                                         $messages)</textarea></div>
465
                           </div>
466
                        </div>
467
                        <div data-role="collapsible" data-enhanced="true" id="EID8c55f79b-8f14-4927-a843-5ed4f86491c9" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
468
                           <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>
469
                           <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>
470
                                                                                <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>
471
                                 <tbody>
472
                                    <tr>
473
                                       <td>Status</td>
474
                                       <td>Passed</td>
475
                                    </tr>
476
                                    <tr>
477
                                       <td>Duration</td>
478
                                       <td>0.001 s</td>
479
                                    </tr>
480
                                    <tr class="ReportDetail">
481
                                       <td>Assertion ID</td>
482
                                       <td>EIDead447bf-7ace-4b13-b9b1-a80f8566c9cb</td>
483
                                    </tr>
484
                                    <tr class="DoNotShowInSimpleView">
485
                                       <td>Assertion URI</td>
486
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID8c55f79b-8f14-4927-a843-5ed4f86491c9" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID8c55f79b-8f14-4927-a843-5ed4f86491c9'); return false;">Link</a></td>
487
                                    </tr>
488
                                 </tbody>
489
                              </table><br><div class="ReportDetail Expression"><label for="EID8c55f79b-8f14-4927-a843-5ed4f86491c9.expression">Expression:</label><textarea id="EID8c55f79b-8f14-4927-a843-5ed4f86491c9.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 := 
490
                (for $record in $records
491
                 let $rid := $record/gmd:fileIdentifier/*/text()
492
                 let $pocs := $record/gmd:contact/gmd:CI_ResponsibleParty
493
                 return
494
                 if(not($pocs)) then 
495
                        local:addMessage('TR.noMetadataContact', map { 'filename': local:filename($record), 'id': $rid })
496
                 else
497
                 for $poc in $pocs
498
                 let $orgName := $poc/gmd:organisationName
499
                 let $email := $poc/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress
500
                 return
501
            if (not($orgName) or not(string-length($orgName/gco:CharacterString/text()) != 0 or string-length($orgName/gmx:Anchor/text()) != 0)) then
502
                                local:addMessage('TR.noMetadataContactOrganisationName', map { 'filename': local:filename($record), 'id': $rid })
503
            else if (not($email) or not(string-length($email/gco:CharacterString/text()) != 0 or string-length($email/gmx:Anchor/text()) != 0)) then 
504
                                local:addMessage('TR.noMetadataContactEmailAddress', map { 'filename': local:filename($record), 'id': $rid })
505
                         else if (not($poc/gmd:role) or not($poc/gmd:role/gmd:CI_RoleCode/@codeListValue = 'pointOfContact')) then
506
                                local:addMessage('TR.noMetadataContactRole', map { 'filename': local:filename($record), 'id': $rid, 'pocs': fn:string-join($pocs/gmd:role/*/@codeListValue) })
507
                         else ()
508
                )[position() le $limitErrors]
509
        return
510
        (if ($messages) then 'FAILED' else 'PASSED',
511
         local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
512
         $messages)</textarea></div>
513
                           </div>
514
                        </div>
515
                        <div data-role="collapsible" data-enhanced="true" id="EIDaeaca934-cdee-4ccf-92f2-4ce8857a2902" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
516
                           <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>
517
                           <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>
518
                                                                        <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>
519
                                 <tbody>
520
                                    <tr>
521
                                       <td>Status</td>
522
                                       <td>Passed</td>
523
                                    </tr>
524
                                    <tr>
525
                                       <td>Duration</td>
526
                                       <td>0.001 s</td>
527
                                    </tr>
528
                                    <tr class="ReportDetail">
529
                                       <td>Assertion ID</td>
530
                                       <td>EID0b6c9678-31d1-4c7a-8183-6a4f4da60017</td>
531
                                    </tr>
532
                                    <tr class="DoNotShowInSimpleView">
533
                                       <td>Assertion URI</td>
534
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDaeaca934-cdee-4ccf-92f2-4ce8857a2902" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDaeaca934-cdee-4ccf-92f2-4ce8857a2902'); return false;">Link</a></td>
535
                                    </tr>
536
                                 </tbody>
537
                              </table><br><div class="ReportDetail Expression"><label for="EIDaeaca934-cdee-4ccf-92f2-4ce8857a2902.expression">Expression:</label><textarea id="EIDaeaca934-cdee-4ccf-92f2-4ce8857a2902.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')
538
let $recordsToInspect := $records[gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = $levels]
539
let $regex := '^(\d{4})(-(\d{2}))??(-(\d{2}))??(T(\d{2}):(\d{2})(:(\d{2}))??(\.(\d+))??(([\+\-]{1}\d{2}:\d{2})|Z)??)??$'
540
let $messages :=
541
        (for $record in $recordsToInspect
542
        let $rid := $record/gmd:fileIdentifier/*/text()
543
        return
544
                if (count($record/gmd:dateStamp) != 1 or not(count($record/gmd:dateStamp/gco:DateTime) + count($record/gmd:dateStamp/gco:Date) = 1)) then
545
                        local:addMessage('TR.oneDateStamp', map { 'filename': local:filename($record), 'id': $rid })
546
                else if(count($record/gmd:dateStamp/gco:DateTime) = 1) then
547
                        if (not(matches($record/gmd:dateStamp/gco:DateTime, $regex))) then
548
                                local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
549
                        else()
550
                else if(count($record/gmd:dateStamp/gco:Date) = 1) then
551
                        if (not(matches($record/gmd:dateStamp/gco:Date, $regex))) then
552
                                local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
553
                        else()
554
                else ()
555
        )[position() le $limitErrors]
556
return
557
(if ($messages) then 'FAILED' else 'PASSED',
558
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
559
 $messages)</textarea></div>
560
                           </div>
561
                        </div>
562
                     </div>
563
                  </div>
564
               </div>
565
               <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">
566
                  <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
567
                        <div class="ui-li-count">12</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
568
                  <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>
569
                        <tbody>
570
                           <tr>
571
                              <td>Status</td>
572
                              <td>Passed</td>
573
                           </tr>
574
                           <tr>
575
                              <td>Duration</td>
576
                              <td>0.001 s</td>
577
                           </tr>
578
                           <tr class="ReportDetail">
579
                              <td>Test case ID</td>
580
                              <td>EID61e80286-c181-11e8-a355-529269fb1459</td>
581
                           </tr>
582
                        </tbody>
583
                     </table><br><div class="TestStepPlaceHolder">
584
                        <div data-role="collapsible" data-enhanced="true" id="EID72a2e4bf-2478-4d74-8cbb-9633d4c72e23" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
585
                           <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>
586
                           <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>
587
                                                                <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>
588
                                 <tbody>
589
                                    <tr>
590
                                       <td>Status</td>
591
                                       <td>Passed</td>
592
                                    </tr>
593
                                    <tr>
594
                                       <td>Duration</td>
595
                                       <td>0.001 s</td>
596
                                    </tr>
597
                                    <tr class="ReportDetail">
598
                                       <td>Assertion ID</td>
599
                                       <td>EID34195fe7-0d77-46bb-b74e-489463cadd2f</td>
600
                                    </tr>
601
                                    <tr class="DoNotShowInSimpleView">
602
                                       <td>Assertion URI</td>
603
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID72a2e4bf-2478-4d74-8cbb-9633d4c72e23" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID72a2e4bf-2478-4d74-8cbb-9633d4c72e23'); return false;">Link</a></td>
604
                                    </tr>
605
                                 </tbody>
606
                              </table><br><div class="ReportDetail Expression"><label for="EID72a2e4bf-2478-4d74-8cbb-9633d4c72e23.expression">Expression:</label><textarea id="EID72a2e4bf-2478-4d74-8cbb-9633d4c72e23.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 :=
607
        (for $record in $records
608
        let $rid := $record/gmd:fileIdentifier/*/text()
609
        let $title := 
610
                if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
611
                        $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:citation/gmd:CI_Citation/gmd:title
612
                else
613
                        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title
614
        let $rid := $record/gmd:fileIdentifier/*/text()
615
        return
616
                if (not($title)) then
617
                        local:addMessage('TR.noTitle', map { 'filename': local:filename($record), 'id': $rid })
618
                else if (count($title) != 1) then
619
                        local:addMessage('TR.noTitle', map { 'filename': local:filename($record), 'id': $rid })
620
        else if (not($title) or not(string-length($title/gco:CharacterString/text()) != 0 or string-length($title/gmx:Anchor/text()) != 0)) then
621
                        local:addMessage('TR.emptyTitle', map { 'filename': local:filename($record), 'id': $rid })
622
                else ()
623
        )[position() le $limitErrors]
624
return
625
(if ($messages) then 'FAILED' else 'PASSED',
626
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
627
 $messages)</textarea></div>
628
                           </div>
629
                        </div>
630
                        <div data-role="collapsible" data-enhanced="true" id="EID3c33f6cc-08b0-4e46-a1e3-5a882fca5a01" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
631
                           <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>
632
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that a resource abstract is provided.</p>
633
                                                                        <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>
634
                                 <tbody>
635
                                    <tr>
636
                                       <td>Status</td>
637
                                       <td>Passed</td>
638
                                    </tr>
639
                                    <tr>
640
                                       <td>Duration</td>
641
                                       <td>0.001 s</td>
642
                                    </tr>
643
                                    <tr class="ReportDetail">
644
                                       <td>Assertion ID</td>
645
                                       <td>EID346ca433-1f21-4e4e-8fec-524d24fd6647</td>
646
                                    </tr>
647
                                    <tr class="DoNotShowInSimpleView">
648
                                       <td>Assertion URI</td>
649
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID3c33f6cc-08b0-4e46-a1e3-5a882fca5a01" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID3c33f6cc-08b0-4e46-a1e3-5a882fca5a01'); return false;">Link</a></td>
650
                                    </tr>
651
                                 </tbody>
652
                              </table><br><div class="ReportDetail Expression"><label for="EID3c33f6cc-08b0-4e46-a1e3-5a882fca5a01.expression">Expression:</label><textarea id="EID3c33f6cc-08b0-4e46-a1e3-5a882fca5a01.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 :=
653
        (
654
        for $record in $records
655
        let $rid := $record/gmd:fileIdentifier/*/text()
656
        let $abstract := 
657
                if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
658
                        $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:abstract
659
                else
660
                        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract
661
        return
662
        if (not($abstract)) then
663
                local:addMessage('TR.noAbstract', map { 'filename': local:filename($record), 'id': $rid })
664
        else if (count($abstract) != 1) then
665
                local:addMessage('TR.noAbstract', map { 'filename': local:filename($record), 'id': $rid })
666
    else if (not($abstract) or not(string-length($abstract/gco:CharacterString/text()) != 0 or string-length($abstract/gmx:Anchor/text()) != 0)) then
667
                local:addMessage('TR.emptyAbstract', map { 'filename': local:filename($record), 'id': $rid })
668
        else ()
669
        )[position() le $limitErrors]
670
return
671
(if ($messages) then 'FAILED' else 'PASSED',
672
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
673
 $messages)</textarea></div>
674
                           </div>
675
                        </div>
676
                        <div data-role="collapsible" data-enhanced="true" id="EID85190dd0-9875-40b1-a2f2-f21df86e21f1" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
677
                           <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>
678
                           <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>
679
                                                                        <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>
680
                                 <tbody>
681
                                    <tr>
682
                                       <td>Status</td>
683
                                       <td>Passed</td>
684
                                    </tr>
685
                                    <tr>
686
                                       <td>Duration</td>
687
                                       <td>0.001 s</td>
688
                                    </tr>
689
                                    <tr class="ReportDetail">
690
                                       <td>Assertion ID</td>
691
                                       <td>EID87ee2219-2ba5-4a27-91ac-2b3bf5730012</td>
692
                                    </tr>
693
                                    <tr class="DoNotShowInSimpleView">
694
                                       <td>Assertion URI</td>
695
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID85190dd0-9875-40b1-a2f2-f21df86e21f1" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID85190dd0-9875-40b1-a2f2-f21df86e21f1'); return false;">Link</a></td>
696
                                    </tr>
697
                                 </tbody>
698
                              </table><br><div class="ReportDetail Expression"><label for="EID85190dd0-9875-40b1-a2f2-f21df86e21f1.expression">Expression:</label><textarea id="EID85190dd0-9875-40b1-a2f2-f21df86e21f1.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')
699
let $messages := 
700
                (for $record in $records
701
                 let $rid := $record/gmd:fileIdentifier/*/text()
702
                 let $pocs := 
703
                        if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
704
                            $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:pointOfContact/gmd:CI_ResponsibleParty
705
                        else
706
                            $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact/gmd:CI_ResponsibleParty
707
                 return
708
                    if(not($pocs)) then
709
                             local:addMessage('TR.missingResponsibleParty', map { 'filename': local:filename($record), 'id': $rid })
710
                    else
711
                                for $poc in $pocs
712
                                let $orgName := $poc/gmd:organisationName
713
                                let $email := 
714
                                    for $y in $poc/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address
715
                    return $y/gmd:electronicMailAddress
716
                                let $emailChar := 
717
                                        for $y in $poc/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress
718
                                    return
719
                                                if ($y/gco:CharacterString/text() != '') then
720
                                                         $y
721
                                                else ()
722
                                let $emailAnc := 
723
                                        for $y in $poc/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress
724
                                    return
725
                                                if ($y/gmx:Anchor/text() != '') then
726
                                                         $y
727
                                                else ()
728
                        let $a := local:log('Email Char: ' || count($emailChar))
729
                    let $b := local:log('Email Anch: ' || count($emailAnc))
730

    
731
                                return
732
                    if (not($orgName) or not(string-length($orgName/gco:CharacterString/text()) != 0 or string-length($orgName/gmx:Anchor/text()) != 0)) then
733
                                            local:addMessage('TR.noMetadataContactOrganisationName', map { 'filename': local:filename($record), 'id': $rid })
734
                    else if (count($email) = 0 or count($emailChar) + count($emailAnc) != count($email)) then
735
                                            local:addMessage('TR.noMetadataContactEmailAddress', map { 'filename': local:filename($record), 'id': $rid })
736
                                    else if (not($poc/gmd:role) or not($poc/gmd:role/gmd:CI_RoleCode/@codeListValue = $iso19115_CIRoleCode)) then
737
                                            local:addMessage('TR.noPointOfContactRole', map { 'filename': local:filename($record), 'id': $rid })
738
                                    else ()
739
                )[position() le $limitErrors]
740
        return
741
        (if ($messages) then 'FAILED' else 'PASSED',
742
         local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
743
         $messages)</textarea></div>
744
                           </div>
745
                        </div>
746
                        <div data-role="collapsible" data-enhanced="true" id="EIDa7706994-f11a-4ee8-bf73-1b626a05d5b0" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
747
                           <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>
748
                           <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>
749
                                                                        <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>
750
                                 <tbody>
751
                                    <tr>
752
                                       <td>Status</td>
753
                                       <td>Passed</td>
754
                                    </tr>
755
                                    <tr>
756
                                       <td>Duration</td>
757
                                       <td>0.001 s</td>
758
                                    </tr>
759
                                    <tr class="ReportDetail">
760
                                       <td>Assertion ID</td>
761
                                       <td>EID01ae1fe1-1990-4716-ae09-88d1208b408c</td>
762
                                    </tr>
763
                                    <tr class="DoNotShowInSimpleView">
764
                                       <td>Assertion URI</td>
765
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDa7706994-f11a-4ee8-bf73-1b626a05d5b0" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDa7706994-f11a-4ee8-bf73-1b626a05d5b0'); return false;">Link</a></td>
766
                                    </tr>
767
                                 </tbody>
768
                              </table><br><div class="ReportDetail Expression"><label for="EIDa7706994-f11a-4ee8-bf73-1b626a05d5b0.expression">Expression:</label><textarea id="EIDa7706994-f11a-4ee8-bf73-1b626a05d5b0.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])$'
769
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)?$'
770
let $messages := 
771
        (for $record in $records
772
        let $rid := $record/gmd:fileIdentifier/*/text()
773
        let $ci_dates := $record/gmd:identificationInfo[1]/*/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date
774
        return
775
        (if(not($ci_dates/gmd:date)) then
776
                local:addMessage('TR.noRelevantDate', map { 'filename': local:filename($record), 'id': $rid })
777
        else 
778
                for $ci_date in $ci_dates
779
                let $dateType := $ci_date/gmd:dateType/gmd:CI_DateTypeCode
780
                return
781
                if (not($ci_date/gmd:date/gco:Date or $ci_date/gmd:date/gco:DateTime)) then
782
                        local:addMessage('TR.noRelevantDate', map { 'filename': local:filename($record), 'id': $rid })
783
                else if ($ci_date/gmd:date/gco:Date and not(matches($ci_date/gmd:date/gco:Date/text(),$regexDate))) then
784
                        local:addMessage('TR.invalidDateFormat', map { 'filename': local:filename($record), 'id': $rid }) 
785
                else if ($ci_date/gmd:date/gco:DateTime and not(matches($ci_date/gmd:date/gco:DateTime/text(),$regexDateTime))) then
786
                        local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
787
                else if (not($dateType)) then
788
                        local:addMessage('TR.noDateType', map { 'filename': local:filename($record), 'id': $rid })
789
                else if (not($dateType/@codeListValue = ('publication','revision','creation'))) then
790
                        local:addMessage('TR.noDateTypeForSpecification', map { 'filename': local:filename($record), 'id': $rid })
791
                else())
792
        )[position() le $limitErrors]
793
return
794
(if ($messages) then 'FAILED' else 'PASSED',
795
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
796
 $messages)</textarea></div>
797
                           </div>
798
                        </div>
799
                        <div data-role="collapsible" data-enhanced="true" id="EID44e57dcb-6734-446f-802c-e41f545411d5" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
800
                           <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>
801
                           <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>
802
                                                                        <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>
803
                                 <tbody>
804
                                    <tr>
805
                                       <td>Status</td>
806
                                       <td>Passed</td>
807
                                    </tr>
808
                                    <tr>
809
                                       <td>Duration</td>
810
                                       <td>0.001 s</td>
811
                                    </tr>
812
                                    <tr class="ReportDetail">
813
                                       <td>Assertion ID</td>
814
                                       <td>EID109cce73-7e80-432e-a3e0-450e231f4120</td>
815
                                    </tr>
816
                                    <tr class="DoNotShowInSimpleView">
817
                                       <td>Assertion URI</td>
818
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID44e57dcb-6734-446f-802c-e41f545411d5" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID44e57dcb-6734-446f-802c-e41f545411d5'); return false;">Link</a></td>
819
                                    </tr>
820
                                 </tbody>
821
                              </table><br><div class="ReportDetail Expression"><label for="EID44e57dcb-6734-446f-802c-e41f545411d5.expression">Expression:</label><textarea id="EID44e57dcb-6734-446f-802c-e41f545411d5.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])$'
822

    
823
let $dt := ('CI_DateTypeCode','http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_DateTypeCode')        
824
let $messages := 
825
        (for $record in $records
826
         let $rid := $record/gmd:fileIdentifier/*/text()
827
         let $temporalReferences := $record/gmd:identificationInfo[1]/*/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date
828
         let $creationTempRefs := $temporalReferences[gmd:dateType/*/@codeListValue = ('creation')]
829
         return
830
 if(count($creationTempRefs) ne 1 and count($creationTempRefs) ne 0) then
831
                local:addMessage('TR.moreThanOneCreationDate', map { 'filename': local:filename($record), 'id': $rid })
832
         else (for $date in $creationTempRefs
833
   return 
834
   if (not(matches($date/gmd:date/gco:Date/text(),$regex))) then
835
        local:addMessage('TR.invalidDateFormat', map { 'filename': local:filename($record), 'id': $rid }) 
836
   else())
837
        )[position() le $limitErrors]
838
return
839
(if ($messages) then 'FAILED' else 'PASSED',
840
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
841
 $messages)</textarea></div>
842
                           </div>
843
                        </div>
844
                        <div data-role="collapsible" data-enhanced="true" id="EID65e4662a-e306-4ec9-ac8c-f0b708f16b95" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
845
                           <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>
846
                           <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>
847
                                                                        <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>
848
                                 <tbody>
849
                                    <tr>
850
                                       <td>Status</td>
851
                                       <td>Passed</td>
852
                                    </tr>
853
                                    <tr>
854
                                       <td>Duration</td>
855
                                       <td>0.001 s</td>
856
                                    </tr>
857
                                    <tr class="ReportDetail">
858
                                       <td>Assertion ID</td>
859
                                       <td>EID6b4e043c-7624-4b3c-8b0c-bec547d2f8f6</td>
860
                                    </tr>
861
                                    <tr class="DoNotShowInSimpleView">
862
                                       <td>Assertion URI</td>
863
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID65e4662a-e306-4ec9-ac8c-f0b708f16b95" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID65e4662a-e306-4ec9-ac8c-f0b708f16b95'); return false;">Link</a></td>
864
                                    </tr>
865
                                 </tbody>
866
                              </table><br><div class="ReportDetail Expression"><label for="EID65e4662a-e306-4ec9-ac8c-f0b708f16b95.expression">Expression:</label><textarea id="EID65e4662a-e306-4ec9-ac8c-f0b708f16b95.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])$'
867

    
868
let $dt := ('CI_DateTypeCode','http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_DateTypeCode')        
869
let $messages := 
870
        (for $record in $records
871
         let $rid := $record/gmd:fileIdentifier/*/text()
872
         let $temporalReferences := $record/gmd:identificationInfo[1]/*/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date
873
         let $revisionTempRefs := $temporalReferences[gmd:dateType/*/@codeListValue = ('revision')]
874
         return
875
 if(count($revisionTempRefs) ne 1 and count($revisionTempRefs) ne 0) then
876
                local:addMessage('TR.moreThanOneCreationDate', map { 'filename': local:filename($record), 'id': $rid })
877
         else (for $date in $revisionTempRefs
878
   return 
879
   if (not(matches($date/gmd:date/gco:Date/text(),$regex))) then
880
        local:addMessage('TR.invalidDateFormat', map { 'filename': local:filename($record), 'id': $rid }) 
881
   else())
882
        )[position() le $limitErrors]
883
return
884
(if ($messages) then 'FAILED' else 'PASSED',
885
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
886
 $messages)</textarea></div>
887
                           </div>
888
                        </div>
889
                        <div data-role="collapsible" data-enhanced="true" id="EIDf945dade-a955-4289-bad4-286588d15d0f" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
890
                           <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>
891
                           <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>
892
                                                                        <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>
893
                                 <tbody>
894
                                    <tr>
895
                                       <td>Status</td>
896
                                       <td>Passed</td>
897
                                    </tr>
898
                                    <tr>
899
                                       <td>Duration</td>
900
                                       <td>0.001 s</td>
901
                                    </tr>
902
                                    <tr class="ReportDetail">
903
                                       <td>Assertion ID</td>
904
                                       <td>EID76f8fb3a-c00f-11e8-a355-529269fb1459</td>
905
                                    </tr>
906
                                    <tr class="DoNotShowInSimpleView">
907
                                       <td>Assertion URI</td>
908
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDf945dade-a955-4289-bad4-286588d15d0f" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDf945dade-a955-4289-bad4-286588d15d0f'); return false;">Link</a></td>
909
                                    </tr>
910
                                 </tbody>
911
                              </table><br><div class="ReportDetail Expression"><label for="EIDf945dade-a955-4289-bad4-286588d15d0f.expression">Expression:</label><textarea id="EIDf945dade-a955-4289-bad4-286588d15d0f.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 := 
912
        (for $record in $records
913
         let $rid := $record/gmd:fileIdentifier/*/text()
914
         let $regex := '^(\d{4})(-(\d{2}))??(-(\d{2}))??(T(\d{2}):(\d{2})(:(\d{2}))??(\.(\d+))??(([\+\-]{1}\d{2}:\d{2})|Z)??)??$'
915
         let $temporalExtentextents := $record/gmd:identificationInfo[1]/*/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent
916
         return
917
                 for $extent in $temporalExtentextents
918
                let $timePosition := $extent/*:TimeInstant/*:timePosition
919
                let $timePeriod := $extent/*:TimePeriod
920
                let $beginPosition := $extent/*:TimePeriod/*:beginPosition
921
                let $endPosition := $extent/*:TimePeriod/*:endPosition
922
                return
923
                if ($timePosition) then
924
                        if (not(matches($timePosition/text(), $regex))) then
925
                                local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
926
                        else ()
927
                else if($timePeriod) then
928
                        if (not($beginPosition/@indeterminatePosition) and not(matches($beginPosition/text(), $regex))) then
929
                                local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
930
                        else if ($beginPosition/@indeterminatePosition and not($beginPosition/@indeterminatePosition = 'unknown')) then
931
                                local:addMessage('TR.wrongIndeterminatePosition', map { 'filename': local:filename($record), 'id': $rid })
932
                        else if (not($endPosition/@indeterminatePosition) and not(matches($endPosition/text(), $regex))) then
933
                                local:addMessage('TR.wrongDateFormat', map { 'filename': local:filename($record), 'id': $rid })
934
                        else if ($endPosition/@indeterminatePosition and not($endPosition/@indeterminatePosition = 'unknown' or $endPosition/@indeterminatePosition = 'now')) then
935
                                local:addMessage('TR.wrongIndeterminatePosition', map { 'filename': local:filename($record), 'id': $rid })
936
                        else ()
937
                else
938
                        local:addMessage('TR.noTimePositionOrPeriod', map { 'filename': local:filename($record), 'id': $rid })
939
        )[position() le $limitErrors]
940
return
941
(if ($messages) then 'FAILED' else 'PASSED',
942
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
943
 $messages)</textarea></div>
944
                           </div>
945
                        </div>
946
                        <div data-role="collapsible" data-enhanced="true" id="EID1ad62750-7c9b-4df7-8293-d8b0f26769eb" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
947
                           <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>
948
                           <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>
949
                                                                        <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>
950
                                 <tbody>
951
                                    <tr>
952
                                       <td>Status</td>
953
                                       <td>Passed</td>
954
                                    </tr>
955
                                    <tr>
956
                                       <td>Duration</td>
957
                                       <td>0.001 s</td>
958
                                    </tr>
959
                                    <tr class="ReportDetail">
960
                                       <td>Assertion ID</td>
961
                                       <td>EID76f8ff36-c00f-11e8-a355-529269fb1459</td>
962
                                    </tr>
963
                                    <tr class="DoNotShowInSimpleView">
964
                                       <td>Assertion URI</td>
965
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID1ad62750-7c9b-4df7-8293-d8b0f26769eb" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID1ad62750-7c9b-4df7-8293-d8b0f26769eb'); return false;">Link</a></td>
966
                                    </tr>
967
                                 </tbody>
968
                              </table><br><div class="ReportDetail Expression"><label for="EID1ad62750-7c9b-4df7-8293-d8b0f26769eb.expression">Expression:</label><textarea id="EID1ad62750-7c9b-4df7-8293-d8b0f26769eb.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])$'
969

    
970
let $messages := 
971
        (for $record in $records
972
         let $rid := $record/gmd:fileIdentifier/*/text()
973
         let $thesauri := 
974
                if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
975
                        $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:thesaurusName
976
                else
977
                        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:thesaurusName
978
         return
979
         if(not($thesauri)) then ()
980
         else for $thesaurus in $thesauri
981
         let $title := $thesaurus/gmd:CI_Citation/gmd:title
982
         let $keywords := string-join($thesaurus/../gmd:keyword/*[1]/text(), '; ')
983
         let $date := $thesaurus/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date
984
         let $dateTypeCode := $thesaurus/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode
985
         return 
986
                 if (not($title)) then local:addMessage('TR.noTitleForThesaurus', map { 'filename': local:filename($record), 'id': $rid})
987
        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})
988
                else if (not($date)) then local:addMessage('TR.invalidDateForThesaurus2', map { 'filename': local:filename($record), 'id': $rid, 'thesaurus': $title/*/text(), 'keywords' : $keywords})
989
                 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})
990
                else ()
991
        )[position() le $limitErrors]
992
return
993
(if ($messages) then 'FAILED' else 'PASSED',
994
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
995
 $messages)</textarea></div>
996
                           </div>
997
                        </div>
998
                        <div data-role="collapsible" data-enhanced="true" id="EIDa979beed-e043-4249-ae4c-527a37769576" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
999
                           <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>
1000
                           <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>
1001
                                                                        <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>
1002
                                 <tbody>
1003
                                    <tr>
1004
                                       <td>Status</td>
1005
                                       <td>Passed</td>
1006
                                    </tr>
1007
                                    <tr>
1008
                                       <td>Duration</td>
1009
                                       <td>0.001 s</td>
1010
                                    </tr>
1011
                                    <tr class="ReportDetail">
1012
                                       <td>Assertion ID</td>
1013
                                       <td>EID76f901ca-c00f-11e8-a355-529269fb1459</td>
1014
                                    </tr>
1015
                                    <tr class="DoNotShowInSimpleView">
1016
                                       <td>Assertion URI</td>
1017
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDa979beed-e043-4249-ae4c-527a37769576" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDa979beed-e043-4249-ae4c-527a37769576'); return false;">Link</a></td>
1018
                                    </tr>
1019
                                 </tbody>
1020
                              </table><br><div class="ReportDetail Expression"><label for="EIDa979beed-e043-4249-ae4c-527a37769576.expression">Expression:</label><textarea id="EIDa979beed-e043-4249-ae4c-527a37769576.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 := 
1021
        (for $record in $records
1022
         let $rid := $record/gmd:fileIdentifier/*/text()
1023
         let $keywords := 
1024
                if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
1025
                        $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:descriptiveKeywords
1026
                else
1027
                        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords
1028
         let $thesaurusNameTitle := 
1029
                if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
1030
                        $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:title
1031
                else
1032
                        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:title
1033
         return
1034
         if (count($thesaurusNameTitle) != count(distinct-values($thesaurusNameTitle))) then
1035
           local:addMessage('TR.keywordsNotGroupedByVocabulary', map { 'filename': local:filename($record), 'id': $rid })
1036
         else ()
1037
        )[position() le $limitErrors]
1038
return
1039
(if ($messages) then 'FAILED' else 'PASSED',
1040
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1041
 $messages)</textarea></div>
1042
                           </div>
1043
                        </div>
1044
                        <div data-role="collapsible" data-enhanced="true" id="EIDfe90cf85-5f90-4aa7-9065-34ae1615f602" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1045
                           <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>
1046
                           <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>
1047
                                                                        <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>
1048
                                 <tbody>
1049
                                    <tr>
1050
                                       <td>Status</td>
1051
                                       <td>Passed</td>
1052
                                    </tr>
1053
                                    <tr>
1054
                                       <td>Duration</td>
1055
                                       <td>0.001 s</td>
1056
                                    </tr>
1057
                                    <tr class="ReportDetail">
1058
                                       <td>Assertion ID</td>
1059
                                       <td>EIDf7e5c9d6-7a5c-47cc-9c95-1d4f3a5f92eb</td>
1060
                                    </tr>
1061
                                    <tr class="DoNotShowInSimpleView">
1062
                                       <td>Assertion URI</td>
1063
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDfe90cf85-5f90-4aa7-9065-34ae1615f602" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDfe90cf85-5f90-4aa7-9065-34ae1615f602'); return false;">Link</a></td>
1064
                                    </tr>
1065
                                 </tbody>
1066
                              </table><br><div class="ReportDetail Expression"><label for="EIDfe90cf85-5f90-4aa7-9065-34ae1615f602.expression">Expression:</label><textarea id="EIDfe90cf85-5f90-4aa7-9065-34ae1615f602.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 :=
1067
        (for $record in $records
1068
         let $rid := $record/gmd:fileIdentifier/*/text()
1069
         let $md_legalConstraints_Limitations :=
1070
                for $x in $record/gmd:identificationInfo/*/gmd:resourceConstraints/gmd:MD_LegalConstraints where (count($x/gmd:accessConstraints) != 0)
1071
                let $validAccessConstraints :=
1072
                        for $ac in $x/gmd:accessConstraints
1073
                        where ($ac/gmd:MD_RestrictionCode/@codeListValue = 'otherRestrictions')
1074
                        return $ac
1075
                let $validAnchor :=
1076
                        for $y in $x/gmd:otherConstraints/gmx:Anchor
1077
                        where ($y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1a' or
1078
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1b' or
1079
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1c' or
1080
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1d' or
1081
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1e' or
1082
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1f' or
1083
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1g' or
1084
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1h' or
1085
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations' or
1086
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1a' or
1087
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1b' or
1088
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1c' or
1089
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1d' or
1090
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1e' or
1091
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1f' or
1092
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1g' or
1093
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1h' or
1094
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations')
1095
                        return $y
1096
                let $invalidAnchor :=
1097
                        for $y in $x/gmd:otherConstraints/gmx:Anchor
1098
                        where ($y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply' or
1099
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/conditionsUnknown' or
1100
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply' or
1101
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/conditionsUnknown')
1102
                        return $y
1103
                return
1104
                        if(count($validAnchor) &gt;= 1 and count($validAccessConstraints) = 1) then $x
1105
                        else ()
1106
         return
1107
         if (count($md_legalConstraints_Limitations) != 1) then
1108
                local:addMessage('TR.noValidResourceLimitations', map { 'filename': local:filename($record), 'id': $rid })
1109
         else ()
1110
        )[position() le $limitErrors]
1111
return
1112
(if ($messages) then 'FAILED' else 'PASSED',
1113
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1114
 $messages)</textarea></div>
1115
                           </div>
1116
                        </div>
1117
                        <div data-role="collapsible" data-enhanced="true" id="EID6c44bb08-9199-4c7e-b1d1-06ba86334283" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1118
                           <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>
1119
                           <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>
1120
                                                                        <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>
1121
                                 <tbody>
1122
                                    <tr>
1123
                                       <td>Status</td>
1124
                                       <td>Passed</td>
1125
                                    </tr>
1126
                                    <tr>
1127
                                       <td>Duration</td>
1128
                                       <td>0.001 s</td>
1129
                                    </tr>
1130
                                    <tr class="ReportDetail">
1131
                                       <td>Assertion ID</td>
1132
                                       <td>EID410b57a6-0314-4506-9352-19042f1723cd</td>
1133
                                    </tr>
1134
                                    <tr class="DoNotShowInSimpleView">
1135
                                       <td>Assertion URI</td>
1136
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID6c44bb08-9199-4c7e-b1d1-06ba86334283" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID6c44bb08-9199-4c7e-b1d1-06ba86334283'); return false;">Link</a></td>
1137
                                    </tr>
1138
                                 </tbody>
1139
                              </table><br><div class="ReportDetail Expression"><label for="EID6c44bb08-9199-4c7e-b1d1-06ba86334283.expression">Expression:</label><textarea id="EID6c44bb08-9199-4c7e-b1d1-06ba86334283.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 :=
1140
        (for $record in $records
1141
        let $rid := $record/gmd:fileIdentifier/*/text()
1142
        let $md_legalConstraints_Conditions :=
1143
                for $x in $record/gmd:identificationInfo/*/gmd:resourceConstraints/gmd:MD_LegalConstraints
1144
                let $validAccessConstraints :=
1145
                        for $ac in $x/gmd:accessConstraints
1146
                        where ($ac/gmd:MD_RestrictionCode/@codeListValue = 'otherRestrictions')
1147
                        return $ac
1148
                let $validUseConstraints :=
1149
                        for $uc in $x/gmd:useConstraints
1150
                        where ($uc/gmd:MD_RestrictionCode/@codeListValue = 'otherRestrictions')
1151
                        return $uc
1152
                let $validAnchor :=
1153
                        for $y in $x/gmd:otherConstraints/gmx:Anchor
1154
                        where ($y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply' or
1155
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/conditionsUnknown' or
1156
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply' or
1157
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/conditionsUnknown')
1158
                        return $y
1159
                let $invalidAnchor :=
1160
                        for $y in $x/gmd:otherConstraints/gmx:Anchor
1161
                        where ($y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1a' or
1162
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1b' or
1163
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1c' or
1164
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1d' or
1165
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1e' or
1166
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1f' or
1167
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1g' or
1168
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1h' or
1169
                                $y/@xlink:href = 'http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations' or
1170
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1a' or
1171
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1b' or
1172
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1c' or
1173
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1d' or
1174
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1e' or
1175
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1f' or
1176
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1g' or
1177
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1h' or
1178
                                $y/@xlink:href = 'https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations')
1179
                        return $y
1180
                return
1181
                        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
1182
                        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
1183
                         else ()
1184
        return ()
1185
        )[position() le $limitErrors]
1186
return
1187
(if ($messages) then 'FAILED' else 'PASSED',
1188
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1189
 $messages)</textarea></div>
1190
                           </div>
1191
                        </div>
1192
                        <div data-role="collapsible" data-enhanced="true" id="EID52bd7c75-ed9c-4154-b3e8-04bcb9ab85a3" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1193
                           <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>
1194
                           <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>
1195
                                                                        <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>
1196
                                 <tbody>
1197
                                    <tr>
1198
                                       <td>Status</td>
1199
                                       <td>Passed</td>
1200
                                    </tr>
1201
                                    <tr>
1202
                                       <td>Duration</td>
1203
                                       <td>0.001 s</td>
1204
                                    </tr>
1205
                                    <tr class="ReportDetail">
1206
                                       <td>Assertion ID</td>
1207
                                       <td>EID701be21b-1158-4055-9594-67a4e2005e38</td>
1208
                                    </tr>
1209
                                    <tr class="DoNotShowInSimpleView">
1210
                                       <td>Assertion URI</td>
1211
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID52bd7c75-ed9c-4154-b3e8-04bcb9ab85a3" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID52bd7c75-ed9c-4154-b3e8-04bcb9ab85a3'); return false;">Link</a></td>
1212
                                    </tr>
1213
                                 </tbody>
1214
                              </table><br><div class="ReportDetail Expression"><label for="EID52bd7c75-ed9c-4154-b3e8-04bcb9ab85a3.expression">Expression:</label><textarea id="EID52bd7c75-ed9c-4154-b3e8-04bcb9ab85a3.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 := 
1215
        for $record in $records
1216
        let $rid := $record/gmd:fileIdentifier/*/text()
1217
        let $extents := 
1218
    if ($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'service') then
1219
                $record/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox
1220
    else
1221
        $record/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox
1222
        let $regex := '^-?\d+\.\d{2,}'
1223
        let $rid := $record/gmd:fileIdentifier/*/text()
1224
        return
1225
                (if (($record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'dataset' or $record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = 'series') and not($extents)) then
1226
                local:addMessage('TR.noGeographicBoundingBox', map { 'filename': local:filename($record), 'id': $rid })
1227
                else
1228
                (
1229
                for $extent in $extents
1230
                let $west := $extent/gmd:westBoundLongitude/gco:Decimal/text()
1231
                let $east := $extent/gmd:eastBoundLongitude/gco:Decimal/text()
1232
                let $south := $extent/gmd:southBoundLatitude/gco:Decimal/text()
1233
                let $north := $extent/gmd:northBoundLatitude/gco:Decimal/text()
1234
                return
1235
                if (not(($west and matches($west,$regex) and fn:number($west) &gt;= -180 and fn:number($west) &lt;= 180) and
1236
                                        ($east and matches($east,$regex) and fn:number($east) &gt;= -180 and fn:number($east) &lt;= 180) and
1237
                                        ($south and matches($south,$regex) and fn:number($south) &gt;= -90 and fn:number($south) &lt;= 90) and
1238
                                        ($north and matches($north,$regex) and fn:number($north) &gt;= -90 and fn:number($north) &lt;= 90) and
1239
                                        (fn:number($south) &lt;= fn:number($north)))) then
1240
                        local:addMessage('TR.invalidGeographicBoundingBox', map { 'filename': local:filename($record), 'id': $rid, 'west': $west, 'east': $east, 'south': $south, 'north': $north })
1241
                else ()
1242
                )
1243
        )[position() le $limitErrors]
1244
return
1245
(if ($messages) then 'FAILED' else 'PASSED',
1246
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1247
 $messages)</textarea></div>
1248
                           </div>
1249
                        </div>
1250
                     </div>
1251
                  </div>
1252
               </div>
1253
               <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">
1254
                  <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
1255
                        <div class="ui-li-count">3</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
1256
                  <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 
1257
                                        elements of the section of the XML document: Data Quality Information (property of the gmd:MD_Metadata element). 
1258
                                        This section contains information specific to the quality and lineage (including processing steps and sources) of the 
1259
                                        resource.<br><br><table>
1260
                        <tbody>
1261
                           <tr>
1262
                              <td>Status</td>
1263
                              <td>Passed</td>
1264
                           </tr>
1265
                           <tr>
1266
                              <td>Duration</td>
1267
                              <td>0.001 s</td>
1268
                           </tr>
1269
                           <tr class="ReportDetail">
1270
                              <td>Test case ID</td>
1271
                              <td>EID61e803d0-c181-11e8-a355-529269fb1459</td>
1272
                           </tr>
1273
                        </tbody>
1274
                     </table><br><div class="TestStepPlaceHolder">
1275
                        <div data-role="collapsible" data-enhanced="true" id="EIDb22f1fcc-4c0d-43b0-9e28-3dd903c894d7" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1276
                           <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>
1277
                           <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>
1278
                                                                        <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>
1279
                                 <tbody>
1280
                                    <tr>
1281
                                       <td>Status</td>
1282
                                       <td>Passed</td>
1283
                                    </tr>
1284
                                    <tr>
1285
                                       <td>Duration</td>
1286
                                       <td>0.001 s</td>
1287
                                    </tr>
1288
                                    <tr class="ReportDetail">
1289
                                       <td>Assertion ID</td>
1290
                                       <td>EIDf55f2448-c4d5-4af0-a83b-40ccd0d2a7df</td>
1291
                                    </tr>
1292
                                    <tr class="DoNotShowInSimpleView">
1293
                                       <td>Assertion URI</td>
1294
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDb22f1fcc-4c0d-43b0-9e28-3dd903c894d7" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDb22f1fcc-4c0d-43b0-9e28-3dd903c894d7'); return false;">Link</a></td>
1295
                                    </tr>
1296
                                 </tbody>
1297
                              </table><br><div class="ReportDetail Expression"><label for="EIDb22f1fcc-4c0d-43b0-9e28-3dd903c894d7.expression">Expression:</label><textarea id="EIDb22f1fcc-4c0d-43b0-9e28-3dd903c894d7.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')
1298
let $recordsToInspect := $records[gmd:hierarchyLevel/*/@codeListValue = $levels]
1299
let $messages := 
1300
        (for $record in $recordsToInspect
1301
         let $rid := $record/gmd:fileIdentifier/*/text()
1302
         let $confResult := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult
1303
         return 
1304
         if (not($confResult)) then
1305
                local:addMessage('TR.noConformityStatement', map { 'filename': local:filename($record), 'id': $rid })
1306
         else ()
1307
        )[position() le $limitErrors]
1308
return
1309
(if ($messages) then 'FAILED' else 'PASSED',
1310
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1311
 $messages)</textarea></div>
1312
                           </div>
1313
                        </div>
1314
                        <div data-role="collapsible" data-enhanced="true" id="EID35c3a908-8c28-4f94-be98-df0e8ac121a4" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1315
                           <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>
1316
                           <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>
1317
                                                                        <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>
1318
                                 <tbody>
1319
                                    <tr>
1320
                                       <td>Status</td>
1321
                                       <td>Passed</td>
1322
                                    </tr>
1323
                                    <tr>
1324
                                       <td>Duration</td>
1325
                                       <td>0.001 s</td>
1326
                                    </tr>
1327
                                    <tr class="ReportDetail">
1328
                                       <td>Assertion ID</td>
1329
                                       <td>EID1f9ddbc5-679b-44b0-bd6f-db14c9c348a9</td>
1330
                                    </tr>
1331
                                    <tr class="DoNotShowInSimpleView">
1332
                                       <td>Assertion URI</td>
1333
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID35c3a908-8c28-4f94-be98-df0e8ac121a4" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID35c3a908-8c28-4f94-be98-df0e8ac121a4'); return false;">Link</a></td>
1334
                                    </tr>
1335
                                 </tbody>
1336
                              </table><br><div class="ReportDetail Expression"><label for="EID35c3a908-8c28-4f94-be98-df0e8ac121a4.expression">Expression:</label><textarea id="EID35c3a908-8c28-4f94-be98-df0e8ac121a4.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])$'
1337
let $levels := ('dataset', 'series', 'service')
1338
let $recordsToInspect := $records[gmd:hierarchyLevel/*/@codeListValue = $levels]
1339
let $messages := 
1340
        (for $record in $recordsToInspect
1341
        let $rid := $record/gmd:fileIdentifier/*/text()
1342
        let $result := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult
1343
        return 
1344
        if (not($result)) then
1345
                local:addMessage('TR.noConformityStatement', map { 'filename': local:filename($record), 'id': $rid })
1346
        else if (not($result/gmd:specification/gmd:CI_Citation)) then
1347
                local:addMessage('TR.missingCitationSection', map { 'filename': local:filename($record), 'id': $rid })
1348
        else
1349
                 (for $res in $result
1350
                return
1351
                if(not($res/gmd:specification/gmd:CI_Citation)) then
1352
                        local:addMessage('TR.noCitationForSpecification', map { 'filename': local:filename($record), 'id': $rid })
1353
                else
1354
                for $citation in $res/gmd:specification/gmd:CI_Citation
1355
                        let $title := $citation/gmd:title
1356
                        let $date := $citation/gmd:date
1357
                        let $dateTypeCode := $citation/gmd:date/gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode
1358
                        return
1359
                        if (not($title) or not(string-length($title/gco:CharacterString/text()) != 0 or string-length($title/gmx:Anchor/text()) != 0)) then
1360
                                local:addMessage('TR.noTitleForSpecification', map { 'filename': local:filename($record), 'id': $rid })
1361
                        else if ($title/gmd:PT_FreeText) then
1362
                                for $localisedCharacterString in $title/gmd:PT_FreeText/gmd:textGroup/gmd:LocalisedCharacterString
1363
                                        return
1364
                                        if (string-length($localisedCharacterString) = 0) then
1365
                                        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'})
1366
                                        else ()
1367
                        else if (not($date)) then
1368
                                local:addMessage('TR.noDateTypeForSpecification', map { 'filename': local:filename($record), 'id': $rid })
1369
                        else if (not($dateTypeCode)) then
1370
                                local:addMessage('TR.noDateTypeForSpecification', map { 'filename': local:filename($record), 'id': $rid })
1371
                        else if (not($dateTypeCode/@codeListValue = ('publication'))) then
1372
                                local:addMessage('TR.noDateTypeForSpecification', map { 'filename': local:filename($record), 'id': $rid })
1373
                        else if (not(matches($date/gmd:CI_Date/gmd:date/gco:Date/text(), $regex))) then
1374
                                local:addMessage('TR.invalidDateFormat', map { 'filename': local:filename($record), 'id': $rid})
1375
                        else ())
1376
        )[position() le $limitErrors]
1377
return
1378
(if ($messages) then 'FAILED' else 'PASSED',
1379
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1380
 $messages)</textarea></div>
1381
                           </div>
1382
                        </div>
1383
                        <div data-role="collapsible" data-enhanced="true" id="EID04b2751a-590c-47fd-8ecc-913c8bb2223e" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1384
                           <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>
1385
                           <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>
1386
                                                                        <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>
1387
                                 <tbody>
1388
                                    <tr>
1389
                                       <td>Status</td>
1390
                                       <td>Passed</td>
1391
                                    </tr>
1392
                                    <tr>
1393
                                       <td>Duration</td>
1394
                                       <td>0.001 s</td>
1395
                                    </tr>
1396
                                    <tr class="ReportDetail">
1397
                                       <td>Assertion ID</td>
1398
                                       <td>EID614cd750-a8a2-4256-908c-e452c2b4e506</td>
1399
                                    </tr>
1400
                                    <tr class="DoNotShowInSimpleView">
1401
                                       <td>Assertion URI</td>
1402
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID04b2751a-590c-47fd-8ecc-913c8bb2223e" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID04b2751a-590c-47fd-8ecc-913c8bb2223e'); return false;">Link</a></td>
1403
                                    </tr>
1404
                                 </tbody>
1405
                              </table><br><div class="ReportDetail Expression"><label for="EID04b2751a-590c-47fd-8ecc-913c8bb2223e.expression">Expression:</label><textarea id="EID04b2751a-590c-47fd-8ecc-913c8bb2223e.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 := 
1406
        (for $record in $records
1407
         let $rid := $record/gmd:fileIdentifier/*/text()
1408
         let $result := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult
1409
         return 
1410
         if (not($result)) then
1411
                local:addMessage('TR.noConformityStatement', map { 'filename': local:filename($record), 'id': $rid })
1412
         else
1413
                 (for $res in $result
1414
                let $pass := $res/gmd:pass
1415
                return
1416
                if ($pass) then
1417
                        if($pass/gco:Boolean) then
1418
                                if (not($pass/gco:Boolean/text() = 'true' or $pass/gco:Boolean/text() = 'false')) then
1419
                                        local:addMessage('TR.declareNoConformityEvaluationAsUnknown', map { 'filename': local:filename($record), 'id': $rid })
1420
                                else ()
1421
                        else if (not($pass/@gco:nilReason)) then
1422
                                local:addMessage('TR.declareNoConformityEvaluationAsUnknown', map { 'filename': local:filename($record), 'id': $rid })
1423
                        else if (not($pass/@gco:nilReason = 'unknown')) then
1424
                                local:addMessage('TR.declareNoConformityEvaluationAsUnknown', map { 'filename': local:filename($record), 'id': $rid })
1425
                        else ()
1426
                else 
1427
                        local:addMessage('TR.declareNoConformityEvaluationAsUnknown', map { 'filename': local:filename($record), 'id': $rid })
1428
                )
1429
        )[position() le $limitErrors]
1430
return
1431
(if ($messages) then 'FAILED' else 'PASSED',
1432
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1433
 $messages)</textarea></div>
1434
                           </div>
1435
                        </div>
1436
                     </div>
1437
                  </div>
1438
               </div>
1439
            </div>
1440
         </div>
1441
         <div class="TestSuite" data-role="collapsible" data-theme="h" data-content-theme="h">
1442
            <h2>Conformance Class 1: INSPIRE data sets and data set series baseline metadata.
1443
               <div class="ui-li-count">3</div>
1444
            </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/>
1445
Known limitations are documented in the description of the applicable test case or test assertion.<br/><br/>
1446
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.
1447
<br/><br/>
1448
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/>
1449
Pre-requisite conformance classes: Common Requirements<br><br><table>
1450
               <tbody>
1451
                  <tr>
1452
                     <td>Status</td>
1453
                     <td>Passed</td>
1454
                  </tr>
1455
                  <tr>
1456
                     <td>Duration</td>
1457
                     <td>4 s</td>
1458
                  </tr>
1459
                  <tr class="ReportDetail">
1460
                     <td>Test suite ID</td>
1461
                     <td>EIDe4a95862-9cc9-436b-9fdd-a0115d342350</td>
1462
                  </tr>
1463
                  <tr class="ReportDetail">
1464
                     <td>Author</td>
1465
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
1466
                  </tr>
1467
                  <tr class="ReportDetail">
1468
                     <td>Date created</td>
1469
                     <td>30/06/2018 00:00:00 GMT</td>
1470
                  </tr>
1471
                  <tr>
1472
                     <td>Version</td>
1473
                     <td>0.1.0</td>
1474
                  </tr>
1475
                  <tr class="ReportDetail">
1476
                     <td>Last editor</td>
1477
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
1478
                  </tr>
1479
                  <tr class="ReportDetail">
1480
                     <td>Last updated</td>
1481
                     <td>30/08/2018 20:45:00 GMT</td>
1482
                  </tr>
1483
                  <tr class="ReportDetail">
1484
                     <td>Reference</td>
1485
                     <td><a class="ui-link" href="https://github.com/inspire-eu-validation/ets-repository/tree/master/metadata/2.0">Link</a></td>
1486
                  </tr>
1487
                  <tr class="ReportDetail">
1488
                     <td>Hash</td>
1489
                     <td>CBF29CE484222325</td>
1490
                  </tr>
1491
               </tbody>
1492
            </table><br><div class="TestModulePlaceHolder">
1493
               <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">
1494
                  <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
1495
                        <div class="ui-li-count">1</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
1496
                  <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>
1497
                        <tbody>
1498
                           <tr>
1499
                              <td>Status</td>
1500
                              <td>Passed</td>
1501
                           </tr>
1502
                           <tr>
1503
                              <td>Duration</td>
1504
                              <td>0.001 s</td>
1505
                           </tr>
1506
                           <tr class="ReportDetail">
1507
                              <td>Test case ID</td>
1508
                              <td>EIDf6fb6d58-03ec-432f-a456-984d093721e4</td>
1509
                           </tr>
1510
                        </tbody>
1511
                     </table><br><div class="TestStepPlaceHolder">
1512
                        <div data-role="collapsible" data-enhanced="true" id="EID521002ae-5f98-4b17-93bc-63fd407a861a" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1513
                           <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>
1514
                           <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>
1515
                                                                        <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>
1516
                                 <tbody>
1517
                                    <tr>
1518
                                       <td>Status</td>
1519
                                       <td>Passed</td>
1520
                                    </tr>
1521
                                    <tr>
1522
                                       <td>Duration</td>
1523
                                       <td>0.001 s</td>
1524
                                    </tr>
1525
                                    <tr class="ReportDetail">
1526
                                       <td>Assertion ID</td>
1527
                                       <td>EID9f5d8bbf-59d3-4278-82d3-c9df32d8f42d</td>
1528
                                    </tr>
1529
                                    <tr class="DoNotShowInSimpleView">
1530
                                       <td>Assertion URI</td>
1531
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID521002ae-5f98-4b17-93bc-63fd407a861a" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID521002ae-5f98-4b17-93bc-63fd407a861a'); return false;">Link</a></td>
1532
                                    </tr>
1533
                                 </tbody>
1534
                              </table><br><div class="ReportDetail Expression"><label for="EID521002ae-5f98-4b17-93bc-63fd407a861a.expression">Expression:</label><textarea id="EID521002ae-5f98-4b17-93bc-63fd407a861a.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')
1535
let $recordsWithErrors := $records[not(gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue = $values)][position() le $limitErrors]
1536
return
1537
(if ($recordsWithErrors) then 'FAILED' else 'PASSED',
1538
 local:error-statistics('TR.recordsWithErrors', count($recordsWithErrors)),
1539
 for $record in $recordsWithErrors
1540
   let $rid := $record/gmd:fileIdentifier/gco:CharacterString/text()
1541
   order by $rid
1542
   let $levels := $record/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue
1543
   return
1544
     local:addMessage('TR.hierarchyLevel', map { 'filename': local:filename($record), 'id': $rid, 'hierarchyLevels': fn:string-join($levels,', ') })
1545
)</textarea></div>
1546
                           </div>
1547
                        </div>
1548
                     </div>
1549
                  </div>
1550
               </div>
1551
               <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">
1552
                  <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
1553
                        <div class="ui-li-count">6</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
1554
                  <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>
1555
                        <tbody>
1556
                           <tr>
1557
                              <td>Status</td>
1558
                              <td>Passed</td>
1559
                           </tr>
1560
                           <tr>
1561
                              <td>Duration</td>
1562
                              <td>2.394 s</td>
1563
                           </tr>
1564
                           <tr class="ReportDetail">
1565
                              <td>Test case ID</td>
1566
                              <td>EID979c19da-48f9-416d-b751-37ef13912bc6</td>
1567
                           </tr>
1568
                        </tbody>
1569
                     </table><br><div class="TestStepPlaceHolder">
1570
                        <div data-role="collapsible" data-enhanced="true" id="EIDbbd415e7-23ad-4a50-8b2d-e7b17f24da42" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1571
                           <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>
1572
                           <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>
1573
                                                                        <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>
1574
                                 <tbody>
1575
                                    <tr>
1576
                                       <td>Status</td>
1577
                                       <td>Passed</td>
1578
                                    </tr>
1579
                                    <tr>
1580
                                       <td>Duration</td>
1581
                                       <td>0.001 s</td>
1582
                                    </tr>
1583
                                    <tr class="ReportDetail">
1584
                                       <td>Assertion ID</td>
1585
                                       <td>EIDfeb08775-3d07-4849-bd27-3a549c92d289</td>
1586
                                    </tr>
1587
                                    <tr class="DoNotShowInSimpleView">
1588
                                       <td>Assertion URI</td>
1589
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDbbd415e7-23ad-4a50-8b2d-e7b17f24da42" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDbbd415e7-23ad-4a50-8b2d-e7b17f24da42'); return false;">Link</a></td>
1590
                                    </tr>
1591
                                 </tbody>
1592
                              </table><br><div class="ReportDetail Expression"><label for="EIDbbd415e7-23ad-4a50-8b2d-e7b17f24da42.expression">Expression:</label><textarea id="EIDbbd415e7-23ad-4a50-8b2d-e7b17f24da42.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 := (
1593
        for $record in $records
1594
        let $rid := $record/gmd:fileIdentifier/gco:CharacterString/text()
1595
        return
1596
        if(count($record/gmd:identificationInfo[1]/gmd:MD_DataIdentification) != 1) then
1597
                local:addMessage('TR.identificationInfo', map { 'filename': local:filename($record), 'id': $rid, 'identificationInfo': fn:string-join($record/gmd:identificationInfo[1]/gmd:MD_DataIdentification,', ') })
1598
        else ()
1599
)[position() le $limitErrors]
1600
return
1601
(if ($messages) then 'FAILED' else 'PASSED',
1602
local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1603
$messages)</textarea></div>
1604
                           </div>
1605
                        </div>
1606
                        <div data-role="collapsible" data-enhanced="true" id="EID37201ef2-0a51-45e0-903f-4d76dc733cdc" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1607
                           <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>
1608
                           <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>
1609
                                                                        <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>
1610
                                 <tbody>
1611
                                    <tr>
1612
                                       <td>Status</td>
1613
                                       <td>Passed</td>
1614
                                    </tr>
1615
                                    <tr>
1616
                                       <td>Duration</td>
1617
                                       <td>0.001 s</td>
1618
                                    </tr>
1619
                                    <tr class="ReportDetail">
1620
                                       <td>Assertion ID</td>
1621
                                       <td>EID06911d33-b5a3-4b76-b8ee-d473ebf3c8f4</td>
1622
                                    </tr>
1623
                                    <tr class="DoNotShowInSimpleView">
1624
                                       <td>Assertion URI</td>
1625
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID37201ef2-0a51-45e0-903f-4d76dc733cdc" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID37201ef2-0a51-45e0-903f-4d76dc733cdc'); return false;">Link</a></td>
1626
                                    </tr>
1627
                                 </tbody>
1628
                              </table><br><div class="ReportDetail Expression"><label for="EID37201ef2-0a51-45e0-903f-4d76dc733cdc.expression">Expression:</label><textarea id="EID37201ef2-0a51-45e0-903f-4d76dc733cdc.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')
1629
let $allIdent := 
1630
        for $rec in $records
1631
                for $x in $rec/gmd:identificationInfo[1]/*/gmd:citation/gmd:CI_Citation/gmd:identifier/*/gmd:code/*
1632
                return
1633
                if($x/node-name() = QName('http://www.isotc211.org/2005/gco','gco:CharacterString')) then $x/text()
1634
                else if ($x/node-name() = QName('http://www.isotc211.org/2005/gmx','gmx:Anchor')) then $x/@xlink:href
1635
                else ()
1636
let $distinctRecordIdentifiers := distinct-values($allIdent)
1637
let $duplicateDistinctRecordIdentifiers := $distinctRecordIdentifiers[index-of($distinctRecordIdentifiers,.)[2]]
1638
let $messages :=    
1639
    (for $record in $records
1640
        let $rid := $record/gmd:fileIdentifier/gco:CharacterString/text()
1641
        let $identifiers := $record/gmd:identificationInfo[1]/*/gmd:citation/gmd:CI_Citation/gmd:identifier/*/gmd:code
1642
                let $emptyIdentifiers :=
1643
                        for $identifier in $identifiers
1644
            return
1645
                        if (not($identifier)) then
1646
                                $identifier
1647
            else if ($identifier/gco:CharacterString and not(string-length($identifier/gco:CharacterString/text()) != 0)) then
1648
                                $identifier
1649
                        else if ($identifier/gmx:Anchor and string-length($identifier/gmx:Anchor/@xlink:href) = 0) then
1650
                $identifier
1651
            else ()
1652
        return
1653
        if (not($identifiers)) then
1654
            local:addMessage('TR.noIdentifier', map { 'filename': local:filename($record), 'id': $rid })
1655
                else if(count($emptyIdentifiers) != 0) then
1656
                        local:addMessage('TR.emptyIdentifier', map { 'filename': local:filename($record), 'id': $rid })
1657
                else if(count($distinctRecordIdentifiers) != count($identifiers)) then
1658
            local:addMessage('TR.duplicateIdentifier', map { 'filename': local:filename($record), 'id': $rid, 'identifier': fn:string-join($allIdent,'; ') })
1659
        else ()
1660
    )[position() le $limitErrors]
1661
return
1662
(if ($messages) then 'FAILED' else 'PASSED',
1663
local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1664
$messages)</textarea></div>
1665
                           </div>
1666
                        </div>
1667
                        <div data-role="collapsible" data-enhanced="true" id="EID7bffcd84-46da-4995-baeb-2d5c6b9af895" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1668
                           <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>
1669
                           <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>
1670
                                                                        <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>
1671
                                 <tbody>
1672
                                    <tr>
1673
                                       <td>Status</td>
1674
                                       <td>Passed</td>
1675
                                    </tr>
1676
                                    <tr>
1677
                                       <td>Duration</td>
1678
                                       <td>2.394 s</td>
1679
                                    </tr>
1680
                                    <tr class="ReportDetail">
1681
                                       <td>Assertion ID</td>
1682
                                       <td>EID84892cf0-e7db-4705-9b40-c27a856eacee</td>
1683
                                    </tr>
1684
                                    <tr class="DoNotShowInSimpleView">
1685
                                       <td>Assertion URI</td>
1686
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID7bffcd84-46da-4995-baeb-2d5c6b9af895" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID7bffcd84-46da-4995-baeb-2d5c6b9af895'); return false;">Link</a></td>
1687
                                    </tr>
1688
                                 </tbody>
1689
                              </table><br><div class="ReportDetail Expression"><label for="EID7bffcd84-46da-4995-baeb-2d5c6b9af895.expression">Expression:</label><textarea id="EID7bffcd84-46da-4995-baeb-2d5c6b9af895.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')
1690
let $THEMES_TITLE := 'GEMET - INSPIRE themes, version 1.0'
1691
let $messages :=
1692
        (try{
1693
                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')
1694
                let $inspireThemesCodeListURL := 'http://inspire.ec.europa.eu/theme'
1695
                let $codeTitles := local:get-code-titles($inspireThemesCodeListURL,$officialLanguages)
1696
                let $codeValues := local:get-code-list-values($inspireThemesCodeListURL)
1697
                let $codes := ($codeTitles,$codeValues)
1698
                for $record in $records
1699
                        let $rid := $record/gmd:fileIdentifier/*/text()
1700
                        let $relevantDescriptiveKeywordsBlocks := $record/gmd:identificationInfo[1]/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords[gmd:thesaurusName/gmd:CI_Citation/gmd:title/*/text() = $THEMES_TITLE]
1701
                        return
1702
                        if (count($relevantDescriptiveKeywordsBlocks) = 0) then
1703
                                local:addMessage('TR.wrongKeywordFromINSPIREThemesTitle', map { 'filename': local:filename($record), 'id': $rid })
1704
                        else
1705
                                if ($relevantDescriptiveKeywordsBlocks[not(some $keyword in ./gmd:keyword/*/text() satisfies $keyword = $codes) ]) then
1706
                                        local:addMessage('TR.noKeywordFromINSPIREThemes',  map { 'filename': local:filename($record), 'id': $rid, 'url': $inspireThemesCodeListURL, 'keywords': fn:string-join($relevantDescriptiveKeywordsBlocks/gmd:keyword/*/text(),'; ') })
1707
                                else ()
1708
        } catch * {                                                       
1709
                local:addMessage('TR.systemError',  map { 'text': $err:description })                                 
1710
        }
1711
        )[position() le $limitErrors]
1712
return
1713
(if ($messages) then 'FAILED' else 'PASSED',
1714
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1715
 $messages)</textarea></div>
1716
                           </div>
1717
                        </div>
1718
                        <div data-role="collapsible" data-enhanced="true" id="EIDe054672b-673b-424a-9e41-72dc5b20b95b" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1719
                           <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>
1720
                           <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>
1721
                                                                        <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>
1722
                                 <tbody>
1723
                                    <tr>
1724
                                       <td>Status</td>
1725
                                       <td>Passed</td>
1726
                                    </tr>
1727
                                    <tr>
1728
                                       <td>Duration</td>
1729
                                       <td>0.001 s</td>
1730
                                    </tr>
1731
                                    <tr class="ReportDetail">
1732
                                       <td>Assertion ID</td>
1733
                                       <td>EID82a0442f-0185-4d6a-9b4e-0b7356613de7</td>
1734
                                    </tr>
1735
                                    <tr class="DoNotShowInSimpleView">
1736
                                       <td>Assertion URI</td>
1737
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDe054672b-673b-424a-9e41-72dc5b20b95b" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDe054672b-673b-424a-9e41-72dc5b20b95b'); return false;">Link</a></td>
1738
                                    </tr>
1739
                                 </tbody>
1740
                              </table><br><div class="ReportDetail Expression"><label for="EIDe054672b-673b-424a-9e41-72dc5b20b95b.expression">Expression:</label><textarea id="EIDe054672b-673b-424a-9e41-72dc5b20b95b.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}$)'
1741
let $messages :=
1742
        (for $record in $records
1743
                let $countResolutions := count($record/gmd:identificationInfo[1]/*/gmd:spatialResolution)
1744
                let $countScale := count($record/gmd:identificationInfo[1]/*/gmd:spatialResolution/gmd:MD_Resolution/gmd:equivalentScale)
1745
                let $countDistance := count($record/gmd:identificationInfo[1]/*/gmd:spatialResolution/gmd:MD_Resolution/gmd:distance)
1746
                let $invalidScale :=
1747
                        for $x in $record/gmd:identificationInfo[1]/*/gmd:spatialResolution/gmd:MD_Resolution/gmd:equivalentScale/gmd:MD_RepresentativeFraction/gmd:denominator/gco:Integer
1748
                        return
1749
                        if(matches($x/text(), $regex_integer)) then ()
1750
                        else $x
1751
                let $invalidDistance :=
1752
                        for $x in $record/gmd:identificationInfo[1]/*/gmd:spatialResolution/gmd:MD_Resolution/gmd:distance/gco:Distance
1753
                        return
1754
                        if(xs:double($x/text())) then ()
1755
                        else $x
1756
                let $rid := $record/gmd:fileIdentifier/*/text()
1757
                return
1758
                if (($countResolutions &gt; 0) and ($countScale = 0) and ($countDistance = 0)) then
1759
                        local:addMessage('TR.noResolutions', map { 'filename': local:filename($record), 'id': $rid })
1760
                else if(count($invalidScale) != 0) then
1761
                        local:addMessage('TR.invalidScale', map { 'filename': local:filename($record), 'id': $rid, 'invalid': fn:string-join($invalidScale,'; ')})
1762
                else if(count($invalidDistance) != 0) then
1763
                        local:addMessage('TR.invalidDistance', map { 'filename': local:filename($record), 'id': $rid, 'invalid': fn:string-join($invalidDistance,'; ')})
1764
                else
1765
                        for $spatialResolution in $record/gmd:identificationInfo[1]/*/gmd:spatialResolution
1766
                        return
1767
                        if (count($spatialResolution/gmd:MD_Resolution/gmd:equivalentScale) &gt; 0 and count($spatialResolution/gmd:MD_Resolution/gmd:distance) &gt; 0) then
1768
                                local:addMessage('TR.mixedResolutions', map { 'filename': local:filename($record), 'id': $rid })
1769
                        else ()
1770
        )[position() le $limitErrors]
1771
return
1772
(if ($messages) then 'FAILED' else 'PASSED',
1773
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1774
 $messages)</textarea></div>
1775
                           </div>
1776
                        </div>
1777
                        <div data-role="collapsible" data-enhanced="true" id="EIDf9812cfc-ea6b-4ea1-84ae-c5d91fa632e8" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1778
                           <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>
1779
                           <div aria-hidden="true" class="ui-collapsible-content ui-collapsible-content-collapsed ui-body-h"><p>Test that a resource language is provided.</p>
1780
                                                                        <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>
1781
                                 <tbody>
1782
                                    <tr>
1783
                                       <td>Status</td>
1784
                                       <td>Passed</td>
1785
                                    </tr>
1786
                                    <tr>
1787
                                       <td>Duration</td>
1788
                                       <td>0.001 s</td>
1789
                                    </tr>
1790
                                    <tr class="ReportDetail">
1791
                                       <td>Assertion ID</td>
1792
                                       <td>EID095d416e-3dfe-4936-83d4-71028e3d0c4c</td>
1793
                                    </tr>
1794
                                    <tr class="DoNotShowInSimpleView">
1795
                                       <td>Assertion URI</td>
1796
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDf9812cfc-ea6b-4ea1-84ae-c5d91fa632e8" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDf9812cfc-ea6b-4ea1-84ae-c5d91fa632e8'); return false;">Link</a></td>
1797
                                    </tr>
1798
                                 </tbody>
1799
                              </table><br><div class="ReportDetail Expression"><label for="EIDf9812cfc-ea6b-4ea1-84ae-c5d91fa632e8.expression">Expression:</label><textarea id="EIDf9812cfc-ea6b-4ea1-84ae-c5d91fa632e8.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')
1800
let $messages :=            
1801
        (for $record in $records                     
1802
                let $rid := $record/gmd:fileIdentifier/*/text()
1803
                let $languageCodes := $record/gmd:identificationInfo[1]/*/gmd:language/gmd:LanguageCode                  
1804
                return
1805
                if (not($languageCodes)) then
1806
                        local:addMessage('TR.noLanguageCode',  map { 'filename': local:filename($record), 'id': $rid })
1807
                else                 
1808
                        let $wrongCodeValues := $languageCodes/@codeListValue[not(. = $codes)]
1809
                        let $wrongCodeList := $languageCodes/@codeList[not(. = 'http://www.loc.gov/standards/iso639-2/')]
1810
                        return
1811
                        if ($wrongCodeValues) then
1812
                                local:addMessage('TR.invalidLanguageCode',  map { 'filename': local:filename($record), 'id': $rid, 'invalidCodes' : string-join($wrongCodeValues,', ') })
1813
                        else if($wrongCodeList) then
1814
                                local:addMessage('TR.wrongCodeList_Param',  map { 'filename': local:filename($record), 'id': $rid, 'param': 'http://www.loc.gov/standards/iso639-2/'})
1815
                        else ()             
1816
        )[position() le $limitErrors]
1817
return
1818
(if ($messages) then 'FAILED' else 'PASSED',
1819
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1820
 $messages)</textarea></div>
1821
                           </div>
1822
                        </div>
1823
                        <div data-role="collapsible" data-enhanced="true" id="EID9a66848c-4975-476b-b2ee-c574aca97e0f" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1824
                           <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>
1825
                           <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>
1826
                                                                        <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>
1827
                                 <tbody>
1828
                                    <tr>
1829
                                       <td>Status</td>
1830
                                       <td>Passed</td>
1831
                                    </tr>
1832
                                    <tr>
1833
                                       <td>Duration</td>
1834
                                       <td>0.001 s</td>
1835
                                    </tr>
1836
                                    <tr class="ReportDetail">
1837
                                       <td>Assertion ID</td>
1838
                                       <td>EIDae4bda0e-1dec-4e66-97b8-d4c43b66d2b8</td>
1839
                                    </tr>
1840
                                    <tr class="DoNotShowInSimpleView">
1841
                                       <td>Assertion URI</td>
1842
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID9a66848c-4975-476b-b2ee-c574aca97e0f" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID9a66848c-4975-476b-b2ee-c574aca97e0f'); return false;">Link</a></td>
1843
                                    </tr>
1844
                                 </tbody>
1845
                              </table><br><div class="ReportDetail Expression"><label for="EID9a66848c-4975-476b-b2ee-c574aca97e0f.expression">Expression:</label><textarea id="EID9a66848c-4975-476b-b2ee-c574aca97e0f.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')
1846
let $messages :=    
1847
    (for $record in $records
1848
        let $rid := $record/gmd:fileIdentifier/*/text()
1849
                let $topicCategories := $record/gmd:identificationInfo[1]/gmd:MD_DataIdentification/gmd:topicCategory
1850
        return
1851
                if (count($topicCategories) = 0) then
1852
            local:addMessage('TR.noTopicCategory',  map { 'filename': local:filename($record), 'id': $rid})
1853
        else
1854
                        for $topicCategory in $topicCategories
1855
                        return
1856
                        if(not($topicCategory/gmd:MD_TopicCategoryCode)) then
1857
                    local:addMessage('TR.noTopicCategory',  map { 'filename': local:filename($record), 'id': $rid})
1858
                        else if (not($topicCategory/gmd:MD_TopicCategoryCode = $codes)) then
1859
                local:addMessage('TR.invalidTopicCode',  map { 'filename': local:filename($record), 'id': $rid, 'invalidCodes' : $topicCategory/gmd:MD_TopicCategoryCode/text() })
1860
                        else()
1861
    )[position() le $limitErrors] 
1862
return
1863
(if ($messages) then 'FAILED' else 'PASSED',
1864
local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1865
$messages)</textarea></div>
1866
                           </div>
1867
                        </div>
1868
                     </div>
1869
                  </div>
1870
               </div>
1871
               <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">
1872
                  <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
1873
                        <div class="ui-li-count">4</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
1874
                  <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>
1875
                        <tbody>
1876
                           <tr>
1877
                              <td>Status</td>
1878
                              <td>Passed</td>
1879
                           </tr>
1880
                           <tr>
1881
                              <td>Duration</td>
1882
                              <td>1.796 s</td>
1883
                           </tr>
1884
                           <tr class="ReportDetail">
1885
                              <td>Test case ID</td>
1886
                              <td>EID646900b2-9564-44b9-8576-cfcab22e3419</td>
1887
                           </tr>
1888
                        </tbody>
1889
                     </table><br><div class="TestStepPlaceHolder">
1890
                        <div data-role="collapsible" data-enhanced="true" id="EID9a62cc7b-bc36-4192-8390-0e2daca1f11f" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1891
                           <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>
1892
                           <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>
1893
                                                                        <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>
1894
                                 <tbody>
1895
                                    <tr>
1896
                                       <td>Status</td>
1897
                                       <td>Passed</td>
1898
                                    </tr>
1899
                                    <tr>
1900
                                       <td>Duration</td>
1901
                                       <td>0.001 s</td>
1902
                                    </tr>
1903
                                    <tr class="ReportDetail">
1904
                                       <td>Assertion ID</td>
1905
                                       <td>EID4f536f56-3118-474e-81b4-c0e36344a70b</td>
1906
                                    </tr>
1907
                                    <tr class="DoNotShowInSimpleView">
1908
                                       <td>Assertion URI</td>
1909
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID9a62cc7b-bc36-4192-8390-0e2daca1f11f" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID9a62cc7b-bc36-4192-8390-0e2daca1f11f'); return false;">Link</a></td>
1910
                                    </tr>
1911
                                 </tbody>
1912
                              </table><br><div class="ReportDetail Expression"><label for="EID9a62cc7b-bc36-4192-8390-0e2daca1f11f.expression">Expression:</label><textarea id="EID9a62cc7b-bc36-4192-8390-0e2daca1f11f.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})(/?)'
1913
let $messages :=         
1914
        (for $record in $records
1915
                let $rid := $record/gmd:fileIdentifier/*/text()
1916
                return
1917
                for $onLine in $record/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource
1918
                        let $url := $onLine/gmd:linkage/gmd:URL
1919
                        return
1920
            if (not(string-length($url/text()) != 0)) then
1921
                                local:addMessage('TR.linkageWithoutURL', map { 'filename': local:filename($record), 'id': $rid })
1922
                        else if (not(matches($url/text(), $regex_url))) then
1923
                                        local:addMessage('TR.invalidURL', map { 'filename': local:filename($record), 'id': $rid, 'url': $url/text()})
1924
                        else ()
1925
        )[position() le $limitErrors]
1926
return
1927
(if ($messages) then 'FAILED' else 'PASSED',
1928
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1929
 $messages)</textarea></div>
1930
                           </div>
1931
                        </div>
1932
                        <div data-role="collapsible" data-enhanced="true" id="EID5a8f2e69-f4f1-454e-bedb-37ab25a86a31" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1933
                           <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>
1934
                           <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>
1935
                                                                        <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>
1936
                                 <tbody>
1937
                                    <tr>
1938
                                       <td>Status</td>
1939
                                       <td>Passed</td>
1940
                                    </tr>
1941
                                    <tr>
1942
                                       <td>Duration</td>
1943
                                       <td>0.001 s</td>
1944
                                    </tr>
1945
                                    <tr class="ReportDetail">
1946
                                       <td>Assertion ID</td>
1947
                                       <td>EIDc7ef6d4f-a03b-4797-85e2-3b4a49e0c5ff</td>
1948
                                    </tr>
1949
                                    <tr class="DoNotShowInSimpleView">
1950
                                       <td>Assertion URI</td>
1951
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID5a8f2e69-f4f1-454e-bedb-37ab25a86a31" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID5a8f2e69-f4f1-454e-bedb-37ab25a86a31'); return false;">Link</a></td>
1952
                                    </tr>
1953
                                 </tbody>
1954
                              </table><br><div class="ReportDetail Expression"><label for="EID5a8f2e69-f4f1-454e-bedb-37ab25a86a31.expression">Expression:</label><textarea id="EID5a8f2e69-f4f1-454e-bedb-37ab25a86a31.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 :=
1955
        (for $record in $records
1956
                let $rid := $record/gmd:fileIdentifier/*/text()
1957
                let $dataQuality := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality
1958
                let $levels := ('dataset', 'series')
1959
                let $MD_ScopeCode := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:scope/gmd:DQ_Scope/gmd:level/gmd:MD_ScopeCode
1960
                return          
1961
                if (count($dataQuality) != 1) then
1962
                        local:addMessage('TR.wrongNumberOfDataQuality', map { 'filename': local:filename($record), 'id': $rid })
1963
                else if (not($MD_ScopeCode/@codeListValue = $levels)) then
1964
                        local:addMessage('TR.invalidCodeList', map { 'filename': local:filename($record), 'id': $rid })
1965
                else ()
1966
        )[position() le $limitErrors]
1967
return
1968
(if ($messages) then 'FAILED' else 'PASSED',
1969
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
1970
 $messages)</textarea></div>
1971
                           </div>
1972
                        </div>
1973
                        <div data-role="collapsible" data-enhanced="true" id="EID6d21927c-c126-49df-8ca7-7eeaa4dd45d4" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
1974
                           <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>
1975
                           <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>
1976
                                                                        <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>
1977
                                                                        <p>To fulfill this requirement, the evaluated metadata dataset shall be encoded according to the following common requirements of the Technical Guide:</p>
1978
                                                                        <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>
1979
                                                                        <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>
1980
                                                                        <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>
1981
                                 <tbody>
1982
                                    <tr>
1983
                                       <td>Status</td>
1984
                                       <td>Passed</td>
1985
                                    </tr>
1986
                                    <tr>
1987
                                       <td>Duration</td>
1988
                                       <td>1.796 s</td>
1989
                                    </tr>
1990
                                    <tr class="ReportDetail">
1991
                                       <td>Assertion ID</td>
1992
                                       <td>EID8f663265-32b8-4c99-8997-2d40f6ce5b93</td>
1993
                                    </tr>
1994
                                    <tr class="DoNotShowInSimpleView">
1995
                                       <td>Assertion URI</td>
1996
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID6d21927c-c126-49df-8ca7-7eeaa4dd45d4" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID6d21927c-c126-49df-8ca7-7eeaa4dd45d4'); return false;">Link</a></td>
1997
                                    </tr>
1998
                                 </tbody>
1999
                              </table><br><div class="ReportDetail Expression"><label for="EID6d21927c-c126-49df-8ca7-7eeaa4dd45d4.expression">Expression:</label><textarea id="EID6d21927c-c126-49df-8ca7-7eeaa4dd45d4.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')
2000
let $conformityText := for $x in $enum_files
2001
        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
2002
let $conformityTextLower := for $x in $conformityText return normalize-space(lower-case($x))
2003
let $messages :=
2004
        (for $record in $records
2005
                let $rid := $record/gmd:fileIdentifier/*/text()
2006
                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')]
2007
        let $valid := 
2008
            (for $confResult in $confResults
2009
                return
2010
                if (normalize-space(lower-case($confResult)) = $conformityTextLower) then
2011
                    $confResult
2012
                else()
2013
            )
2014
                return
2015
                if (count($valid) = 0) then
2016
                        local:addMessage('TR.wrongNumberOfSpecificationForPurpose', map { 'filename': local:filename($record), 'id': $rid })
2017
                else()
2018
        )[position() le $limitErrors]
2019
return
2020
(if ($messages) then 'FAILED' else 'PASSED',
2021
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2022
 $messages)</textarea></div>
2023
                           </div>
2024
                        </div>
2025
                        <div data-role="collapsible" data-enhanced="true" id="EIDb7b16c4d-c80a-4994-acb2-b0e8d08ff5d3" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2026
                           <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>
2027
                           <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>
2028
                                                                        <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>
2029
                                 <tbody>
2030
                                    <tr>
2031
                                       <td>Status</td>
2032
                                       <td>Passed</td>
2033
                                    </tr>
2034
                                    <tr>
2035
                                       <td>Duration</td>
2036
                                       <td>0.001 s</td>
2037
                                    </tr>
2038
                                    <tr class="ReportDetail">
2039
                                       <td>Assertion ID</td>
2040
                                       <td>EID366b8ce9-9a73-47b8-96da-3d24166a0f3f</td>
2041
                                    </tr>
2042
                                    <tr class="DoNotShowInSimpleView">
2043
                                       <td>Assertion URI</td>
2044
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDb7b16c4d-c80a-4994-acb2-b0e8d08ff5d3" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDb7b16c4d-c80a-4994-acb2-b0e8d08ff5d3'); return false;">Link</a></td>
2045
                                    </tr>
2046
                                 </tbody>
2047
                              </table><br><div class="ReportDetail Expression"><label for="EIDb7b16c4d-c80a-4994-acb2-b0e8d08ff5d3.expression">Expression:</label><textarea id="EIDb7b16c4d-c80a-4994-acb2-b0e8d08ff5d3.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 :=    
2048
    (for $record in $records
2049
        let $rid := $record/gmd:fileIdentifier/*/text()
2050
                let $lineageStatement := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:lineage/gmd:LI_Lineage/gmd:statement
2051
        return   
2052
        if (count($lineageStatement) != 1) then
2053
            local:addMessage('TR.wrongNumberOfLineageStatements',  map { 'filename': local:filename($record), 'id': $rid, 'count': string(count($lineageStatement)) })
2054
        else if (not($lineageStatement) or not(string-length($lineageStatement/gco:CharacterString/text()) != 0 or string-length($lineageStatement/gmx:Anchor/text()) != 0)) then
2055
            local:addMessage('TR.emptyLineageStatement',  map { 'filename': local:filename($record), 'id': $rid })
2056
        else ()         
2057
    )[position() le $limitErrors] 
2058
return
2059
(if ($messages) then 'FAILED' else 'PASSED',
2060
local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2061
$messages)</textarea></div>
2062
                           </div>
2063
                        </div>
2064
                     </div>
2065
                  </div>
2066
               </div>
2067
            </div>
2068
         </div>
2069
         <div class="TestSuite" data-role="collapsible" data-theme="h" data-content-theme="h">
2070
            <h2>Conformance Class 2: INSPIRE data sets and data set series interoperability metadata.
2071
               <div class="ui-li-count">4</div>
2072
            </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/>        
2073
Known limitations are documented in the description of the applicable test case or test assertion.<br/><br/>
2074
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.
2075
<br/><br/>
2076
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/>
2077
Pre-requisite conformance classes: Conformance Class 1<br><br><table>
2078
               <tbody>
2079
                  <tr>
2080
                     <td>Status</td>
2081
                     <td>Passed</td>
2082
                  </tr>
2083
                  <tr>
2084
                     <td>Duration</td>
2085
                     <td>0.001 s</td>
2086
                  </tr>
2087
                  <tr class="ReportDetail">
2088
                     <td>Test suite ID</td>
2089
                     <td>EID2be1480a-fe42-40b2-9420-eb0e69385c80</td>
2090
                  </tr>
2091
                  <tr class="ReportDetail">
2092
                     <td>Author</td>
2093
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
2094
                  </tr>
2095
                  <tr class="ReportDetail">
2096
                     <td>Date created</td>
2097
                     <td>30/06/2018 00:00:00 GMT</td>
2098
                  </tr>
2099
                  <tr>
2100
                     <td>Version</td>
2101
                     <td>0.1.0</td>
2102
                  </tr>
2103
                  <tr class="ReportDetail">
2104
                     <td>Last editor</td>
2105
                     <td>Consortium Bilbomatica, Guadaltel y Geograma</td>
2106
                  </tr>
2107
                  <tr class="ReportDetail">
2108
                     <td>Last updated</td>
2109
                     <td>30/08/2018 20:45:00 GMT</td>
2110
                  </tr>
2111
                  <tr class="ReportDetail">
2112
                     <td>Reference</td>
2113
                     <td><a class="ui-link" href="https://github.com/inspire-eu-validation/ets-repository/tree/master/metadata/2.0">Link</a></td>
2114
                  </tr>
2115
                  <tr class="ReportDetail">
2116
                     <td>Hash</td>
2117
                     <td>CBF29CE484222325</td>
2118
                  </tr>
2119
               </tbody>
2120
            </table><br><div class="TestModulePlaceHolder">
2121
               <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">
2122
                  <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
2123
                        <div class="ui-li-count">3</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
2124
                  <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 
2125
                                        that are directly child elements of the root node of the XML document: MD_Metadata node.<br><br><table>
2126
                        <tbody>
2127
                           <tr>
2128
                              <td>Status</td>
2129
                              <td>Passed</td>
2130
                           </tr>
2131
                           <tr>
2132
                              <td>Duration</td>
2133
                              <td>0.001 s</td>
2134
                           </tr>
2135
                           <tr class="ReportDetail">
2136
                              <td>Test case ID</td>
2137
                              <td>EID57034804-54da-448a-ac31-6ee56b93a82b</td>
2138
                           </tr>
2139
                        </tbody>
2140
                     </table><br><div class="TestStepPlaceHolder">
2141
                        <div data-role="collapsible" data-enhanced="true" id="EIDee7592c3-2d6c-4b7a-861c-ba44d866dd69" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2142
                           <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>
2143
                           <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>
2144
<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>
2145
                                 <tbody>
2146
                                    <tr>
2147
                                       <td>Status</td>
2148
                                       <td>Passed</td>
2149
                                    </tr>
2150
                                    <tr>
2151
                                       <td>Duration</td>
2152
                                       <td>0.001 s</td>
2153
                                    </tr>
2154
                                    <tr class="ReportDetail">
2155
                                       <td>Assertion ID</td>
2156
                                       <td>EID02c29a8c-874b-4fa6-b08d-75a0759d85a3</td>
2157
                                    </tr>
2158
                                    <tr class="DoNotShowInSimpleView">
2159
                                       <td>Assertion URI</td>
2160
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDee7592c3-2d6c-4b7a-861c-ba44d866dd69" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDee7592c3-2d6c-4b7a-861c-ba44d866dd69'); return false;">Link</a></td>
2161
                                    </tr>
2162
                                 </tbody>
2163
                              </table><br><div class="ReportDetail Expression"><label for="EIDee7592c3-2d6c-4b7a-861c-ba44d866dd69.expression">Expression:</label><textarea id="EIDee7592c3-2d6c-4b7a-861c-ba44d866dd69.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 :=  
2164
        (for $record in $records
2165
                let $rid := $record/gmd:fileIdentifier/*/text()
2166
                let $crsIdentifiers := $record/gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier
2167
                return                          
2168
                if (count($crsIdentifiers) = 0)  then
2169
                        local:addMessage('TR.noCrsIdentifier', map { 'filename': local:filename($record), 'id': $rid })
2170
                else                         
2171
                        for $crs in $crsIdentifiers
2172
                                let $code := $crs/gmd:code
2173
                                let $codeSpace := $crs/gmd:codeSpace
2174
                                 return
2175
                if (not($code) or not(string-length($code/gco:CharacterString/text()) != 0 or string-length($code/gmx:Anchor/text()) != 0)) then
2176
                                        local:addMessage('TR.noCrsCode',  map { 'filename': local:filename($record), 'id': $rid})
2177
                else if ($codeSpace and not(string-length($codeSpace/gco:CharacterString/text()) != 0 or string-length($codeSpace/gmx:Anchor/text()) != 0)) then
2178
                                        local:addMessage('TR.noCrsCodeSpace',  map { 'filename': local:filename($record), 'id': $rid})
2179
                                else ()         
2180
        )[position() le $limitErrors] 
2181
return
2182
(if ($messages) then 'FAILED' else 'PASSED',
2183
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2184
 $messages)</textarea></div>
2185
                           </div>
2186
                        </div>
2187
                        <div data-role="collapsible" data-enhanced="true" id="EID34f31ad9-6bec-40b3-a514-da033226631e" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2188
                           <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>
2189
                           <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>
2190
<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>
2191
                                 <tbody>
2192
                                    <tr>
2193
                                       <td>Status</td>
2194
                                       <td>Passed</td>
2195
                                    </tr>
2196
                                    <tr>
2197
                                       <td>Duration</td>
2198
                                       <td>0.001 s</td>
2199
                                    </tr>
2200
                                    <tr class="ReportDetail">
2201
                                       <td>Assertion ID</td>
2202
                                       <td>EID9cc67cd3-19cf-4475-b2aa-dcbedab9f685</td>
2203
                                    </tr>
2204
                                    <tr class="DoNotShowInSimpleView">
2205
                                       <td>Assertion URI</td>
2206
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID34f31ad9-6bec-40b3-a514-da033226631e" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID34f31ad9-6bec-40b3-a514-da033226631e'); return false;">Link</a></td>
2207
                                    </tr>
2208
                                 </tbody>
2209
                              </table><br><div class="ReportDetail Expression"><label for="EID34f31ad9-6bec-40b3-a514-da033226631e.expression">Expression:</label><textarea id="EID34f31ad9-6bec-40b3-a514-da033226631e.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/'
2210
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')
2211
let $httpURIIdentifier :=
2212
        for $x in $epsgCodes
2213
        return
2214
        concat($urlOpengis, $x)
2215
let $messages :=          
2216
        (for $record in $records
2217
                let $rid := $record/gmd:fileIdentifier/*/text()
2218
                let $crsIdentifiers := $record/gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier
2219
                return
2220
                        for $crs in $crsIdentifiers
2221
                                let $code := $crs/gmd:code
2222
                                let $codeSpace := $crs/gmd:codeSpace
2223
                                let $defaultEpsgCode :=
2224
                                        for $x in $epsgCodes
2225
                                                return
2226
                                                if(contains($code/gco:CharacterString/text(), $x)) then $code/gco:CharacterString
2227
                                                else if(contains($code/gmx:Anchor/text(), $x)) then $code/gmx:Anchor/@xlink:href
2228
                                                else ()
2229
                                 return
2230
                                if (not(count($defaultEpsgCode) = 0)) then
2231
                                        if (not($code[gco:CharacterString = $httpURIIdentifier] or $code[gmx:Anchor/@xlink:href = $httpURIIdentifier])) then
2232
                                                local:addMessage('TR.invalidCrsCode',  map { 'filename': local:filename($record), 'id': $rid })
2233
                                        else if($codeSpace) then
2234
                                                local:addMessage('TR.invalidCrsCode',  map { 'filename': local:filename($record), 'id': $rid })
2235
                                        else ()
2236
                                else ()
2237
        )[position() le $limitErrors] 
2238
return
2239
(if ($messages) then 'FAILED' else 'PASSED',
2240
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2241
 $messages)</textarea></div>
2242
                           </div>
2243
                        </div>
2244
                        <div data-role="collapsible" data-enhanced="true" id="EIDc4e24308-0aff-45ac-b3f5-0811dbd83e4d" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2245
                           <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>
2246
                           <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>
2247
<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>
2248
                                 <tbody>
2249
                                    <tr>
2250
                                       <td>Status</td>
2251
                                       <td>Passed</td>
2252
                                    </tr>
2253
                                    <tr>
2254
                                       <td>Duration</td>
2255
                                       <td>0.001 s</td>
2256
                                    </tr>
2257
                                    <tr class="ReportDetail">
2258
                                       <td>Assertion ID</td>
2259
                                       <td>EIDef8d3d22-be0f-4618-88a2-2bc0bbfc8077</td>
2260
                                    </tr>
2261
                                    <tr class="DoNotShowInSimpleView">
2262
                                       <td>Assertion URI</td>
2263
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDc4e24308-0aff-45ac-b3f5-0811dbd83e4d" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDc4e24308-0aff-45ac-b3f5-0811dbd83e4d'); return false;">Link</a></td>
2264
                                    </tr>
2265
                                 </tbody>
2266
                              </table><br><div class="ReportDetail Expression"><label for="EIDc4e24308-0aff-45ac-b3f5-0811dbd83e4d.expression">Expression:</label><textarea id="EIDc4e24308-0aff-45ac-b3f5-0811dbd83e4d.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 :=          
2267
        (for $record in $records
2268
                let $rid := $record/gmd:fileIdentifier/*/text()
2269
                let $crsIdentifiers := $record/gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier
2270
                return
2271
                if (not($crsIdentifiers)) then
2272
                                local:addMessage('TR.noCrsCode',  map { 'filename': local:filename($record), 'id': $rid })
2273
                else
2274
                        for $crs in $crsIdentifiers
2275
                        let $code := $crs/gmd:code
2276
                        let $codeSpace := $crs/gmd:codeSpace
2277
                        return
2278
            if (not($code) or not(string-length($code/gco:CharacterString/text()) != 0 or string-length($code/gmx:Anchor/text()) != 0)) then
2279
                                local:addMessage('TR.noCrsCode',  map { 'filename': local:filename($record), 'id': $rid })
2280
            else if (($codeSpace) and not(string-length($codeSpace/gco:CharacterString/text()) != 0 or string-length($codeSpace/gmx:Anchor/text()) != 0)) then
2281
                                local:addMessage('TR.noCrsCodeSpace',  map { 'filename': local:filename($record), 'id': $rid })
2282
                        else ()                
2283
        )[position() le $limitErrors] 
2284
return
2285
(if ($messages) then 'FAILED' else 'PASSED',
2286
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2287
 $messages)</textarea></div>
2288
                           </div>
2289
                        </div>
2290
                     </div>
2291
                  </div>
2292
               </div>
2293
               <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">
2294
                  <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
2295
                        <div class="ui-li-count">2</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
2296
                  <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 
2297
                                        elements that are child elements of the section of the XML document: Identification Info 
2298
                                        (property of the gmd:MD_Metadata element). This section contains information specific to the dataset / dataset series.<br><br><table>
2299
                        <tbody>
2300
                           <tr>
2301
                              <td>Status</td>
2302
                              <td>Passed</td>
2303
                           </tr>
2304
                           <tr>
2305
                              <td>Duration</td>
2306
                              <td>0.001 s</td>
2307
                           </tr>
2308
                           <tr class="ReportDetail">
2309
                              <td>Test case ID</td>
2310
                              <td>EID8d0318a3-c5e9-45d5-b3af-8c054b0068f5</td>
2311
                           </tr>
2312
                        </tbody>
2313
                     </table><br><div class="TestStepPlaceHolder">
2314
                        <div data-role="collapsible" data-enhanced="true" id="EID5df697bb-8f15-4d4b-8f4d-71b0ffd9b7cc" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2315
                           <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>
2316
                           <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>
2317
<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>
2318
                                 <tbody>
2319
                                    <tr>
2320
                                       <td>Status</td>
2321
                                       <td>Passed</td>
2322
                                    </tr>
2323
                                    <tr>
2324
                                       <td>Duration</td>
2325
                                       <td>0.001 s</td>
2326
                                    </tr>
2327
                                    <tr class="ReportDetail">
2328
                                       <td>Assertion ID</td>
2329
                                       <td>EIDf330358c-8d29-4069-976a-3afb9590ea51</td>
2330
                                    </tr>
2331
                                    <tr class="DoNotShowInSimpleView">
2332
                                       <td>Assertion URI</td>
2333
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID5df697bb-8f15-4d4b-8f4d-71b0ffd9b7cc" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID5df697bb-8f15-4d4b-8f4d-71b0ffd9b7cc'); return false;">Link</a></td>
2334
                                    </tr>
2335
                                 </tbody>
2336
                              </table><br><div class="ReportDetail Expression"><label for="EID5df697bb-8f15-4d4b-8f4d-71b0ffd9b7cc.expression">Expression:</label><textarea id="EID5df697bb-8f15-4d4b-8f4d-71b0ffd9b7cc.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')
2337
let $messages :=          
2338
        (for $record in $records
2339
                let $rid := $record/gmd:fileIdentifier/*/text()
2340
                let $spatialRepTypeCodes := $record/gmd:identificationInfo[1]/gmd:MD_DataIdentification/gmd:spatialRepresentationType/gmd:MD_SpatialRepresentationTypeCode
2341
                return                                          
2342
                if (count($spatialRepTypeCodes) = 0)  then
2343
                        local:addMessage('TR.spatialRepTypeCodes', map { 'filename': local:filename($record), 'id': $rid })
2344
                else 
2345
                        for $typeCode in $spatialRepTypeCodes
2346
                                let $codeListValue := $typeCode/@codeListValue
2347
                                let $invalidCodeValues := $codeListValue[not(. = $codes)]
2348
                                return
2349
                                if ($invalidCodeValues)  then
2350
                                        local:addMessage('TR.invalidSpatialRepresentationCode', map { 'filename': local:filename($record), 'id': $rid })                                
2351
                                else ()                 
2352
        )[position() le $limitErrors] 
2353
return
2354
(if ($messages) then 'FAILED' else 'PASSED',
2355
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2356
 $messages)</textarea></div>
2357
                           </div>
2358
                        </div>
2359
                        <div data-role="collapsible" data-enhanced="true" id="EID3abd801b-d9e6-42f9-b868-cb57d74685c1" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2360
                           <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>
2361
                           <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>
2362
<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>
2363
                                 <tbody>
2364
                                    <tr>
2365
                                       <td>Status</td>
2366
                                       <td>Passed</td>
2367
                                    </tr>
2368
                                    <tr>
2369
                                       <td>Duration</td>
2370
                                       <td>0.001 s</td>
2371
                                    </tr>
2372
                                    <tr class="ReportDetail">
2373
                                       <td>Assertion ID</td>
2374
                                       <td>EID83d11da2-265d-4080-bdc3-c25a325b824d</td>
2375
                                    </tr>
2376
                                    <tr class="DoNotShowInSimpleView">
2377
                                       <td>Assertion URI</td>
2378
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID3abd801b-d9e6-42f9-b868-cb57d74685c1" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID3abd801b-d9e6-42f9-b868-cb57d74685c1'); return false;">Link</a></td>
2379
                                    </tr>
2380
                                 </tbody>
2381
                              </table><br><div class="ReportDetail Expression"><label for="EID3abd801b-d9e6-42f9-b868-cb57d74685c1.expression">Expression:</label><textarea id="EID3abd801b-d9e6-42f9-b868-cb57d74685c1.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')
2382
let $messages :=                  
2383
        (for $record in $records
2384
                let $rid := $record/gmd:fileIdentifier/*/text()
2385
                let $characterCodes := $record/gmd:identificationInfo[1]/gmd:MD_DataIdentification/gmd:characterSet/gmd:MD_CharacterSetCode
2386
                return                                                                                  
2387
                        for $characterCode in $characterCodes
2388
                                let $codeListValue := $characterCode/@codeListValue
2389
                                let $invalidCodeValues := $codeListValue[not(. = $codes)]
2390
                                return
2391
                                if ($invalidCodeValues) then
2392
                                        local:addMessage('TR.invalidEncodingCode', map { 'filename': local:filename($record), 'id': $rid})
2393
                                else ()                         
2394
        )[position() le $limitErrors] 
2395
return
2396
(if ($messages) then 'FAILED' else 'PASSED',
2397
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2398
 $messages)</textarea></div>
2399
                           </div>
2400
                        </div>
2401
                     </div>
2402
                  </div>
2403
               </div>
2404
               <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">
2405
                  <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
2406
                        <div class="ui-li-count">1</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
2407
                  <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 
2408
                                        elements of the section of the XML document: Distribution Information (property of the gmd:MD_Metadata element). 
2409
                                        This section contains information about who makes a resource available and how to get it.<br><br><table>
2410
                        <tbody>
2411
                           <tr>
2412
                              <td>Status</td>
2413
                              <td>Passed</td>
2414
                           </tr>
2415
                           <tr>
2416
                              <td>Duration</td>
2417
                              <td>0.001 s</td>
2418
                           </tr>
2419
                           <tr class="ReportDetail">
2420
                              <td>Test case ID</td>
2421
                              <td>EIDde81899f-3d21-4795-926e-93a731d68edf</td>
2422
                           </tr>
2423
                        </tbody>
2424
                     </table><br><div class="TestStepPlaceHolder">
2425
                        <div data-role="collapsible" data-enhanced="true" id="EID2a5fbc94-29e9-432d-9374-9d48284371ae" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2426
                           <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>
2427
                           <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>
2428
<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>
2429
                                 <tbody>
2430
                                    <tr>
2431
                                       <td>Status</td>
2432
                                       <td>Passed</td>
2433
                                    </tr>
2434
                                    <tr>
2435
                                       <td>Duration</td>
2436
                                       <td>0.001 s</td>
2437
                                    </tr>
2438
                                    <tr class="ReportDetail">
2439
                                       <td>Assertion ID</td>
2440
                                       <td>EID67230a54-f9b0-49d9-8928-fc5cf5d3ea8a</td>
2441
                                    </tr>
2442
                                    <tr class="DoNotShowInSimpleView">
2443
                                       <td>Assertion URI</td>
2444
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID2a5fbc94-29e9-432d-9374-9d48284371ae" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID2a5fbc94-29e9-432d-9374-9d48284371ae'); return false;">Link</a></td>
2445
                                    </tr>
2446
                                 </tbody>
2447
                              </table><br><div class="ReportDetail Expression"><label for="EID2a5fbc94-29e9-432d-9374-9d48284371ae.expression">Expression:</label><textarea id="EID2a5fbc94-29e9-432d-9374-9d48284371ae.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 :=
2448
        (for $record in $records
2449
                let $rid := $record/gmd:fileIdentifier/*/text()
2450
                let $distFormats := $record/gmd:distributionInfo[1]/gmd:MD_Distribution/gmd:distributionFormat
2451
                return
2452
                if (count($distFormats) = 0) then
2453
                        local:addMessage('TR.noDistFormat', map { 'filename': local:filename($record), 'id': $rid })
2454
                else
2455
                        for $format in $distFormats
2456
                                let $name := $format/gmd:MD_Format/gmd:name
2457
                                let $version := $format/gmd:MD_Format/gmd:version
2458
                                return
2459
                if (not($name) or not(string-length($name/gco:CharacterString/text()) != 0 or string-length($name/gmx:Anchor/text()) != 0)) then
2460
                                        local:addMessage('TR.emptyName', map { 'filename': local:filename($record), 'id': $rid })
2461
                                else if(string-length(normalize-space($version/*/text())) != 0) then
2462
                    if (not($version) or not(string-length($version/gco:CharacterString/text()) != 0 or string-length($version/gmx:Anchor/text()) != 0)) then
2463
                                                local:addMessage('TR.emptyVersion', map { 'filename': local:filename($record), 'id': $rid })         
2464
                                        else ()
2465
                                else
2466
                                        if (not($version/@gco:nilReason = 'unknown' or $version/@gco:nilReason = 'inapplicable')) then
2467
                                                local:addMessage('TR.invalidVersion', map { 'filename': local:filename($record), 'id': $rid }) 
2468
                                        else () 
2469
        )[position() le $limitErrors] 
2470
return
2471
(if ($messages) then 'FAILED' else 'PASSED',
2472
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2473
 $messages)</textarea></div>
2474
                           </div>
2475
                        </div>
2476
                     </div>
2477
                  </div>
2478
               </div>
2479
               <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">
2480
                  <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
2481
                        <div class="ui-li-count">2</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
2482
                  <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 
2483
                                        elements of the section of the XML document: Data Quality Information (property of the gmd:MD_Metadata element). 
2484
                                        This section contains information specific to the quality and lineage (including processing steps and sources) of the 
2485
                                        resource.<br><br><table>
2486
                        <tbody>
2487
                           <tr>
2488
                              <td>Status</td>
2489
                              <td>Passed</td>
2490
                           </tr>
2491
                           <tr>
2492
                              <td>Duration</td>
2493
                              <td>0.001 s</td>
2494
                           </tr>
2495
                           <tr class="ReportDetail">
2496
                              <td>Test case ID</td>
2497
                              <td>EIDb7cf88c8-4ebe-4fdb-93e6-58794455c3fa</td>
2498
                           </tr>
2499
                        </tbody>
2500
                     </table><br><div class="TestStepPlaceHolder">
2501
                        <div data-role="collapsible" data-enhanced="true" id="EIDbef5bee0-74dd-4724-b159-580f44444add" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2502
                           <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>
2503
                           <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>
2504
<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>
2505
                                 <tbody>
2506
                                    <tr>
2507
                                       <td>Status</td>
2508
                                       <td>Passed</td>
2509
                                    </tr>
2510
                                    <tr>
2511
                                       <td>Duration</td>
2512
                                       <td>0.001 s</td>
2513
                                    </tr>
2514
                                    <tr class="ReportDetail">
2515
                                       <td>Assertion ID</td>
2516
                                       <td>EID0c1ad661-f3bf-49a5-b38a-3dd68e2c7bfd</td>
2517
                                    </tr>
2518
                                    <tr class="DoNotShowInSimpleView">
2519
                                       <td>Assertion URI</td>
2520
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EIDbef5bee0-74dd-4724-b159-580f44444add" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EIDbef5bee0-74dd-4724-b159-580f44444add'); return false;">Link</a></td>
2521
                                    </tr>
2522
                                 </tbody>
2523
                              </table><br><div class="ReportDetail Expression"><label for="EIDbef5bee0-74dd-4724-b159-580f44444add.expression">Expression:</label><textarea id="EIDbef5bee0-74dd-4724-b159-580f44444add.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 :=                          
2524
        (for $record in $records
2525
                let $rid := $record/gmd:fileIdentifier/*/text()
2526
                let $results := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_TopologicalConsistency/gmd:result/gmd:DQ_QuantitativeResult
2527
                return
2528
                for $result in $results
2529
                        let $measureName := $result/../../gmd:nameOfMeasure/*[1]/text()
2530
                        let $valueRecord := $result/gmd:value/gco:Record
2531
                        let $type := $result/gmd:value/gco:Record/@xsi:type
2532
                        return
2533
                        if (not($result/gmd:valueUnit)) then
2534
                                local:addMessage('TR.noValueUnit', map { 'filename': local:filename($record), 'id': $rid, 'measureName': $measureName })
2535
                        else if (not($valueRecord)) then
2536
                                local:addMessage('TR.noValueRecord', map { 'filename': local:filename($record), 'id': $rid, 'measureName': $measureName })
2537
                        else if (not($type)) then
2538
                                local:addMessage('TR.noTypeRecord', map { 'filename': local:filename($record), 'id': $rid, 'measureName': $measureName })
2539
                        else ()
2540
        )[position() le $limitErrors]
2541
return
2542
(if ($messages) then 'FAILED' else 'PASSED',
2543
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2544
 $messages)</textarea></div>
2545
                           </div>
2546
                        </div>
2547
                        <div data-role="collapsible" data-enhanced="true" id="EID93357dee-35fa-49ac-9bbf-7448eb02616c" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2548
                           <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>
2549
                           <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>
2550
<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>
2551
                                 <tbody>
2552
                                    <tr>
2553
                                       <td>Status</td>
2554
                                       <td>Passed</td>
2555
                                    </tr>
2556
                                    <tr>
2557
                                       <td>Duration</td>
2558
                                       <td>0.001 s</td>
2559
                                    </tr>
2560
                                    <tr class="ReportDetail">
2561
                                       <td>Assertion ID</td>
2562
                                       <td>EID9fa0176c-5cc8-458b-9795-45f9a949cc56</td>
2563
                                    </tr>
2564
                                    <tr class="DoNotShowInSimpleView">
2565
                                       <td>Assertion URI</td>
2566
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID93357dee-35fa-49ac-9bbf-7448eb02616c" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID93357dee-35fa-49ac-9bbf-7448eb02616c'); return false;">Link</a></td>
2567
                                    </tr>
2568
                                 </tbody>
2569
                              </table><br><div class="ReportDetail Expression"><label for="EID93357dee-35fa-49ac-9bbf-7448eb02616c.expression">Expression:</label><textarea id="EID93357dee-35fa-49ac-9bbf-7448eb02616c.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'
2570
let $messages :=
2571
        (for $record in $records
2572
                let $rid := $record/gmd:fileIdentifier/*/text()
2573
                let $results := $record/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_TopologicalConsistency/gmd:result/gmd:DQ_ConformanceResult
2574
                return
2575
                for $result in $results
2576
                        let $measureName := $result/../../gmd:nameOfMeasure/*[1]/text()
2577
                        let $title := $result/gmd:specification/gmd:CI_Citation/gmd:title/*/text()
2578
                        let $date := $result/gmd:specification/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/*/text()
2579
                        let $dateTypeCode := $result/gmd:specification/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue
2580
                        let $pass := $result/gmd:pass
2581
                        let $explanation := $result/gmd:explanation
2582
                        return
2583
                        if (not($title = $titleINSPIRE)) then
2584
                                local:addMessage('TR.invalidTitle', map { 'filename': local:filename($record), 'id': $rid })
2585
                        else if (not($date)) then
2586
                                local:addMessage('TR.noDateElement', map { 'filename': local:filename($record), 'id': $rid })
2587
                        else if (not($dateTypeCode = 'publication')) then
2588
                                local:addMessage('TR.noDateCodeList', map { 'filename': local:filename($record), 'id': $rid })
2589
                        else if (not($pass = 'false')) then
2590
                                local:addMessage('TR.invalidPass', map { 'filename': local:filename($record), 'id': $rid })
2591
                        else if (not($explanation)) then
2592
                                local:addMessage('TR.noExplanation', map { 'filename': local:filename($record), 'id': $rid })
2593
            else if (not(string-length($explanation/gco:CharacterString/text()) != 0 or string-length($explanation/gmx:Anchor/text()) != 0)) then
2594
                                local:addMessage('TR.emptyExplanation', map { 'filename': local:filename($record), 'id': $rid })
2595
                        else ()
2596
        )[position() le $limitErrors]
2597
return
2598
(if ($messages) then 'FAILED' else 'PASSED',
2599
 local:error-statistics('TR.recordsWithErrors', count(fn:distinct-values($messages//etf:argument[@token='id']/text()))),
2600
 $messages)</textarea></div>
2601
                           </div>
2602
                        </div>
2603
                     </div>
2604
                  </div>
2605
               </div>
2606
            </div>
2607
         </div>
2608
         <div class="TestSuite" data-role="collapsible" data-theme="h" data-content-theme="h">
2609
            <h2>Conformance class: XML encoding of ISO 19115/19119 metadata
2610
               <div class="ui-li-count">1</div>
2611
            </h2>This test suite examines XML documents containing gmd:MD_Metadata records against basic requirements for the encoding for metadata in INSPIRE.<br/><br/>
2612
<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/>
2613
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>
2614
               <tbody>
2615
                  <tr>
2616
                     <td>Status</td>
2617
                     <td>Passed</td>
2618
                  </tr>
2619
                  <tr>
2620
                     <td>Duration</td>
2621
                     <td>21 s</td>
2622
                  </tr>
2623
                  <tr class="ReportDetail">
2624
                     <td>Test suite ID</td>
2625
                     <td>EIDe3500038-e37c-4dcf-806c-6bc82d585b3b</td>
2626
                  </tr>
2627
                  <tr class="ReportDetail">
2628
                     <td>Author</td>
2629
                     <td>interactive instruments GmbH</td>
2630
                  </tr>
2631
                  <tr class="ReportDetail">
2632
                     <td>Date created</td>
2633
                     <td>30/08/2016 00:00:00 GMT</td>
2634
                  </tr>
2635
                  <tr>
2636
                     <td>Version</td>
2637
                     <td>0.2.0</td>
2638
                  </tr>
2639
                  <tr class="ReportDetail">
2640
                     <td>Last editor</td>
2641
                     <td>interactive instruments GmbH</td>
2642
                  </tr>
2643
                  <tr class="ReportDetail">
2644
                     <td>Last updated</td>
2645
                     <td>21/02/2017 17:00:00 GMT</td>
2646
                  </tr>
2647
                  <tr class="ReportDetail">
2648
                     <td>Reference</td>
2649
                     <td><a class="ui-link" href="https://github.com/inspire-eu-validation/ets-repository/tree/master/metadata/xml">Link</a></td>
2650
                  </tr>
2651
                  <tr class="ReportDetail">
2652
                     <td>Hash</td>
2653
                     <td>CBF29CE484222325</td>
2654
                  </tr>
2655
               </tbody>
2656
            </table><br><div class="TestModulePlaceHolder">
2657
               <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">
2658
                  <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
2659
                        <div class="ui-li-count">1</div><span class="ui-collapsible-heading-status"> click to expand contents</span></a></h3>
2660
                  <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>
2661
                        <tbody>
2662
                           <tr>
2663
                              <td>Status</td>
2664
                              <td>Passed</td>
2665
                           </tr>
2666
                           <tr>
2667
                              <td>Duration</td>
2668
                              <td>21 s</td>
2669
                           </tr>
2670
                           <tr class="ReportDetail">
2671
                              <td>Test case ID</td>
2672
                              <td>EID242272e0-3f0a-4e9c-9643-657c4d6d304a</td>
2673
                           </tr>
2674
                        </tbody>
2675
                     </table><br><div class="TestStepPlaceHolder">
2676
                        <div data-role="collapsible" data-enhanced="true" id="EID0d871a7b-a283-4e98-9529-0db13e08fd04" data-mini="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed Assertion SuccessfulAssertion">
2677
                           <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>
2678
                           <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>
2679
<p>Official XML schemas are currently found in two separate locations:</p>
2680
<ul>
2681
<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>
2682
<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/>
2683
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/>
2684
The schemas located in the ISO repository for publicly available standards are the same as the ISO 19139 schemas dated "2007-04-17".</li>
2685
</ul>
2686
I.e., each document is validated using the following XML schema definition:
2687
<ul>
2688
<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>
2689
<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>
2690
<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>
2691
</ul>
2692
<p><b>Known limitations:</b></p>
2693
<ul>
2694
<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>
2695
</ul>
2696
<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>
2697
                                 <tbody>
2698
                                    <tr>
2699
                                       <td>Status</td>
2700
                                       <td>Passed</td>
2701
                                    </tr>
2702
                                    <tr>
2703
                                       <td>Duration</td>
2704
                                       <td>21 s</td>
2705
                                    </tr>
2706
                                    <tr class="ReportDetail">
2707
                                       <td>Assertion ID</td>
2708
                                       <td>EID04c71089-1d8c-4e67-897c-11908e78e2d4</td>
2709
                                    </tr>
2710
                                    <tr class="DoNotShowInSimpleView">
2711
                                       <td>Assertion URI</td>
2712
                                       <td><a class="ui-link" href="http://staging-inspire-validator.eu-west-1.elasticbeanstalk.com/etf-webapp/v2/TestRuns/EID18a09a5d-434c-4d0d-9333-e4a353cdbd57.html?lang=en#EID0d871a7b-a283-4e98-9529-0db13e08fd04" data-ajax="false" onclick="event.preventDefault(); jumpToAnchor('EID0d871a7b-a283-4e98-9529-0db13e08fd04'); return false;">Link</a></td>
2713
                                    </tr>
2714
                                 </tbody>
2715
                              </table><br><div class="ReportDetail Expression"><label for="EID0d871a7b-a283-4e98-9529-0db13e08fd04.expression">Expression:</label><textarea id="EID0d871a7b-a283-4e98-9529-0db13e08fd04.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 :=
2716
    (
2717
    if ($validationErrors) then
2718
                for $error in $validationErrors
2719
                return local:addMessage('TR.validationError', map { 'text': $error })
2720
        else
2721
                for $file in $db
2722
        return 
2723
            if ($file/element()/@xsi:schemaLocation) then 
2724
                let $result :=
2725
                    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
2726
                        try{ 
2727
                                                        validate:xsd($file, 'https://inspire.ec.europa.eu/draft-schemas/inspire-md-schemas-temp/apiso-inspire/apiso-inspire.xsd') } catch * {  $err:description }
2728
                    else
2729
                        try{ validate:xsd($file) } catch * {  $err:description }
2730
                return
2731
                if(not(string-length($result) = 0)) then
2732
                    local:addMessage('TR.invalidSchema',  map { 'filename': local:filename($file), 'count': string($result) })
2733
                else ()
2734
            else
2735
                for $record in $records
2736
                let $rid := $record/gmd:fileIdentifier/*/text()
2737
                let $result := 
2738
                    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
2739
                        try{ validate:xsd($record, 'https://inspire.ec.europa.eu/draft-schemas/inspire-md-schemas-temp/apiso-inspire/apiso-inspire.xsd') } catch * {  $err:description }
2740
                    else
2741
                        try{ validate:xsd($record) } catch * {  $err:description }
2742
                return
2743
                if(not(string-length($result) = 0)) then
2744
                    local:addMessage('TR.xmlSchemaErrorRecord',  map { 'filename': local:filename($record), 'id': $rid, 'error': string($result) })
2745
                else ()
2746
    )[position() le $limitErrors]
2747
return
2748
(if ($messages) then 'FAILED' else 'PASSED',
2749
 local:error-statistics('TR.filesWithErrors', count($messages[@ref eq 'TR.invalidSchema'])),
2750
 local:error-statistics('TR.recordsWithErrors', count($messages[@ref eq 'TR.invalidSchemaRecord'])),
2751
 $messages)</textarea></div>
2752
                           </div>
2753
                        </div>
2754
                     </div>
2755
                  </div>
2756
               </div>
2757
            </div>
2758
         </div>
2759
      </div>
2760
      <div data-role="footer">
2761
         <h1>Report generated by ETF</h1>
2762
      </div>
2763
      <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">
2764
            <option value="cntrlAllDetails">All details</option>
2765
            <option value="cntrlLessInformation">Less information</option>
2766
            <option value="cntrlSimplified" selected>Simplified</option></select></div><script>
2767
                        
2768
                        function SelectorCache() {
2769
                                var cache = {};
2770
                                function getFromCache( selector ) {
2771
                                        if ( undefined === cache[ selector ] ) {
2772
                                                cache[ selector ] = $( selector );
2773
                                        }
2774
                                        return cache[ selector ];
2775
                                }
2776
                                return { get: getFromCache };
2777
                        }
2778
                        var cache = new SelectorCache();
2779

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

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

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