udata 10.0.8.dev33678__py2.py3-none-any.whl → 10.0.8.dev33725__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.

@@ -181,3 +181,24 @@ def dataservice_to_rdf(dataservice: Dataservice, graph=None):
181
181
  d.set(DCAT.contactPoint, contact_point)
182
182
 
183
183
  return d
184
+
185
+
186
+ def dataservice_as_distribution_to_rdf(
187
+ dataservice: Dataservice, graph: Graph = None, is_hvd: bool = True
188
+ ):
189
+ """
190
+ Create a blank distribution pointing towards a dataservice with DCAT.accessService property
191
+ """
192
+ id = BNode()
193
+ distribution = graph.resource(id)
194
+ distribution.set(RDF.type, DCAT.Distribution)
195
+ distribution.add(DCT.title, Literal(dataservice.title))
196
+ distribution.add(DCAT.accessURL, URIRef(dataservice.base_api_url))
197
+
198
+ if is_hvd:
199
+ # DCAT-AP HVD applicable legislation is also expected at the distribution level
200
+ distribution.add(DCATAP.applicableLegislation, URIRef(HVD_LEGISLATION))
201
+
202
+ distribution.add(DCAT.accessService, dataservice_to_rdf(dataservice, graph))
203
+
204
+ return distribution
udata/core/dataset/rdf.py CHANGED
@@ -340,6 +340,20 @@ def dataset_to_rdf(dataset: Dataset, graph: Optional[Graph] = None) -> RdfResour
340
340
  for resource in dataset.resources:
341
341
  d.add(DCAT.distribution, resource_to_rdf(resource, dataset, graph, is_hvd))
342
342
 
343
+ if is_hvd:
344
+ from udata.core.dataservices.models import Dataservice
345
+ from udata.core.dataservices.rdf import dataservice_as_distribution_to_rdf
346
+
347
+ # Add a blank distribution pointing to a DataService using the distribution DCAT.accessService.
348
+ # Useful for HVD reporting since DataService are not currently harvested by
349
+ # data.europa.eu as first class entities.
350
+ # Should be removed once supported by data.europa.eu harvesting.
351
+ for service in Dataservice.objects.filter(datasets=dataset, tags="hvd"):
352
+ d.add(
353
+ DCAT.distribution,
354
+ dataservice_as_distribution_to_rdf(service, graph),
355
+ )
356
+
343
357
  if dataset.temporal_coverage:
344
358
  d.set(DCT.temporal, temporal_to_rdf(dataset.temporal_coverage, graph))
345
359
 
@@ -9,6 +9,7 @@ from rdflib.namespace import FOAF, RDF
9
9
  from rdflib.resource import Resource as RdfResource
10
10
 
11
11
  from udata.core.contact_point.factories import ContactPointFactory
12
+ from udata.core.dataservices.factories import DataserviceFactory
12
13
  from udata.core.dataset.factories import DatasetFactory, LicenseFactory, ResourceFactory
