udata 7.0.5.dev28140__py2.py3-none-any.whl → 7.0.6__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of udata might be problematic. Click here for more details.

Files changed (74) hide show
  1. udata/__init__.py +1 -1
  2. udata/commands/__init__.py +0 -3
  3. udata/commands/dcat.py +7 -4
  4. udata/core/activity/api.py +1 -1
  5. udata/core/activity/models.py +4 -3
  6. udata/core/activity/tasks.py +6 -5
  7. udata/core/dataset/factories.py +2 -4
  8. udata/core/dataset/models.py +2 -5
  9. udata/core/dataset/rdf.py +65 -25
  10. udata/core/dataset/search.py +0 -1
  11. udata/core/spatial/tests/test_api.py +7 -10
  12. udata/core/topic/factories.py +2 -2
  13. udata/harvest/backends/dcat.py +128 -24
  14. udata/harvest/tests/csw_dcat/XSLT.xml +4298 -0
  15. udata/harvest/tests/csw_dcat/geonetwork-iso-page-1.xml +1291 -0
  16. udata/harvest/tests/csw_dcat/geonetwork-iso-page-3.xml +1139 -0
  17. udata/harvest/tests/csw_dcat/geonetwork-iso-page-5.xml +1266 -0
  18. udata/harvest/tests/dcat/bnodes.xml +7 -1
  19. udata/harvest/tests/dcat/evian.json +464 -0
  20. udata/harvest/tests/test_dcat_backend.py +82 -9
  21. udata/migrations/2024-03-22-migrate-activity-kwargs-to-extras.py +16 -0
  22. udata/rdf.py +22 -1
  23. udata/search/__init__.py +2 -2
  24. udata/static/chunks/{11.c0ccea08914b6b41568e.js → 11.a23c110811a9ac943478.js} +3 -3
  25. udata/static/chunks/{11.c0ccea08914b6b41568e.js.map → 11.a23c110811a9ac943478.js.map} +1 -1
  26. udata/static/chunks/{13.526a25163ababaa44409.js → 13.0889e093f8664e38568c.js} +2 -2
  27. udata/static/chunks/{13.526a25163ababaa44409.js.map → 13.0889e093f8664e38568c.js.map} +1 -1
  28. udata/static/chunks/{16.7901839b4227881947f6.js → 16.f41599478d3e97ad9a30.js} +2 -2
  29. udata/static/chunks/{16.7901839b4227881947f6.js.map → 16.f41599478d3e97ad9a30.js.map} +1 -1
  30. udata/static/chunks/{19.471d5a2a08eef6e5338a.js → 19.2b534a26af8b17e9170b.js} +3 -3
  31. udata/static/chunks/{19.471d5a2a08eef6e5338a.js.map → 19.2b534a26af8b17e9170b.js.map} +1 -1
  32. udata/static/chunks/{5.534e0531d0e2b150146f.js → 5.7115454a1183e5c12eef.js} +3 -3
  33. udata/static/chunks/{5.534e0531d0e2b150146f.js.map → 5.7115454a1183e5c12eef.js.map} +1 -1
  34. udata/static/chunks/{6.e56975229e6065f68d2a.js → 6.16bb24fb8240f2746488.js} +3 -3
  35. udata/static/chunks/{6.e56975229e6065f68d2a.js.map → 6.16bb24fb8240f2746488.js.map} +1 -1
  36. udata/static/chunks/{9.534426728626f11f4571.js → 9.3e752966ff14e47e11f2.js} +2 -2
  37. udata/static/chunks/{9.534426728626f11f4571.js.map → 9.3e752966ff14e47e11f2.js.map} +1 -1
  38. udata/static/common.js +1 -1
  39. udata/static/common.js.map +1 -1
  40. udata/tests/api/test_datasets_api.py +45 -45
  41. udata/tests/api/test_me_api.py +13 -14
  42. udata/tests/dataset/test_dataset_actions.py +2 -2
  43. udata/tests/dataset/test_dataset_commands.py +3 -3
  44. udata/tests/dataset/test_dataset_model.py +2 -1
  45. udata/tests/organization/test_organization_model.py +3 -3
  46. udata/tests/organization/test_organization_rdf.py +3 -3
  47. udata/tests/reuse/test_reuse_model.py +2 -2
  48. udata/tests/search/test_adapter.py +12 -12
  49. udata/tests/search/test_results.py +4 -4
  50. udata/tests/site/test_site_api.py +3 -3
  51. udata/tests/site/test_site_metrics.py +3 -3
  52. udata/tests/site/test_site_rdf.py +6 -6
  53. udata/tests/test_activity.py +12 -0
  54. udata/tests/test_transfer.py +18 -17
  55. udata/translations/ar/LC_MESSAGES/udata.mo +0 -0
  56. udata/translations/ar/LC_MESSAGES/udata.po +90 -44
  57. udata/translations/de/LC_MESSAGES/udata.mo +0 -0
  58. udata/translations/de/LC_MESSAGES/udata.po +91 -45
  59. udata/translations/es/LC_MESSAGES/udata.mo +0 -0
  60. udata/translations/es/LC_MESSAGES/udata.po +90 -44
  61. udata/translations/fr/LC_MESSAGES/udata.mo +0 -0
  62. udata/translations/fr/LC_MESSAGES/udata.po +91 -45
  63. udata/translations/it/LC_MESSAGES/udata.mo +0 -0
  64. udata/translations/it/LC_MESSAGES/udata.po +90 -44
  65. udata/translations/pt/LC_MESSAGES/udata.mo +0 -0
  66. udata/translations/pt/LC_MESSAGES/udata.po +91 -45
  67. udata/translations/sr/LC_MESSAGES/udata.mo +0 -0
  68. udata/translations/sr/LC_MESSAGES/udata.po +91 -45
  69. {udata-7.0.5.dev28140.dist-info → udata-7.0.6.dist-info}/METADATA +13 -3
  70. {udata-7.0.5.dev28140.dist-info → udata-7.0.6.dist-info}/RECORD +74 -68
  71. {udata-7.0.5.dev28140.dist-info → udata-7.0.6.dist-info}/entry_points.txt +1 -0
  72. {udata-7.0.5.dev28140.dist-info → udata-7.0.6.dist-info}/LICENSE +0 -0
  73. {udata-7.0.5.dev28140.dist-info → udata-7.0.6.dist-info}/WHEEL +0 -0
  74. {udata-7.0.5.dev28140.dist-info → udata-7.0.6.dist-info}/top_level.txt +0 -0
