udata 7.0.6.dev28263__py2.py3-none-any.whl → 7.0.6.dev28300__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/commands/dcat.py +7 -4
- udata/harvest/backends/dcat.py +128 -24
- udata/harvest/tests/csw_dcat/XSLT.xml +4298 -0
- udata/harvest/tests/csw_dcat/geonetwork-iso-page-1.xml +1291 -0
- udata/harvest/tests/csw_dcat/geonetwork-iso-page-3.xml +1139 -0
- udata/harvest/tests/csw_dcat/geonetwork-iso-page-5.xml +1266 -0
- udata/harvest/tests/test_dcat_backend.py +63 -5
- udata/rdf.py +1 -0
- {udata-7.0.6.dev28263.dist-info → udata-7.0.6.dev28300.dist-info}/METADATA +2 -1
- {udata-7.0.6.dev28263.dist-info → udata-7.0.6.dev28300.dist-info}/RECORD +14 -10
- {udata-7.0.6.dev28263.dist-info → udata-7.0.6.dev28300.dist-info}/entry_points.txt +1 -0
- {udata-7.0.6.dev28263.dist-info → udata-7.0.6.dev28300.dist-info}/LICENSE +0 -0
- {udata-7.0.6.dev28263.dist-info → udata-7.0.6.dev28300.dist-info}/WHEEL +0 -0
- {udata-7.0.6.dev28263.dist-info → udata-7.0.6.dev28300.dist-info}/top_level.txt +0 -0
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
from datetime import date
|
|
1
2
|
import logging
|
|
2
3
|
import os
|
|
3
|
-
|
|
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__)
|
|
@@ -629,7 +630,7 @@ class DcatBackendTest:
|
|
|
629
630
|
|
|
630
631
|
|
|
631
632
|
@pytest.mark.usefixtures('clean_db')
|
|
632
|
-
@pytest.mark.options(PLUGINS=['csw
|
|
633
|
+
@pytest.mark.options(PLUGINS=['csw'])
|
|
633
634
|
class CswDcatBackendTest:
|
|
634
635
|
|
|
635
636
|
def test_geonetworkv4(self, rmock):
|
|
@@ -677,3 +678,60 @@ class CswDcatBackendTest:
|
|
|
677
678
|
|
|
678
679
|
assert 'User-Agent' in get_mock.last_request.headers
|
|
679
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)
|
udata/rdf.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: udata
|
|
3
|
-
Version: 7.0.6.
|
|
3
|
+
Version: 7.0.6.dev28300
|
|
4
4
|
Summary: Open data portal
|
|
5
5
|
Home-page: https://github.com/opendatateam/udata
|
|
6
6
|
Author: Opendata Team
|
|
@@ -138,6 +138,7 @@ It is collectively taken care of by members of the
|
|
|
138
138
|
|
|
139
139
|
## Current (in progress)
|
|
140
140
|
|
|
141
|
+
- Add new harvester for ISO DCAT with XSLT transform [#2982](https://github.com/opendatateam/udata/pull/2982)
|
|
141
142
|
- 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
143
|
- Mock calls to example.com [#3000](https://github.com/opendatateam/udata/pull/3000)
|
|
143
144
|
- Fix duplicate logs in console commands [#2996](https://github.com/opendatateam/udata/pull/2996)
|
|
@@ -8,7 +8,7 @@ udata/errors.py,sha256=chc1880TPGteIL-Rfb9hdeAyZI4vdWZQU3JQ_5VF5t0,116
|
|
|
8
8
|
udata/factories.py,sha256=KKPQeYzMdCxwGVLu9_Y-LxMx14cIgXA0jG2pHZ7uvFY,496
|
|
9
9
|
udata/i18n.py,sha256=E-JoY57Cv4vgPvChkWjpwZAbuYVI8e6BO6raeu_3_Pw,8352
|
|
10
10
|
udata/mail.py,sha256=dAMcbEtk5e54alpQezvF5adDrRPgdaT36QEdHD_5v50,2145
|
|
11
|
-
udata/rdf.py,sha256=
|
|
11
|
+
udata/rdf.py,sha256=eu_tKOGQ9Bs8yyf5QGQNE9yyXGiUxevDYAIIun_KqqI,9919
|
|
12
12
|
udata/routing.py,sha256=ztmFx4YzqlEqa-HG9a43WfGYfULC95ZxTlkr4iHkzVQ,7045
|
|
13
13
|
udata/sentry.py,sha256=KiZz0PpmYpZMvykH9UAbHpF4xBY0Q-8DeiEbXEHDUdw,2683
|
|
14
14
|
udata/settings.py,sha256=nnFcD1DBt3IbO2a10kE5ux9Q2KyeyOvXYLSOLWlF7nw,17142
|
|
@@ -39,7 +39,7 @@ udata/auth/views.py,sha256=wxk2GEBHHqgyUk81RdeZMBWPjDn69crmtb_blkhXsNs,6164
|
|
|
39
39
|
udata/commands/__init__.py,sha256=mTRAsySo7lH4BlLs_IP0obyhU_hUMxLNB7N8Vh1HkMY,7756
|
|
40
40
|
udata/commands/cache.py,sha256=uVpb3WQdqg8NZRSiWEa7cYdcx3QyFF53UAI_f2pXtV8,341
|
|
41
41
|
udata/commands/db.py,sha256=1gQwffdopW2l6BMfj0MiJ7cKLN8zfi3WLFRaIrPxQn8,11131
|
|
42
|
-
udata/commands/dcat.py,sha256=
|
|
42
|
+
udata/commands/dcat.py,sha256=F8GVCT_arz5R_xwIygxbiis6cUSPM89C79Wlu46fR6g,3354
|
|
43
43
|
udata/commands/fixtures.py,sha256=RrzRdUBJ2FbS-iDsEMPu5Nfp0WJXzU2rk3GB9t6JlRc,5852
|
|
44
44
|
udata/commands/images.py,sha256=bzVvLj9LZ_nkyTdPlPe4g5U26k53VTH5ADCWmOfM8e4,2037
|
|
45
45
|
udata/commands/info.py,sha256=Gf0AT8yP1tScbKLz8aXurlro55ot19sefrbOhELi034,1548
|
|
@@ -263,17 +263,21 @@ udata/harvest/signals.py,sha256=wlXTi1E7rIVyNvxw0yUqyN5gF3thg276LAOmAF9vDJY,1338
|
|
|
263
263
|
udata/harvest/tasks.py,sha256=0VhefKCQJSU_puTpdKOpvt3WORXHAFWGEB-R_MhB12M,1981
|
|
264
264
|
udata/harvest/backends/__init__.py,sha256=qcLhHKWO97TeWd93ZwymG_Cc9FO7sMM7h4fs6XYdtS8,447
|
|
265
265
|
udata/harvest/backends/base.py,sha256=oaPQcQ0onIXH5ofUtWH5sM6_5_wSBLawHSOjeeoG6jQ,12258
|
|
266
|
-
udata/harvest/backends/dcat.py,sha256=
|
|
266
|
+
udata/harvest/backends/dcat.py,sha256=SCbWorkuNzM7OvzFzBh1Is4QTWquOcnCLa_yd3HbgW0,14846
|
|
267
267
|
udata/harvest/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
268
268
|
udata/harvest/tests/factories.py,sha256=CbQORC1OJ1_Agtv_3LjCXysNumjMYlROwZPSEAHo8sM,2005
|
|
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=zZea9e2awtFiLrdREeaHcp9d6tSHhAHEuXr_fc5fKjk,32462
|
|
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
|
|
276
276
|
udata/harvest/tests/test_tasks.py,sha256=OfUnsg6x3DtbS2s3ToRDZY46aqqmbowN1sqASmsLaN4,680
|
|
277
|
+
udata/harvest/tests/csw_dcat/XSLT.xml,sha256=vnJF2rom7oPVpzI9jwzwG6ek1TDXTY8GfbuQq_3vFxs,180475
|
|
278
|
+
udata/harvest/tests/csw_dcat/geonetwork-iso-page-1.xml,sha256=cANO-kr4NEDgq7n6pG_9hnOcPrYPinG6GuKoZWuPV3g,82058
|
|
279
|
+
udata/harvest/tests/csw_dcat/geonetwork-iso-page-3.xml,sha256=sLzItw0Pxl68qn-XB64IqZGHJGcdVPJvCNliYK9GFV4,67901
|
|
280
|
+
udata/harvest/tests/csw_dcat/geonetwork-iso-page-5.xml,sha256=uzCyMx0HsoVJhTFvh8hyFxWDdOUuiRzPYiDXv_zVmfY,81713
|
|
277
281
|
udata/harvest/tests/csw_dcat/geonetworkv4-page-1.xml,sha256=k2pKidlQvJpoltGFm9HNh6KHai7nrPcpinDSQS4dGkQ,17040
|
|
278
282
|
udata/harvest/tests/csw_dcat/geonetworkv4-page-3.xml,sha256=fsN0E4TVd_ts-sYA612yBP-gRAwpyQWqJdNm7ohczbs,20945
|
|
279
283
|
udata/harvest/tests/csw_dcat/geonetworkv4-page-5.xml,sha256=0VmPp1kspik7YAmOFyr-3yJLzWGA6kuQp_x_w-W385o,21213
|
|
@@ -660,9 +664,9 @@ udata/translations/pt/LC_MESSAGES/udata.mo,sha256=zCVMB-a4-mLM1jNyYMk58rgVRaVIwQ
|
|
|
660
664
|
udata/translations/pt/LC_MESSAGES/udata.po,sha256=avfWczvlLBKSohyB55-4TLmUGMU_Rze4XmAo4OTk2v0,43513
|
|
661
665
|
udata/translations/sr/LC_MESSAGES/udata.mo,sha256=ScuqdpaV4y1ZIpBAEfxeaKdzkyGZL0mJmKMoG6w0iRQ,28553
|
|
662
666
|
udata/translations/sr/LC_MESSAGES/udata.po,sha256=QpgEXh1eHjztPa7oNLXd_sds1DC95A-STTtZyTE4m-E,50093
|
|
663
|
-
udata-7.0.6.
|
|
664
|
-
udata-7.0.6.
|
|
665
|
-
udata-7.0.6.
|
|
666
|
-
udata-7.0.6.
|
|
667
|
-
udata-7.0.6.
|
|
668
|
-
udata-7.0.6.
|
|
667
|
+
udata-7.0.6.dev28300.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
|
|
668
|
+
udata-7.0.6.dev28300.dist-info/METADATA,sha256=kN_pLEvZ8kkXbSlaOlSjWupU6AMUYiXpVygQD3wVZqw,119999
|
|
669
|
+
udata-7.0.6.dev28300.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
|
|
670
|
+
udata-7.0.6.dev28300.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
|
|
671
|
+
udata-7.0.6.dev28300.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
|
|
672
|
+
udata-7.0.6.dev28300.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|