13
14
  from udata.core.dataset.models import (
14
15
  Checksum,
@@ -46,6 +47,7 @@ from udata.rdf import (
46
47
  primary_topic_identifier_from_rdf,
47
48
  )
48
49
  from udata.tests.helpers import assert200, assert_redirects
50
+ from udata.uris import endpoint_for
49
51
  from udata.utils import faker
50
52
 
51
53
  pytestmark = pytest.mark.usefixtures("app")
@@ -277,6 +279,38 @@ class DatasetToRdfTest:
277
279
  for distrib in d.objects(DCAT.distribution):
278
280
  assert distrib.value(DCATAP.applicableLegislation).identifier == URIRef(HVD_LEGISLATION)
279
281
 
282
+ def test_dataset_with_dataservice_as_distribution(self):
283
+ """
284
+ Test that a dataset tagged hvd served by an hvd dataservice has an additional distribution
285
+ with a DCAT.accessService and appropriate DCAT-AP HVD properties
286
+ """
287
+ dataset = DatasetFactory(
288
+ resources=ResourceFactory.build_batch(3), tags=["hvd", "mobilite", "test"]
289
+ )
290
+ dataservice = DataserviceFactory(datasets=[dataset], tags=["hvd"])
291
+ d = dataset_to_rdf(dataset)
292
+ g = d.graph
293
+
294
+ len(list(g.subjects(RDF.type, DCAT.Distribution))) == 4
295
+ len(list(g.subjects(RDF.type, DCAT.DataService))) == 1
296
+ dataservice_as_distribution = g.resource(next(g.subjects(DCAT.accessService)))
297
+ dataservice_uri = URIRef(
298
+ endpoint_for(
299
+ "dataservices.show_redirect",
300
+ "api.dataservice",
301
+ dataservice=dataservice.id,
302
+ _external=True,
303
+ )
304
+ )
305
+ assert dataservice_as_distribution.value(DCAT.accessURL).identifier == URIRef(
306
+ dataservice.base_api_url
307
+ )
308
+ assert dataservice_as_distribution.value(DCT.title) == Literal(dataservice.title)
309
+ assert dataservice_as_distribution.value(DCATAP.applicableLegislation).identifier == URIRef(
310
+ HVD_LEGISLATION
311
+ )
312
+ assert dataservice_as_distribution.value(DCAT.accessService).identifier == dataservice_uri
313
+
280
314
 
281
315
  @pytest.mark.usefixtures("clean_db")
282
316
  class RdfToDatasetTest:
@@ -1,15 +1,15 @@
1
1
  # English translations for udata.
2
- # Copyright (C) 2024 Open Data Team
2
+ # Copyright (C) 2025 Open Data Team
3
3
  # This file is distributed under the same license as the udata project.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
5
5
  #
6
6
  #, fuzzy
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: udata 10.0.5.dev0\n"
9
+ "Project-Id-Version: udata 10.0.8.dev0\n"
10
10
  "Report-Msgid-Bugs-To: i18n@opendata.team\n"
11
- "POT-Creation-Date: 2024-12-04 10:03+0100\n"
12
- "PO-Revision-Date: 2024-12-04 10:03+0100\n"
11
+ "POT-Creation-Date: 2025-01-31 10:00+0100\n"
12
+ "PO-Revision-Date: 2025-01-31 10:00+0100\n"
13
13
  "Last-Translator: Open Data Team <i18n@opendata.team>\n"
14
14
  "Language: en\n"
15
15
  "Language-Team: Open Data Team <i18n@opendata.team>\n"
@@ -19,31 +19,31 @@ msgstr ""
19
19
  "Content-Transfer-Encoding: 8bit\n"
20
20
  "Generated-By: Babel 2.12.1\n"
21
21
 
22
- #: udata/settings.py:101
22
+ #: udata/settings.py:109
23
23
  msgid "Welcome"
24
24
  msgstr ""
25
25
 
26
- #: udata/settings.py:102
26
+ #: udata/settings.py:110
27
27
  msgid "Please confirm your email"
28
28
  msgstr ""
29
29
 
30
- #: udata/settings.py:103
30
+ #: udata/settings.py:111
31
31
  msgid "Login instructions"
32
32
  msgstr ""
33
33
 
34
- #: udata/settings.py:104
34
+ #: udata/settings.py:112
35
35
  msgid "Your password has been reset"
36
36
  msgstr ""
37
37
 
38
- #: udata/settings.py:105
38
+ #: udata/settings.py:113
39
39
  msgid "Your password has been changed"
40
40
  msgstr ""
41
41
 
42
- #: udata/settings.py:106
42
+ #: udata/settings.py:114
43
43
  msgid "Password reset instructions"
44
44
  msgstr ""
45
45
 
46
- #: udata/settings.py:496
46
+ #: udata/settings.py:504
47
47
  msgid "This dataset has been archived"
48
48
  msgstr ""
49
49
 
@@ -51,7 +51,7 @@ msgstr ""
51
51
  msgid "Invalid URL \"{url}\": {reason}"
52
52
  msgstr ""
53
53
 
54
- #: udata/tests/api/test_datasets_api.py:875 udata/tests/test_model.py:367
54
+ #: udata/tests/api/test_datasets_api.py:892 udata/tests/test_model.py:367
55
55
  #: udata/uris.py:55
56
56
  msgid "Invalid URL \"{url}\""
57
57
  msgstr ""
@@ -205,16 +205,16 @@ msgstr ""
205
205
  msgid "Your udata instance is ready!"
206
206
  msgstr ""
207
207
 
208
- #: udata/core/owned.py:53 udata/forms/fields.py:735
208
+ #: udata/core/owned.py:58 udata/forms/fields.py:745
209
209
  #: udata/tests/api/test_dataservices_api.py:437
210
210
  msgid "You can only set yourself as owner"
211
211
  msgstr ""
212
212
 
213
- #: udata/core/owned.py:62
213
+ #: udata/core/owned.py:67
214
214
  msgid "Unknown organization"
215
215
  msgstr ""
216
216
 
217
- #: udata/core/owned.py:66 udata/forms/fields.py:756
217
+ #: udata/core/owned.py:71 udata/forms/fields.py:776
218
218
  #: udata/tests/api/test_dataservices_api.py:451
219
219
  msgid "Permission denied for this organization"
220
220
  msgstr ""
@@ -260,12 +260,12 @@ msgstr ""
260
260
  msgid "dataservice"
261
261
  msgstr ""
262
262
 
263
- #: udata/core/dataservices/models.py:174 udata/core/dataset/models.py:569
263
+ #: udata/core/dataservices/models.py:172 udata/core/dataset/models.py:569
264
264
  #: udata/mongo/datetime_fields.py:60
265
265
  msgid "Creation date"
266
266
  msgstr ""
267
267
 
268
- #: udata/core/dataservices/models.py:180 udata/core/dataset/models.py:572
268
+ #: udata/core/dataservices/models.py:178 udata/core/dataset/models.py:572
269
269
  #: udata/mongo/datetime_fields.py:66
270
270
  msgid "Last modification date"
271
271
  msgstr ""
@@ -488,7 +488,7 @@ msgstr ""
488
488
  msgid "Related dataset"
489
489
  msgstr ""
490
490
 
491
- #: udata/core/dataset/forms.py:134 udata/tests/api/test_datasets_api.py:787
491
+ #: udata/core/dataset/forms.py:134 udata/tests/api/test_datasets_api.py:804
492
492
  msgid "Wrong contact point id or contact point ownership mismatch"
493
493
  msgstr ""
494
494
 
@@ -562,20 +562,20 @@ msgstr ""
562
562
  msgid "A schema must contains a name or an URL when a version is provided."
563
563
  msgstr ""
564
564
 
565
- #: udata/core/dataset/models.py:167 udata/tests/api/test_datasets_api.py:883
566
- #: udata/tests/api/test_datasets_api.py:894
565
+ #: udata/core/dataset/models.py:167 udata/tests/api/test_datasets_api.py:900
566
+ #: udata/tests/api/test_datasets_api.py:911
567
567
  msgid "Schema name \"{schema}\" is not an allowed value. Allowed values: {values}"
568
568
  msgstr ""
569
569
 
570
- #: udata/core/dataset/models.py:186 udata/tests/api/test_datasets_api.py:905
570
+ #: udata/core/dataset/models.py:186 udata/tests/api/test_datasets_api.py:922
571
571
  msgid ""
572
572
  "Version \"{version}\" is not an allowed value for the schema \"{name}\". "
573
573
  "Allowed versions: {values}"
574
574
  msgstr ""
575
575
 
576
- #: udata/core/dataset/models.py:463 udata/core/dataset/rdf.py:546
577
- #: udata/tests/dataset/test_dataset_rdf.py:584
578
- #: udata/tests/dataset/test_dataset_rdf.py:597
576
+ #: udata/core/dataset/models.py:463 udata/core/dataset/rdf.py:594
577
+ #: udata/tests/dataset/test_dataset_rdf.py:629
578
+ #: udata/tests/dataset/test_dataset_rdf.py:642
579
579
  msgid "Nameless resource"
580
580
  msgstr ""
581
581
 
@@ -587,11 +587,11 @@ msgstr ""
587
587
  msgid "dataset"
588
588
  msgstr ""
589
589
 
590
- #: udata/core/dataset/rdf.py:544 udata/tests/dataset/test_dataset_rdf.py:571
590
+ #: udata/core/dataset/rdf.py:592 udata/tests/dataset/test_dataset_rdf.py:616
591
591
  msgid "{format} resource"
592
592
  msgstr ""
593
593
 
594
- #: udata/core/dataset/tasks.py:108
594
+ #: udata/core/dataset/tasks.py:113
595
595
  msgid "You need to update some frequency-based datasets"
596
596
  msgstr ""
597
597
 
@@ -815,7 +815,7 @@ msgstr ""
815
815
  msgid "Specify your body type (HTML or markdown)"
816
816
  msgstr ""
817
817
 
818
- #: udata/core/post/models.py:49
818
+ #: udata/core/post/models.py:54
819
819
  msgid "post"
820
820
  msgstr ""
821
821
 
@@ -883,7 +883,7 @@ msgstr ""
883
883
  msgid "Connected device"
884
884
  msgstr ""
885
885
 
886
- #: udata/core/reuse/constants.py:15 udata/tests/reuse/test_reuse_model.py:106
886
+ #: udata/core/reuse/constants.py:15 udata/tests/reuse/test_reuse_model.py:108
887
887
  msgid "Health"
888
888
  msgstr ""
889
889
 
@@ -1162,7 +1162,11 @@ msgstr ""
1162
1162
  msgid "Unable to parse date range"
1163
1163
  msgstr ""
1164
1164
 
1165
- #: udata/forms/fields.py:733 udata/forms/fields.py:754
1165
+ #: udata/forms/fields.py:738 udata/forms/fields.py:769
1166
+ msgid "Cannot change owner after creation. Please use transfer feature."
1167
+ msgstr ""
1168
+
1169
+ #: udata/forms/fields.py:743 udata/forms/fields.py:774
1166
1170
  msgid "You must be authenticated"
1167
1171
  msgstr ""
1168
1172
 
@@ -1643,4 +1647,3 @@ msgstr ""
1643
1647
  #: udata/tests/search/test_adapter.py:33
1644
1648
  msgid "Heavily reused"
1645
1649
  msgstr ""
1646
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: udata
3
- Version: 10.0.8.dev33678
3
+ Version: 10.0.8.dev33725
4
4
  Summary: Open data portal
5
5
  Home-page: https://github.com/opendatateam/udata
6
6
  Author: Opendata Team
@@ -146,6 +146,7 @@ It is collectively taken care of by members of the
146
146
  - Resource catalog: fix preview_url and add extras [#3188](https://github.com/opendatateam/udata/pull/3188)
147
147
  - Add trailing slash to security routes [#3251](https://github.com/opendatateam/udata/pull/3251)
148
148
  - Upgrade packaging dependency to 24.2 [#3252](https://github.com/opendatateam/udata/pull/3252)
149
+ - Expose HVD dataservice as inline distribution [#3256](https://github.com/opendatateam/udata/pull/3256)
149
150
 
150
151
  ## 10.0.7 (2025-01-13)
151
152
 
@@ -86,7 +86,7 @@ udata/core/dataservices/csv.py,sha256=pL3j8-_KZWJaX1xFyILXt9wBtXn9Cmov5FUQgd0lNh
86
86
  udata/core/dataservices/factories.py,sha256=LDk8vvG0zhW8J-ZX5LoJQDU13pqeIyjQ05muuMro_eA,876
87
87
  udata/core/dataservices/models.py,sha256=aOGgCfFnWo2hjvPZIy8juNeydymkNDAQmf7IehW_oOA,9478
88
88
  udata/core/dataservices/permissions.py,sha256=98zM_R4v2ZtRubflB7ajaVQz-DVc-pZBMgtKUYy34oI,169
89
- udata/core/dataservices/rdf.py,sha256=mYJc7qH2f8nb9k-mF-A1sIP9rwgUyfQn4RIAO9sxtOE,6735
89
+ udata/core/dataservices/rdf.py,sha256=pb9ytRk31IZb9Ys6tmJMfvwQ0mBt7KXSSyEOtJkmiyA,7490
90
90
  udata/core/dataservices/search.py,sha256=htjh3sq3tDuD2qwgRgZsW6ClrHLF6hMwYO4nfBO0Hr4,4171
91
91
  udata/core/dataservices/tasks.py,sha256=d2tG1l6u8-eUKUYBOgnCsQLbLmLgJXU-DOzZWhhL6Qg,897
92
92
  udata/core/dataset/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -105,7 +105,7 @@ udata/core/dataset/forms.py,sha256=H2oeAD8XckMugnwUcyuKv7o1Xq1rEIlLz9FtxujqbIE,6
105
105
  udata/core/dataset/models.py,sha256=MVNWoRdXYnZjxvuxZgEw8FAvlZhPDfqih53UUoN6uK4,37710
106
106
  udata/core/dataset/permissions.py,sha256=zXQ6kU-Ni3Pl5tDtat-ZPupug9InsNeCN7xRLc2Vcrc,1097
107
107
  udata/core/dataset/preview.py,sha256=IwCqiNTjjXbtA_SSKF52pwnzKKEz0GyYM95QNn2Dkog,2561
108
- udata/core/dataset/rdf.py,sha256=McINqqUaqGTCTQlWpgd09HD-hdemOnPWXocG83qsIOc,29448
108
+ udata/core/dataset/rdf.py,sha256=bL88yYXKEmzzKegp84nmnw-hdDE71IoMPvFuO_s-r9g,30139
109
109
  udata/core/dataset/search.py,sha256=E7LqHBnq3sMefvmLwTpiw-Ovem2a3NJswHesRjctboE,5627
110
110
  udata/core/dataset/signals.py,sha256=WN4sV-lJlNsRkhcnhoy0SYJvCoYmK_5QFYZd1u-h4gs,161
111
111
  udata/core/dataset/tasks.py,sha256=jG6U7cwGywhLK-MqUrvbZ1WLl_NLApiThtxmsckGzP8,10009
@@ -644,7 +644,7 @@ udata/tests/dataset/test_dataset_actions.py,sha256=bgDjVYjOvu3sX_FCTCzf2snZYSprs
644
644
  udata/tests/dataset/test_dataset_commands.py,sha256=zMPJG2wYwKBee2zI65kmboxf59Zqa84DDjT8V5wj9uo,801
645
645
  udata/tests/dataset/test_dataset_events.py,sha256=hlrpoOiBbnX_COUI9Pzdqlp45GZZDqu5piwupbnPiTI,3601
646
646
  udata/tests/dataset/test_dataset_model.py,sha256=VPF17L5sMpKcFo7JNKmgXnKGAgzy1Ejo470avn3bdcQ,30874
647
- udata/tests/dataset/test_dataset_rdf.py,sha256=9G3pWR-dLPGawnczoBkCY6yQ5DdZBW6JWSJ6JzFVuP8,37194
647
+ udata/tests/dataset/test_dataset_rdf.py,sha256=ULefCxiAp8UwVI5D3lVs6ikTHvrLC-mmw85KVbCMl0E,38733
648
648
  udata/tests/dataset/test_dataset_tasks.py,sha256=n1W2Pg0ez02d66zQG3N93kh7dpR2yLMRDqUI6PnPaI0,3088
649
649
  udata/tests/dataset/test_resource_preview.py,sha256=fp9mSL7unhyM66GR0gwhgX3OGQ4TJt7G9xU-CjsL3HI,3908
650
650
  udata/tests/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -695,7 +695,7 @@ udata/tests/workers/test_jobs_commands.py,sha256=TAfJUUPBSkwtFHZpIa6k9n-o_SUni7q
695
695
  udata/tests/workers/test_tasks_routing.py,sha256=m7Zu9X7GW3oKkSDcHM-dC20Vba3Fruui44bMBVU1dcc,2228
696
696
  udata/tests/workers/test_workers_api.py,sha256=x8EkULR9G5TKl5WwjdVwfFEttbudpiWIYN2umETrCzY,8805
697
697
  udata/tests/workers/test_workers_helpers.py,sha256=_983ChRxas3gsjykaEpXWQUbk2qTMJgeFZpIAHTuhLk,647
698
- udata/translations/udata.pot,sha256=HYlgKz6EoUdapTQf8-0HjDRn347pBKaa7ZAsb9T9DOo,37095
698
+ udata/translations/udata.pot,sha256=d5x2mS62S6CEt8MIHhyiifsHTnDqg7MO-ud1Cs4Zbik,37233
699
699
  udata/translations/ar/LC_MESSAGES/udata.mo,sha256=4YxfMRxhw9dCzq6GziJ0mtSQCrTVZQgkPjYKWk2a9JA,12512
700
700
  udata/translations/ar/LC_MESSAGES/udata.po,sha256=gvS1W9ujdsIuTe0dPeGivJsityiJZjPsdEo--3nPIIA,42419
701
701
  udata/translations/de/LC_MESSAGES/udata.mo,sha256=SX1D8DORwfKZrPpasq5VKeukjTldXmcjoVq6OoofnJo,15936
@@ -710,9 +710,9 @@ udata/translations/pt/LC_MESSAGES/udata.mo,sha256=18Y5YtzVKInDejw-R-45HNzsB3OVwJ
710
710
  udata/translations/pt/LC_MESSAGES/udata.po,sha256=6IQvFk0NTDV5Jq-kLkkzpioWfrMaLDa1oQSevKFbxKQ,44943
711
711
  udata/translations/sr/LC_MESSAGES/udata.mo,sha256=O4zKHNkiX-2GUfLLa0kwbxIA5M1jxiqkHzaMh1t2wKs,29169
712
712
  udata/translations/sr/LC_MESSAGES/udata.po,sha256=W9C447pW0O-Q28ji8wGLgPNrnqlPYXaMD0AOWJPcpZc,51918
713
- udata-10.0.8.dev33678.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
714
- udata-10.0.8.dev33678.dist-info/METADATA,sha256=x4Y0ALzcZYdtW1eP2rY4cRRzgZRhE2wPARfbPiYfyjk,139627
715
- udata-10.0.8.dev33678.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
716
- udata-10.0.8.dev33678.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
717
- udata-10.0.8.dev33678.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
718
- udata-10.0.8.dev33678.dist-info/RECORD,,
713
+ udata-10.0.8.dev33725.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
714
+ udata-10.0.8.dev33725.dist-info/METADATA,sha256=WSXhSFEindqLfaA_Wohe3sEoAFFWjF5VJ8CgpKN9250,139732
715
+ udata-10.0.8.dev33725.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
716
+ udata-10.0.8.dev33725.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
717
+ udata-10.0.8.dev33725.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
718
+ udata-10.0.8.dev33725.dist-info/RECORD,,