@@ -95,7 +95,7 @@
95
95
  </ogc:Polygon>
96
96
  </dct:spatial>
97
97
  <dcterms:identifier>2</dcterms:identifier>
98
- <dct:conformsTo rdf:resource="https://www.ecologie.gouv.fr/sites/default/files/R%C3%A9glementation%20IRVE.pdf" />
98
+ <dct:conformsTo rdf:nodeID="Ne0189e93917c4f67a412fc44883322e7"/>
99
99
  </dcat:Dataset>
100
100
  </dcat:dataset>
101
101
  <dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2016-12-15T09:19:51.723691</dcterms:modified>
@@ -154,4 +154,10 @@
154
154
  <foaf:Organization rdf:about="http://data.test.org/organizations/1">
155
155
  <foaf:name>An Organization</foaf:name>
156
156
  </foaf:Organization>
157
+ <rdf:Description rdf:nodeID="Ne0189e93917c4f67a412fc44883322e7">
158
+ <rdf:type rdf:resource="http://purl.org/dc/terms/Standard"/>
159
+ <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
160
+ <dct:type rdf:resource="http://inspire.ec.europa.eu/glossary/SpatialReferenceSystem"/>
161
+ <dct:title xml:lang="fr">RGF93 / Lambert-93 (EPSG:2154)</dct:title>
162
+ </rdf:Description>
157
163
  </rdf:RDF>
