udata 7.0.6.dev28209__py2.py3-none-any.whl → 7.0.6.dev28216__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.
- udata/core/dataset/rdf.py +65 -25
- udata/harvest/tests/dcat/evian.json +464 -0
- udata/harvest/tests/test_dcat_backend.py +15 -0
- {udata-7.0.6.dev28209.dist-info → udata-7.0.6.dev28216.dist-info}/METADATA +2 -2
- {udata-7.0.6.dev28209.dist-info → udata-7.0.6.dev28216.dist-info}/RECORD +9 -8
- {udata-7.0.6.dev28209.dist-info → udata-7.0.6.dev28216.dist-info}/LICENSE +0 -0
- {udata-7.0.6.dev28209.dist-info → udata-7.0.6.dev28216.dist-info}/WHEEL +0 -0
- {udata-7.0.6.dev28209.dist-info → udata-7.0.6.dev28216.dist-info}/entry_points.txt +0 -0
- {udata-7.0.6.dev28209.dist-info → udata-7.0.6.dev28216.dist-info}/top_level.txt +0 -0
udata/core/dataset/rdf.py
CHANGED
|
@@ -7,6 +7,7 @@ import logging
|
|
|
7
7
|
|
|
8
8
|
from datetime import date
|
|
9
9
|
from html.parser import HTMLParser
|
|
10
|
+
from typing import Optional
|
|
10
11
|
from dateutil.parser import parse as parse_dt
|
|
11
12
|
from flask import current_app
|
|
12
13
|
from geomet import wkt
|
|
@@ -339,36 +340,51 @@ def contact_point_from_rdf(rdf, dataset):
|
|
|
339
340
|
|
|
340
341
|
|
|
341
342
|
def spatial_from_rdf(graph):
|
|
343
|
+
geojsons = []
|
|
342
344
|
for term in graph.objects(DCT.spatial):
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
345
|
+
try:
|
|
346
|
+
# This may not be official in the norm but some ArcGis return
|
|
347
|
+
# bbox as literal directly in DCT.spatial.
|
|
348
|
+
if isinstance(term, Literal):
|
|
349
|
+
geojson = bbox_to_geojson_multipolygon(term.toPython())
|
|
350
|
+
if geojson is not None:
|
|
351
|
+
geojsons.append(geojson)
|
|
352
|
+
|
|
353
|
+
continue
|
|
354
|
+
|
|
355
|
+
for object in term.objects():
|
|
356
|
+
if isinstance(object, Literal):
|
|
357
|
+
if object.datatype.__str__() == 'https://www.iana.org/assignments/media-types/application/vnd.geo+json':
|
|
358
|
+
try:
|
|
359
|
+
geojson = json.loads(object.toPython())
|
|
360
|
+
except ValueError as e:
|
|
361
|
+
log.warning(f"Invalid JSON in spatial GeoJSON {object.toPython()} {e}")
|
|
362
|
+
continue
|
|
363
|
+
elif object.datatype.__str__() == 'http://www.opengis.net/rdf#wktLiteral':
|
|
364
|
+
try:
|
|
365
|
+
# .upper() si here because geomet doesn't support Polygon but only POLYGON
|
|
366
|
+
geojson = wkt.loads(object.toPython().strip().upper())
|
|
367
|
+
except ValueError as e:
|
|
368
|
+
log.warning(f"Invalid JSON in spatial WKT {object.toPython()} {e}")
|
|
369
|
+
continue
|
|
370
|
+
else:
|
|
357
371
|
continue
|
|
358
|
-
else:
|
|
359
|
-
continue
|
|
360
372
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
373
|
+
if geojson['type'] == 'Polygon':
|
|
374
|
+
geojson['type'] = 'MultiPolygon'
|
|
375
|
+
geojson['coordinates'] = [geojson['coordinates']]
|
|
364
376
|
|
|
365
|
-
|
|
377
|
+
geojsons.append(geojson)
|
|
378
|
+
except Exception as e:
|
|
379
|
+
log.exception(f"Exception during `spatial_from_rdf` for term {term}: {e}", stack_info=True)
|
|
366
380
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
381
|
+
for geojson in geojsons:
|
|
382
|
+
spatial_coverage = SpatialCoverage(geom=geojson)
|
|
383
|
+
try:
|
|
384
|
+
spatial_coverage.clean()
|
|
385
|
+
return spatial_coverage
|
|
386
|
+
except ValidationError:
|
|
387
|
+
continue
|
|
372
388
|
|
|
373
389
|
return None
|
|
374
390
|
|
|
@@ -609,3 +625,27 @@ def dataset_from_rdf(graph: Graph, dataset=None, node=None):
|
|
|
609
625
|
dataset.harvest.modified_at = modified_at
|
|
610
626
|
|
|
611
627
|
return dataset
|
|
628
|
+
|
|
629
|
+
def bbox_to_geojson_multipolygon(bbox_as_str: str) -> Optional[dict] :
|
|
630
|
+
bbox = bbox_as_str.strip().split(',')
|
|
631
|
+
if len(bbox) != 4:
|
|
632
|
+
return None
|
|
633
|
+
|
|
634
|
+
west = float(bbox[0])
|
|
635
|
+
south = float(bbox[1])
|
|
636
|
+
east = float(bbox[2])
|
|
637
|
+
north = float(bbox[3])
|
|
638
|
+
|
|
639
|
+
low_left = [west, south]
|
|
640
|
+
top_left = [west, north]
|
|
641
|
+
top_right = [east, north]
|
|
642
|
+
low_right = [east, south]
|
|
643
|
+
|
|
644
|
+
return {
|
|
645
|
+
'type': 'MultiPolygon',
|
|
646
|
+
'coordinates': [
|
|
647
|
+
[
|
|
648
|
+
[low_left, low_right, top_right, top_left, low_left],
|
|
649
|
+
],
|
|
650
|
+
],
|
|
651
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -160,6 +160,21 @@ class DcatBackendTest:
|
|
|
160
160
|
assert len(datasets['1'].resources) == 2
|
|
161
161
|
assert len(datasets['2'].resources) == 2
|
|
162
162
|
|
|
163
|
+
def test_harvest_literal_spatial(self, rmock):
|
|
164
|
+
url = mock_dcat(rmock, 'evian.json')
|
|
165
|
+
org = OrganizationFactory()
|
|
166
|
+
source = HarvestSourceFactory(backend='dcat',
|
|
167
|
+
url=url,
|
|
168
|
+
organization=org)
|
|
169
|
+
|
|
170
|
+
actions.run(source.slug)
|
|
171
|
+
|
|
172
|
+
datasets = {d.harvest.dct_identifier: d for d in Dataset.objects}
|
|
173
|
+
assert len(datasets) == 8
|
|
174
|
+
assert datasets['https://www.arcgis.com/home/item.html?id=f6565516d1354383b25793e630cf3f2b&sublayer=5'].spatial is not None
|
|
175
|
+
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]]]]}
|
|
176
|
+
|
|
177
|
+
|
|
163
178
|
@pytest.mark.skip(reason="Mocking S3 requires `moto` which is not available for our current Python 3.7. We can manually test it.")
|
|
164
179
|
@pytest.mark.options(SCHEMA_CATALOG_URL='https://example.com/schemas', HARVEST_JOBS_RETENTION_DAYS=0)
|
|
165
180
|
# @mock_s3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: udata
|
|
3
|
-
Version: 7.0.6.
|
|
3
|
+
Version: 7.0.6.dev28216
|
|
4
4
|
Summary: Open data portal
|
|
5
5
|
Home-page: https://github.com/opendatateam/udata
|
|
6
6
|
Author: Opendata Team
|
|
@@ -138,7 +138,7 @@ It is collectively taken care of by members of the
|
|
|
138
138
|
|
|
139
139
|
## Current (in progress)
|
|
140
140
|
|
|
141
|
-
-
|
|
141
|
+
- Fix, do not fail on spatial coverage harvesting exception and allow literal spatial BBOX from Arcgis [2998](https://github.com/opendatateam/udata/pull/2998)
|
|
142
142
|
|
|
143
143
|
## 7.0.5 (2024-03-20)
|
|
144
144
|
|
|
@@ -90,7 +90,7 @@ udata/core/dataset/forms.py,sha256=auVYxLrPMdtvf2uhgEpJviHiQOSfLpBJdpZ3dXwcjNs,6
|
|
|
90
90
|
udata/core/dataset/models.py,sha256=SK16LJP_vlSkeGrLJTFbHFNc9iHWwM6_A6DOT0SX5D4,39609
|
|
91
91
|
udata/core/dataset/permissions.py,sha256=3F2J7le3_rEYNhh88o3hSRWHAAt01_yHJM6RPmvCrRo,1090
|
|
92
92
|
udata/core/dataset/preview.py,sha256=puPKT3fBD7ezAcT6owh0JK1_rGNDFZOqgT223qGn3LY,2597
|
|
93
|
-
udata/core/dataset/rdf.py,sha256=
|
|
93
|
+
udata/core/dataset/rdf.py,sha256=pwYQLzpWXAZWThOMVx70pusTb7SzLgk7wh_9-ldPFAY,22808
|
|
94
94
|
udata/core/dataset/search.py,sha256=LOHtOJYZJDPJ5S_Ch7QmmvInpw8aysmNlzbAWbMq9d0,5329
|
|
95
95
|
udata/core/dataset/signals.py,sha256=TK6dfrOUitZZkGGOh6XmhYqYvIjzZpI70JTLV4k-JRM,161
|
|
96
96
|
udata/core/dataset/tasks.py,sha256=VB1sQ6Fwbax46IRLGyZUDPGgGOWBYrzAlKzV3npDCyM,8412
|
|
@@ -269,7 +269,7 @@ udata/harvest/tests/factories.py,sha256=CbQORC1OJ1_Agtv_3LjCXysNumjMYlROwZPSEAHo
|
|
|
269
269
|
udata/harvest/tests/test_actions.py,sha256=7xSpouCAcf5p_bd38zHCyPN7sKWUUZXA7IlpI-yNVrQ,27603
|
|
270
270
|
udata/harvest/tests/test_api.py,sha256=QXhseHfnkBEmMbIJzroMdDYGLDj6Njal1s-2sn0xhEM,14888
|
|
271
271
|
udata/harvest/tests/test_base_backend.py,sha256=JA8Df1Eu-lEPLZfxyK81bsmT6exOjV_3PtKHJekAp5g,12092
|
|
272
|
-
udata/harvest/tests/test_dcat_backend.py,sha256=
|
|
272
|
+
udata/harvest/tests/test_dcat_backend.py,sha256=T0cz5jPHr7h4dxxeq7-aJe53hRwNY_HGMiKVWwZeuMI,29379
|
|
273
273
|
udata/harvest/tests/test_filters.py,sha256=V2HFZlexIJa6r1DX6g2ktvIgjg4gSY11QPfPOd3_Oug,2370
|
|
274
274
|
udata/harvest/tests/test_models.py,sha256=p2VazyrPXSArBuf8Kf19TGPcQ86SnOGCGmvjcMOw0s0,924
|
|
275
275
|
udata/harvest/tests/test_notifications.py,sha256=ZwtwioittW3XcZc0x6zbHjs1dVaAxPytlVymnJa5w0E,817
|
|
@@ -280,6 +280,7 @@ udata/harvest/tests/csw_dcat/geonetworkv4-page-5.xml,sha256=0VmPp1kspik7YAmOFyr-
|
|
|
280
280
|
udata/harvest/tests/dcat/bnodes.jsonld,sha256=Leqny-ccp30564yojQYYckw_HKbhR0f5qUCaavc2ruE,7964
|
|
281
281
|
udata/harvest/tests/dcat/bnodes.xml,sha256=xuOcd9uEDRlvn9HOVqEPz-Pe3g4DCygTIChZZiA4jac,9470
|
|
282
282
|
udata/harvest/tests/dcat/catalog.xml,sha256=pBVSNZzA4gkgxHCttrjuBBVSumLFgXgvtSgnHr0ybk4,9239
|
|
283
|
+
udata/harvest/tests/dcat/evian.json,sha256=EeJT9NKrV4hfGfnkJVZG4gJaSLtzjNUBKu9rFO1KgHk,16646
|
|
283
284
|
udata/harvest/tests/dcat/flat.jsonld,sha256=BAw08MDhtW9Px3q6RAoTIqO_OwJmAwBS9EpC8BY_x98,8459
|
|
284
285
|
udata/harvest/tests/dcat/geonetwork.xml,sha256=9_pksE74Zzkbgs9okj6hEbo8CJS0FZjEnIdvopKfm7k,7928
|
|
285
286
|
udata/harvest/tests/dcat/nested.jsonld,sha256=GxGIsMcMv2PfxYj-e_gAnCXodxCgpwJKMA3wIb7xA7g,3911
|
|
@@ -658,9 +659,9 @@ udata/translations/pt/LC_MESSAGES/udata.mo,sha256=zCVMB-a4-mLM1jNyYMk58rgVRaVIwQ
|
|
|
658
659
|
udata/translations/pt/LC_MESSAGES/udata.po,sha256=avfWczvlLBKSohyB55-4TLmUGMU_Rze4XmAo4OTk2v0,43513
|
|
659
660
|
udata/translations/sr/LC_MESSAGES/udata.mo,sha256=ScuqdpaV4y1ZIpBAEfxeaKdzkyGZL0mJmKMoG6w0iRQ,28553
|
|
660
661
|
udata/translations/sr/LC_MESSAGES/udata.po,sha256=QpgEXh1eHjztPa7oNLXd_sds1DC95A-STTtZyTE4m-E,50093
|
|
661
|
-
udata-7.0.6.
|
|
662
|
-
udata-7.0.6.
|
|
663
|
-
udata-7.0.6.
|
|
664
|
-
udata-7.0.6.
|
|
665
|
-
udata-7.0.6.
|
|
666
|
-
udata-7.0.6.
|
|
662
|
+
udata-7.0.6.dev28216.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
|
|
663
|
+
udata-7.0.6.dev28216.dist-info/METADATA,sha256=smqq_Zok4Gm3nl6s0kXuEvFoG1RzYrfc6n9hAxj4UYM,119572
|
|
664
|
+
udata-7.0.6.dev28216.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
|
|
665
|
+
udata-7.0.6.dev28216.dist-info/entry_points.txt,sha256=ZqIUHhOth0MMQvMIeuhODbUCDwjR-Hvo7PaKrMwTKuQ,384
|
|
666
|
+
udata-7.0.6.dev28216.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
|
|
667
|
+
udata-7.0.6.dev28216.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|