udata 10.0.8.dev33678__py2.py3-none-any.whl → 10.0.8.dev33704__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 (25) hide show
  1. udata/core/dataservices/rdf.py +21 -0
  2. udata/core/dataset/rdf.py +14 -0
  3. udata/static/chunks/{10.8ca60413647062717b1e.js → 10.471164b2a9fe15614797.js} +3 -3
  4. udata/static/chunks/{10.8ca60413647062717b1e.js.map → 10.471164b2a9fe15614797.js.map} +1 -1
  5. udata/static/chunks/{11.b6f741fcc366abfad9c4.js → 11.83535504cd650ea08f65.js} +3 -3
  6. udata/static/chunks/{11.b6f741fcc366abfad9c4.js.map → 11.83535504cd650ea08f65.js.map} +1 -1
  7. udata/static/chunks/{13.2d06442dd9a05d9777b5.js → 13.d9c1735d14038b94c17e.js} +2 -2
  8. udata/static/chunks/{13.2d06442dd9a05d9777b5.js.map → 13.d9c1735d14038b94c17e.js.map} +1 -1
  9. udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js → 17.81c57c0dedf812e43013.js} +2 -2
  10. udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js.map → 17.81c57c0dedf812e43013.js.map} +1 -1
  11. udata/static/chunks/{19.f03a102365af4315f9db.js → 19.df16abde17a42033a7f8.js} +3 -3
  12. udata/static/chunks/{19.f03a102365af4315f9db.js.map → 19.df16abde17a42033a7f8.js.map} +1 -1
  13. udata/static/chunks/{8.778091d55cd8ea39af6b.js → 8.462bb3029de008497675.js} +2 -2
  14. udata/static/chunks/{8.778091d55cd8ea39af6b.js.map → 8.462bb3029de008497675.js.map} +1 -1
  15. udata/static/chunks/{9.033d7e190ca9e226a5d0.js → 9.07515e5187f475bce828.js} +3 -3
  16. udata/static/chunks/{9.033d7e190ca9e226a5d0.js.map → 9.07515e5187f475bce828.js.map} +1 -1
  17. udata/static/common.js +1 -1
  18. udata/static/common.js.map +1 -1
  19. udata/tests/dataset/test_dataset_rdf.py +34 -0
  20. {udata-10.0.8.dev33678.dist-info → udata-10.0.8.dev33704.dist-info}/METADATA +2 -1
  21. {udata-10.0.8.dev33678.dist-info → udata-10.0.8.dev33704.dist-info}/RECORD +25 -25
  22. {udata-10.0.8.dev33678.dist-info → udata-10.0.8.dev33704.dist-info}/LICENSE +0 -0
  23. {udata-10.0.8.dev33678.dist-info → udata-10.0.8.dev33704.dist-info}/WHEEL +0 -0
  24. {udata-10.0.8.dev33678.dist-info → udata-10.0.8.dev33704.dist-info}/entry_points.txt +0 -0
  25. {udata-10.0.8.dev33678.dist-info → udata-10.0.8.dev33704.dist-info}/top_level.txt +0 -0
@@ -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