@@ -0,0 +1,464 @@
1
+ {
2
+ "@context": "https://project-open-data.cio.gov/v1.1/schema/catalog.jsonld",
3
+ "@type": "dcat:Catalog",
4
+ "conformsTo": "https://project-open-data.cio.gov/v1.1/schema",
5
+ "describedBy": "https://project-open-data.cio.gov/v1.1/schema/catalog.json",
6
+ "dataset": [
7
+ {
8
+ "@type": "dcat:Dataset",
9
+ "identifier": "https://www.arcgis.com/home/item.html?id=f6565516d1354383b25793e630cf3f2b&sublayer=5",
10
+ "landingPage": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/maps/f6565516d1354383b25793e630cf3f2b_5",
11
+ "title": "stationnement velos",
12
+ "description": "<DIV STYLE=\"text-align:Left;\"><DIV><DIV><P><SPAN>Emplacement et description des stationnement vélos à Evian-les-Bains</SPAN></P></DIV></DIV></DIV>",
13
+ "keyword": [
14
+ "mobilite"
15
+ ],
16
+ "issued": "2022-07-29T10:07:13.000Z",
17
+ "modified": "2022-07-29T11:29:07.556Z",
18
+ "publisher": {
19
+ "name": "Ville d'Evian-les-Bains"
20
+ },
21
+ "contactPoint": {
22
+ "@type": "vcard:Contact",
23
+ "fn": "sigevian"
24
+ },
25
+ "accessLevel": "public",
26
+ "spatial": "6.5735,46.3912,6.6069,46.4028",
27
+ "license": "<DIV STYLE=\"text-align:Left;\"><DIV><DIV><P><SPAN>Soumis à la licence Etalab : https://www.etalab.gouv.fr/licence-ouverte-open-licence/</SPAN></P></DIV></DIV></DIV>",
28
+ "distribution": [
29
+ {
30
+ "@type": "dcat:Distribution",
31
+ "title": "ArcGIS Hub Dataset",
32
+ "format": "Web Page",
33
+ "mediaType": "text/html",
34
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/maps/f6565516d1354383b25793e630cf3f2b_5"
35
+ },
36
+ {
37
+ "@type": "dcat:Distribution",
38
+ "title": "ArcGIS GeoService",
39
+ "format": "ArcGIS GeoServices REST API",
40
+ "mediaType": "application/json",
41
+ "accessURL": "https://services.arcgis.com/Hbks8qlTugfLqQka/arcgis/rest/services/stationnement_velo/FeatureServer/5"
42
+ },
43
+ {
44
+ "@type": "dcat:Distribution",
45
+ "title": "CSV",
46
+ "format": "CSV",
47
+ "mediaType": "text/csv",
48
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/f6565516d1354383b25793e630cf3f2b/csv?layers=5"
49
+ },
50
+ {
51
+ "@type": "dcat:Distribution",
52
+ "title": "GeoJSON",
53
+ "format": "GeoJSON",
54
+ "mediaType": "application/vnd.geo+json",
55
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/f6565516d1354383b25793e630cf3f2b/geojson?layers=5"
56
+ },
57
+ {
58
+ "@type": "dcat:Distribution",
59
+ "title": "Shapefile",
60
+ "format": "ZIP",
61
+ "mediaType": "application/zip",
62
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/f6565516d1354383b25793e630cf3f2b/shapefile?layers=5"
63
+ },
64
+ {
65
+ "@type": "dcat:Distribution",
66
+ "title": "KML",
67
+ "format": "KML",
68
+ "mediaType": "application/vnd.google-earth.kml+xml",
69
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/f6565516d1354383b25793e630cf3f2b/kml?layers=5"
70
+ }
71
+ ],
72
+ "theme": [
73
+ "geospatial"
74
+ ]
75
+ },
76
+ {
77
+ "@type": "dcat:Dataset",
78
+ "identifier": "https://www.arcgis.com/home/item.html?id=cb6aa94ccb21492396e799d1ad282c02&sublayer=8",
79
+ "landingPage": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/maps/cb6aa94ccb21492396e799d1ad282c02_8",
80
+ "title": "poubelles",
81
+ "description": "<DIV STYLE=\"text-align:Left;\"><DIV><DIV><P><SPAN>Emplacement et description des poubelles à Evian-les-Bains</SPAN></P></DIV></DIV></DIV>",
82
+ "keyword": [
83
+ "environnement"
84
+ ],
85
+ "issued": "2022-07-29T09:08:13.000Z",
86
+ "modified": "2022-07-29T11:33:36.369Z",
87
+ "publisher": {
88
+ "name": "Ville d'Evian-les-Bains"
89
+ },
90
+ "contactPoint": {
91
+ "@type": "vcard:Contact",
92
+ "fn": "sigevian"
93
+ },
94
+ "accessLevel": "public",
95
+ "spatial": "6.5658,46.3835,6.6141,46.4047",
96
+ "license": "<DIV STYLE=\"text-align:Left;\"><DIV><DIV><P><SPAN>Soumis à la licence Etalab : https://www.etalab.gouv.fr/licence-ouverte-open-licence/</SPAN></P></DIV></DIV></DIV>",
97
+ "distribution": [
98
+ {
99
+ "@type": "dcat:Distribution",
100
+ "title": "ArcGIS Hub Dataset",
101
+ "format": "Web Page",
102
+ "mediaType": "text/html",
103
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/maps/cb6aa94ccb21492396e799d1ad282c02_8"
104
+ },
105
+ {
106
+ "@type": "dcat:Distribution",
107
+ "title": "ArcGIS GeoService",
108
+ "format": "ArcGIS GeoServices REST API",
109
+ "mediaType": "application/json",
110
+ "accessURL": "https://services.arcgis.com/Hbks8qlTugfLqQka/arcgis/rest/services/poubelles/FeatureServer/8"
111
+ },
112
+ {
113
+ "@type": "dcat:Distribution",
114
+ "title": "CSV",
115
+ "format": "CSV",
116
+ "mediaType": "text/csv",
117
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/cb6aa94ccb21492396e799d1ad282c02/csv?layers=8"
118
+ },
119
+ {
120
+ "@type": "dcat:Distribution",
121
+ "title": "GeoJSON",
122
+ "format": "GeoJSON",
123
+ "mediaType": "application/vnd.geo+json",
124
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/cb6aa94ccb21492396e799d1ad282c02/geojson?layers=8"
125
+ },
126
+ {
127
+ "@type": "dcat:Distribution",
128
+ "title": "Shapefile",
129
+ "format": "ZIP",
130
+ "mediaType": "application/zip",
131
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/cb6aa94ccb21492396e799d1ad282c02/shapefile?layers=8"
132
+ },
133
+ {
134
+ "@type": "dcat:Distribution",
135
+ "title": "KML",
136
+ "format": "KML",
137
+ "mediaType": "application/vnd.google-earth.kml+xml",
138
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/cb6aa94ccb21492396e799d1ad282c02/kml?layers=8"
139
+ }
140
+ ],
141
+ "theme": [
142
+ "geospatial"
143
+ ]
144
+ },
145
+ {
146
+ "@type": "dcat:Dataset",
147
+ "identifier": "https://www.arcgis.com/home/item.html?id=b7c181ff568344daae2a77bafbcc7225&sublayer=0",
148
+ "landingPage": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/maps/b7c181ff568344daae2a77bafbcc7225_0",
149
+ "title": "defibrillateurs",
150
+ "description": "<DIV STYLE=\"text-align:Left;\"><DIV><DIV><P><SPAN>défibrillateur</SPAN></P></DIV></DIV></DIV>",
151
+ "keyword": [
152
+ "sante"
153
+ ],
154
+ "issued": "2022-07-29T10:07:44.000Z",
155
+ "modified": "2023-03-13T14:34:36.923Z",
156
+ "publisher": {
157
+ "name": "Mairie Evian-les-Bains"
158
+ },
159
+ "contactPoint": {
160
+ "@type": "vcard:Contact",
161
+ "fn": "sigevian"
162
+ },
163
+ "accessLevel": "public",
164
+ "spatial": "6.5664,46.3889,6.6088,46.4039",
165
+ "license": "<DIV STYLE=\"text-align:Left;\"><DIV><DIV><P><SPAN>Soumis à la licence Etalab</SPAN></P></DIV></DIV></DIV>",
166
+ "distribution": [
167
+ {
168
+ "@type": "dcat:Distribution",
169
+ "title": "ArcGIS Hub Dataset",
170
+ "format": "Web Page",
171
+ "mediaType": "text/html",
172
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/maps/b7c181ff568344daae2a77bafbcc7225_0"
173
+ },
174
+ {
175
+ "@type": "dcat:Distribution",
176
+ "title": "ArcGIS GeoService",
177
+ "format": "ArcGIS GeoServices REST API",
178
+ "mediaType": "application/json",
179
+ "accessURL": "https://services.arcgis.com/Hbks8qlTugfLqQka/arcgis/rest/services/defibrillateurs/FeatureServer/0"
180
+ },
181
+ {
182
+ "@type": "dcat:Distribution",
183
+ "title": "CSV",
184
+ "format": "CSV",
185
+ "mediaType": "text/csv",
186
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/b7c181ff568344daae2a77bafbcc7225/csv?layers=0"
187
+ },
188
+ {
189
+ "@type": "dcat:Distribution",
190
+ "title": "GeoJSON",
191
+ "format": "GeoJSON",
192
+ "mediaType": "application/vnd.geo+json",
193
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/b7c181ff568344daae2a77bafbcc7225/geojson?layers=0"
194
+ },
195
+ {
196
+ "@type": "dcat:Distribution",
197
+ "title": "Shapefile",
198
+ "format": "ZIP",
199
+ "mediaType": "application/zip",
200
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/b7c181ff568344daae2a77bafbcc7225/shapefile?layers=0"
201
+ },
202
+ {
203
+ "@type": "dcat:Distribution",
204
+ "title": "KML",
205
+ "format": "KML",
206
+ "mediaType": "application/vnd.google-earth.kml+xml",
207
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/b7c181ff568344daae2a77bafbcc7225/kml?layers=0"
208
+ }
209
+ ],
210
+ "theme": [
211
+ "geospatial"
212
+ ]
213
+ },
214
+ {
215
+ "@type": "dcat:Dataset",
216
+ "identifier": "https://www.arcgis.com/home/item.html?id=dcc09451ea4f4c1398584374120137a0&sublayer=6",
217
+ "landingPage": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/maps/dcc09451ea4f4c1398584374120137a0_6",
218
+ "title": "places de marche",
219
+ "description": "<DIV STYLE=\"text-align:Left;\"><DIV><DIV><P><SPAN>Zone et description des emplacements du marché à Evian-les-Bains</SPAN></P></DIV></DIV></DIV>",
220
+ "keyword": [
221
+ "environnement"
222
+ ],
223
+ "issued": "2022-07-29T10:06:57.000Z",
224
+ "modified": "2024-02-09T14:33:50.766Z",
225
+ "publisher": {
226
+ "name": "Ville d'Evian-les-Bains"
227
+ },
228
+ "contactPoint": {
229
+ "@type": "vcard:Contact",
230
+ "fn": "sigevian"
231
+ },
232
+ "accessLevel": "public",
233
+ "spatial": "6.5873,46.4006,6.5889,46.4020",
234
+ "license": "",
235
+ "distribution": [
236
+ {
237
+ "@type": "dcat:Distribution",
238
+ "title": "ArcGIS Hub Dataset",
239
+ "format": "Web Page",
240
+ "mediaType": "text/html",
241
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/maps/dcc09451ea4f4c1398584374120137a0_6"
242
+ },
243
+ {
244
+ "@type": "dcat:Distribution",
245
+ "title": "ArcGIS GeoService",
246
+ "format": "ArcGIS GeoServices REST API",
247
+ "mediaType": "application/json",
248
+ "accessURL": "https://services.arcgis.com/Hbks8qlTugfLqQka/arcgis/rest/services/place_de_marche/FeatureServer/6"
249
+ },
250
+ {
251
+ "@type": "dcat:Distribution",
252
+ "title": "CSV",
253
+ "format": "CSV",
254
+ "mediaType": "text/csv",
255
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/dcc09451ea4f4c1398584374120137a0/csv?layers=6"
256
+ },
257
+ {
258
+ "@type": "dcat:Distribution",
259
+ "title": "GeoJSON",
260
+ "format": "GeoJSON",
261
+ "mediaType": "application/vnd.geo+json",
262
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/dcc09451ea4f4c1398584374120137a0/geojson?layers=6"
263
+ },
264
+ {
265
+ "@type": "dcat:Distribution",
266
+ "title": "Shapefile",
267
+ "format": "ZIP",
268
+ "mediaType": "application/zip",
269
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/dcc09451ea4f4c1398584374120137a0/shapefile?layers=6"
270
+ },
271
+ {
272
+ "@type": "dcat:Distribution",
273
+ "title": "KML",
274
+ "format": "KML",
275
+ "mediaType": "application/vnd.google-earth.kml+xml",
276
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/dcc09451ea4f4c1398584374120137a0/kml?layers=6"
277
+ }
278
+ ],
279
+ "theme": [
280
+ "geospatial"
281
+ ]
282
+ },
283
+ {
284
+ "@type": "dcat:Dataset",
285
+ "identifier": "https://www.arcgis.com/home/item.html?id=94a712dd0d1747c1b899a58f927a2566&sublayer=4",
286
+ "landingPage": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/maps/94a712dd0d1747c1b899a58f927a2566_4",
287
+ "title": "places PMR",
288
+ "description": "<DIV STYLE=\"text-align:Left;\"><DIV><DIV><P><SPAN>Emplacement et description des places PMR</SPAN></P></DIV></DIV></DIV>",
289
+ "keyword": [
290
+ "mobilite"
291
+ ],
292
+ "issued": "2022-07-29T09:09:31.000Z",
293
+ "modified": "2022-08-23T11:34:50.466Z",
294
+ "publisher": {
295
+ "name": "Ville Evian-les-Bains"
296
+ },
297
+ "contactPoint": {
298
+ "@type": "vcard:Contact",
299
+ "fn": "sigevian"
300
+ },
301
+ "accessLevel": "public",
302
+ "spatial": "6.5662,46.3885,6.6130,46.4045",
303
+ "license": "",
304
+ "distribution": [
305
+ {
306
+ "@type": "dcat:Distribution",
307
+ "title": "ArcGIS Hub Dataset",
308
+ "format": "Web Page",
309
+ "mediaType": "text/html",
310
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/maps/94a712dd0d1747c1b899a58f927a2566_4"
311
+ },
312
+ {
313
+ "@type": "dcat:Distribution",
314
+ "title": "ArcGIS GeoService",
315
+ "format": "ArcGIS GeoServices REST API",
316
+ "mediaType": "application/json",
317
+ "accessURL": "https://services.arcgis.com/Hbks8qlTugfLqQka/arcgis/rest/services/places_PMR/FeatureServer/4"
318
+ },
319
+ {
320
+ "@type": "dcat:Distribution",
321
+ "title": "CSV",
322
+ "format": "CSV",
323
+ "mediaType": "text/csv",
324
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/94a712dd0d1747c1b899a58f927a2566/csv?layers=4"
325
+ },
326
+ {
327
+ "@type": "dcat:Distribution",
328
+ "title": "GeoJSON",
329
+ "format": "GeoJSON",
330
+ "mediaType": "application/vnd.geo+json",
331
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/94a712dd0d1747c1b899a58f927a2566/geojson?layers=4"
332
+ },
333
+ {
334
+ "@type": "dcat:Distribution",
335
+ "title": "Shapefile",
336
+ "format": "ZIP",
337
+ "mediaType": "application/zip",
338
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/94a712dd0d1747c1b899a58f927a2566/shapefile?layers=4"
339
+ },
340
+ {
341
+ "@type": "dcat:Distribution",
342
+ "title": "KML",
343
+ "format": "KML",
344
+ "mediaType": "application/vnd.google-earth.kml+xml",
345
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/api/download/v1/items/94a712dd0d1747c1b899a58f927a2566/kml?layers=4"
346
+ }
347
+ ],
348
+ "theme": [
349
+ "geospatial"
350
+ ]
351
+ },
352
+ {
353
+ "@type": "dcat:Dataset",
354
+ "identifier": "https://www.arcgis.com/home/item.html?id=92a676a42a864c4baf58856e445b6d41",
355
+ "landingPage": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/documents/92a676a42a864c4baf58856e445b6d41_1231",
356
+ "title": "Publication actes dématérialisés",
357
+ "description": "",
358
+ "keyword": [
359
+ "OpenData"
360
+ ],
361
+ "issued": "2023-10-30T08:48:06.000Z",
362
+ "modified": "2023-10-30T08:56:01.000Z",
363
+ "publisher": {
364
+ "name": "sigevian"
365
+ },
366
+ "contactPoint": {
367
+ "@type": "vcard:Contact",
368
+ "fn": "sigevian"
369
+ },
370
+ "accessLevel": "public",
371
+ "spatial": "{{extent:computeSpatialProperty}}",
372
+ "license": "",
373
+ "distribution": [
374
+ {
375
+ "@type": "dcat:Distribution",
376
+ "title": "ArcGIS Hub Dataset",
377
+ "format": "Web Page",
378
+ "mediaType": "text/html",
379
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/documents/92a676a42a864c4baf58856e445b6d41_1231"
380
+ },
381
+ {
382
+ "@type": "dcat:Distribution",
383
+ "title": "ArcGIS GeoService",
384
+ "format": "ArcGIS GeoServices REST API",
385
+ "mediaType": "application/json",
386
+ "accessURL": "https://publiact.fr/company/1231"
387
+ }
388
+ ],
389
+ "theme": [
390
+ "geospatial"
391
+ ]
392
+ },
393
+ {
394
+ "@type": "dcat:Dataset",
395
+ "identifier": "https://www.arcgis.com/home/item.html?id=856b7eb926a14f4cb34d95597bafb610",
396
+ "landingPage": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/documents/856b7eb926a14f4cb34d95597bafb610",
397
+ "title": "Carte piéton concertation",
398
+ "description": "",
399
+ "keyword": [
400
+ "evian",
401
+ "mobilite"
402
+ ],
403
+ "issued": "2022-07-25T14:30:43.000Z",
404
+ "modified": "2022-08-01T09:26:34.000Z",
405
+ "publisher": {
406
+ "name": "sigevian"
407
+ },
408
+ "contactPoint": {
409
+ "@type": "vcard:Contact",
410
+ "fn": "sigevian"
411
+ },
412
+ "accessLevel": "public",
413
+ "spatial": "{{extent:computeSpatialProperty}}",
414
+ "license": "",
415
+ "distribution": [
416
+ {
417
+ "@type": "dcat:Distribution",
418
+ "title": "ArcGIS Hub Dataset",
419
+ "format": "Web Page",
420
+ "mediaType": "text/html",
421
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/documents/856b7eb926a14f4cb34d95597bafb610"
422
+ }
423
+ ],
424
+ "theme": [
425
+ "geospatial"
426
+ ]
427
+ },
428
+ {
429
+ "@type": "dcat:Dataset",
430
+ "identifier": "https://www.arcgis.com/home/item.html?id=8acd3deee8d042538e21925d0640f199",
431
+ "landingPage": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/documents/8acd3deee8d042538e21925d0640f199",
432
+ "title": "Carte vélo finale",
433
+ "description": "",
434
+ "keyword": [
435
+ "evian",
436
+ "mobilite"
437
+ ],
438
+ "issued": "2022-07-25T14:30:41.000Z",
439
+ "modified": "2022-07-28T13:29:26.000Z",
440
+ "publisher": {
441
+ "name": "sigevian"
442
+ },
443
+ "contactPoint": {
444
+ "@type": "vcard:Contact",
445
+ "fn": "sigevian"
446
+ },
447
+ "accessLevel": "public",
448
+ "spatial": "{{extent:computeSpatialProperty}}",
449
+ "license": "",
450
+ "distribution": [
451
+ {
452
+ "@type": "dcat:Distribution",
453
+ "title": "ArcGIS Hub Dataset",
454
+ "format": "Web Page",
455
+ "mediaType": "text/html",
456
+ "accessURL": "https://ville-d-evian-opendata-ville-evian.hub.arcgis.com/documents/8acd3deee8d042538e21925d0640f199"
457
+ }
458
+ ],
459
+ "theme": [
460
+ "geospatial"
461
+ ]
462
+ }
463
+ ]
464
+ }
@@ -1,21 +1,22 @@
1
+ from datetime import date
1
2
  import logging
2
3
  import os
3
- from flask import current_app
4
+ import re
4
5
 
5
6
  import pytest
6
7
 
7
- from datetime import date
8
8
  import boto3
9
+ from flask import current_app
9
10
  import xml.etree.ElementTree as ET
10
- from udata.harvest.models import HarvestJob
11
11
 
12
+ from udata.harvest.models import HarvestJob
12
13
  from udata.models import Dataset
13
14
  from udata.core.organization.factories import OrganizationFactory
14
15
  from udata.core.dataset.factories import LicenseFactory, ResourceSchemaMockData
15
16
  from udata.storage.s3 import get_from_json
16
17
 
17
18
  from .factories import HarvestSourceFactory
18
- from ..backends.dcat import URIS_TO_REPLACE
19
+ from ..backends.dcat import URIS_TO_REPLACE, CswIso19139DcatBackend
19
20
  from .. import actions
20
21
 
21
22
  log = logging.getLogger(__name__)
@@ -160,6 +161,21 @@ class DcatBackendTest:
160
161
  assert len(datasets['1'].resources) == 2
161
162
  assert len(datasets['2'].resources) == 2
162
163
 
164
+ def test_harvest_literal_spatial(self, rmock):
165
+ url = mock_dcat(rmock, 'evian.json')
166
+ org = OrganizationFactory()
167
+ source = HarvestSourceFactory(backend='dcat',
168
+ url=url,
169
+ organization=org)
170
+
171
+ actions.run(source.slug)
172
+
173
+ datasets = {d.harvest.dct_identifier: d for d in Dataset.objects}
174
+ assert len(datasets) == 8
175
+ assert datasets['https://www.arcgis.com/home/item.html?id=f6565516d1354383b25793e630cf3f2b&sublayer=5'].spatial is not None
176
+ assert datasets['https://www.arcgis.com/home/item.html?id=f6565516d1354383b25793e630cf3f2b&sublayer=5'].spatial.geom == {'type': 'MultiPolygon', 'coordinates': [[[[6.5735, 46.3912], [6.6069, 46.3912], [6.6069, 46.4028], [6.5735, 46.4028], [6.5735, 46.3912]]]]}
177
+
178
+
163
179
  @pytest.mark.skip(reason="Mocking S3 requires `moto` which is not available for our current Python 3.7. We can manually test it.")
164
180
  @pytest.mark.options(SCHEMA_CATALOG_URL='https://example.com/schemas', HARVEST_JOBS_RETENTION_DAYS=0)
165
181
  # @mock_s3
@@ -195,8 +211,8 @@ class DcatBackendTest:
195
211
  assert resources_by_title['Resource 1-2'].schema.name == None
196
212
  assert resources_by_title['Resource 1-2'].schema.version == None
197
213
 
198
- assert datasets['2'].schema.name == None
199
- assert datasets['2'].schema.url == 'https://www.ecologie.gouv.fr/sites/default/files/R%C3%A9glementation%20IRVE.pdf'
214
+ assert datasets['2'].schema.name == 'RGF93 / Lambert-93 (EPSG:2154)'
215
+ assert datasets['2'].schema.url == 'http://inspire.ec.europa.eu/glossary/SpatialReferenceSystem'
200
216
  resources_by_title = { resource['title']: resource for resource in datasets['2'].resources }
201
217
 
202
218
  # Unknown schema are kept as they were provided
@@ -265,8 +281,8 @@ class DcatBackendTest:
265
281
  assert resources_by_title['Resource 1-2'].schema.name == None
266
282
  assert resources_by_title['Resource 1-2'].schema.version == None
267
283
 
268
- assert datasets['2'].schema.name == None
269
- assert datasets['2'].schema.url == 'https://www.ecologie.gouv.fr/sites/default/files/R%C3%A9glementation%20IRVE.pdf'
284
+ assert datasets['2'].schema.name == 'RGF93 / Lambert-93 (EPSG:2154)'
285
+ assert datasets['2'].schema.url == 'http://inspire.ec.europa.eu/glossary/SpatialReferenceSystem'
270
286
  resources_by_title = { resource['title']: resource for resource in datasets['2'].resources }
271
287
 
272
288
  # Unknown schema are kept as they were provided
@@ -614,7 +630,7 @@ class DcatBackendTest:
614
630
 
615
631
 
616
632
  @pytest.mark.usefixtures('clean_db')
617
- @pytest.mark.options(PLUGINS=['csw-dcat'])
633
+ @pytest.mark.options(PLUGINS=['csw'])
618
634
  class CswDcatBackendTest:
619
635
 
620
636
  def test_geonetworkv4(self, rmock):
@@ -662,3 +678,60 @@ class CswDcatBackendTest:
662
678
 
663
679
  assert 'User-Agent' in get_mock.last_request.headers
664
680
  assert get_mock.last_request.headers['User-Agent'] == 'uData/0.1 csw-dcat'
681
+
682
+
683
+ @pytest.mark.usefixtures('clean_db')
684
+ @pytest.mark.options(PLUGINS=['csw'])
685
+ class CswIso19139DcatBackendTest:
686
+
687
+ def test_geo2france(self, rmock):
688
+
689
+ with open(os.path.join(CSW_DCAT_FILES_DIR, "XSLT.xml"), "r") as f:
690
+ xslt = f.read()
691
+ url = mock_csw_pagination(rmock, 'geonetwork/srv/eng/csw.rdf', 'geonetwork-iso-page-{}.xml')
692
+ rmock.get(CswIso19139DcatBackend.XSL_URL, text=xslt)
693
+ org = OrganizationFactory()
694
+ source = HarvestSourceFactory(backend='csw-iso-19139',
695
+ url=url,
696
+ organization=org)
697
+
698
+ actions.run(source.slug)
699
+
700
+ source.reload()
701
+
702
+ job = source.get_last_job()
703
+ assert len(job.items) == 6
704
+
705
+ datasets = {d.harvest.dct_identifier: d for d in Dataset.objects}
706
+
707
+ assert len(datasets) == 6
708
+
709
+ # First dataset
710
+ # dataset identifier is gmd:RS_Identifier > gmd:codeSpace + gmd:code
711
+ dataset = datasets['http://catalogue.geo-ide.developpement-durable.gouv.fr/fr-120066022-orphan-residentifier-140d31c6-643d-42a9-85df-2737a118e144']
712
+ assert dataset.title == "Plan local d'urbanisme de la commune de Cartigny"
713
+ assert dataset.description == "Le présent standard de données COVADIS concerne les documents de plans locaux d'urbanisme (PLU) et les plans d'occupation des sols (POS qui valent PLU)."
714
+ assert set(dataset.tags) == set([
715
+ 'amenagement-urbanisme-zonages-planification', 'cartigny',
716
+ 'document-durbanisme', 'donnees-ouvertes', 'plu', 'usage-des-sols'
717
+ ])
718
+ assert dataset.harvest.created_at.date() == date(2017, 10, 7)
719
+ assert dataset.spatial.geom == {'type': 'MultiPolygon', 'coordinates':
720
+ [[[[3.28133559, 50.48188019], [1.31279111, 50.48188019], [1.31279111, 49.38547516], [3.28133559, 49.38547516], [3.28133559, 50.48188019]]]]
721
+ }
722
+ assert dataset.contact_point.name == 'DDTM 80 (Direction Départementale des Territoires et de la Mer de la Somme)'
723
+ assert dataset.contact_point.email == 'ddtm-sap-bsig@somme.gouv.fr'
724
+
725
+ # License is not properly mapped in XSLT conversion
726
+ assert dataset.license is None
727
+
728
+ # Distributions don't get properly mapped to distribution with this XSLT if missing CI_OnLineFunctionCode.
729
+ # A CI_OnLineFunctionCode was added explicitely on one of the Online Resources.
730
+ # (See mapping at: https://semiceu.github.io/GeoDCAT-AP/releases/2.0.0/#resource-locator---on-line-resource)
731
+ assert len(dataset.resources) == 1
732
+ resource = dataset.resources[0]
733
+ assert resource.title == 'Téléchargement direct du lot et des documents associés'
734
+ assert resource.url == 'http://atom.geo-ide.developpement-durable.gouv.fr/atomArchive/GetResource?id=fr-120066022-ldd-cab63273-b3ae-4e8a-ae1c-6192e45faa94&datasetAggregate=true'
735
+
736
+ # Sadly resource format is parsed as a blank node. Format parsing should be improved.
737
+ assert re.match(r'n[0-9a-f]{32}', resource.format)
@@ -0,0 +1,16 @@
1
+ """
2
+ Migrates `Activity.kwargs` to `Activity.extras`.
3
+ """
4
+ import logging
5
+
6
+ from mongoengine.connection import get_db
7
+
8
+ log = logging.getLogger(__name__)
9
+
10
+ def migrate(db):
11
+ log.info('Processing activity objects')
12
+
13
+ result = get_db().activity.update_many(filter={}, update={'$rename': {'kwargs': 'extras'}})
14
+
15
+ log.info(f'{result.modified_count} activity object(s) migrated')
16
+ log.info('Done')