udata 9.2.5.dev32222__py2.py3-none-any.whl → 9.2.5.dev32239__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/dataservices/rdf.py +15 -0
- udata/core/dataset/api.py +1 -1
- udata/core/dataset/rdf.py +15 -0
- udata/tests/dataset/test_dataset_rdf.py +4 -0
- {udata-9.2.5.dev32222.dist-info → udata-9.2.5.dev32239.dist-info}/METADATA +2 -1
- {udata-9.2.5.dev32222.dist-info → udata-9.2.5.dev32239.dist-info}/RECORD +10 -10
- {udata-9.2.5.dev32222.dist-info → udata-9.2.5.dev32239.dist-info}/LICENSE +0 -0
- {udata-9.2.5.dev32222.dist-info → udata-9.2.5.dev32239.dist-info}/WHEEL +0 -0
- {udata-9.2.5.dev32222.dist-info → udata-9.2.5.dev32239.dist-info}/entry_points.txt +0 -0
- {udata-9.2.5.dev32222.dist-info → udata-9.2.5.dev32239.dist-info}/top_level.txt +0 -0
udata/core/dataservices/rdf.py
CHANGED
|
@@ -118,6 +118,21 @@ def dataservice_to_rdf(dataservice: Dataservice, graph=None):
|
|
|
118
118
|
if dataservice.base_api_url:
|
|
119
119
|
d.set(DCAT.endpointURL, Literal(dataservice.base_api_url))
|
|
120
120
|
|
|
121
|
+
if dataservice.harvest and dataservice.harvest.remote_url:
|
|
122
|
+
d.set(DCAT.landingPage, URIRef(dataservice.harvest.remote_url))
|
|
123
|
+
elif dataservice.id:
|
|
124
|
+
d.set(
|
|
125
|
+
DCAT.landingPage,
|
|
126
|
+
URIRef(
|
|
127
|
+
endpoint_for(
|
|
128
|
+
"dataservices.show_redirect",
|
|
129
|
+
"api.dataservice",
|
|
130
|
+
dataservice=dataservice.id,
|
|
131
|
+
_external=True,
|
|
132
|
+
)
|
|
133
|
+
),
|
|
134
|
+
)
|
|
135
|
+
|
|
121
136
|
if dataservice.endpoint_description_url:
|
|
122
137
|
d.set(DCAT.endpointDescription, Literal(dataservice.endpoint_description_url))
|
|
123
138
|
|
udata/core/dataset/api.py
CHANGED
|
@@ -430,7 +430,7 @@ class UploadNewDatasetResource(UploadMixin, API):
|
|
|
430
430
|
@api.expect(upload_parser)
|
|
431
431
|
@api.marshal_with(upload_fields, code=201)
|
|
432
432
|
def post(self, dataset):
|
|
433
|
-
"""Upload a new dataset resource"""
|
|
433
|
+
"""Upload a file for a new dataset resource"""
|
|
434
434
|
ResourceEditPermission(dataset).test()
|
|
435
435
|
infos = self.handle_upload(dataset)
|
|
436
436
|
resource = Resource(**infos)
|
udata/core/dataset/rdf.py
CHANGED
|
@@ -214,6 +214,21 @@ def dataset_to_rdf(dataset, graph=None):
|
|
|
214
214
|
d.set(DCT.issued, Literal(dataset.created_at))
|
|
215
215
|
d.set(DCT.modified, Literal(dataset.last_modified))
|
|
216
216
|
|
|
217
|
+
if dataset.harvest and dataset.harvest.remote_url:
|
|
218
|
+
d.set(DCAT.landingPage, URIRef(dataset.harvest.remote_url))
|
|
219
|
+
elif dataset.id:
|
|
220
|
+
d.set(
|
|
221
|
+
DCAT.landingPage,
|
|
222
|
+
URIRef(
|
|
223
|
+
endpoint_for(
|
|
224
|
+
"datasets.show_redirect",
|
|
225
|
+
"api.dataset",
|
|
226
|
+
dataset=dataset.id,
|
|
227
|
+
_external=True,
|
|
228
|
+
)
|
|
229
|
+
),
|
|
230
|
+
)
|
|
231
|
+
|
|
217
232
|
if dataset.acronym:
|
|
218
233
|
d.set(SKOS.altLabel, Literal(dataset.acronym))
|
|
219
234
|
|
|
@@ -81,16 +81,19 @@ class DatasetToRdfTest:
|
|
|
81
81
|
assert d.value(DCT.title) == Literal(dataset.title)
|
|
82
82
|
assert d.value(DCT.issued) == Literal(dataset.created_at)
|
|
83
83
|
assert d.value(DCT.modified) == Literal(dataset.last_modified)
|
|
84
|
+
assert d.value(DCAT.landingPage) is None
|
|
84
85
|
|
|
85
86
|
def test_all_dataset_fields(self):
|
|
86
87
|
resources = ResourceFactory.build_batch(3)
|
|
87
88
|
org = OrganizationFactory(name="organization")
|
|
89
|
+
remote_url = "https://somewhere.org/dataset"
|
|
88
90
|
dataset = DatasetFactory(
|
|
89
91
|
tags=faker.tags(nb=3),
|
|
90
92
|
resources=resources,
|
|
91
93
|
frequency="daily",
|
|
92
94
|
acronym="acro",
|
|
93
95
|
organization=org,
|
|
96
|
+
harvest=HarvestDatasetMetadata(remote_url=remote_url),
|
|
94
97
|
)
|
|
95
98
|
d = dataset_to_rdf(dataset)
|
|
96
99
|
g = d.graph
|
|
@@ -110,6 +113,7 @@ class DatasetToRdfTest:
|
|
|
110
113
|
assert d.value(DCT.issued) == Literal(dataset.created_at)
|
|
111
114
|
assert d.value(DCT.modified) == Literal(dataset.last_modified)
|
|
112
115
|
assert d.value(DCT.accrualPeriodicity).identifier == FREQ.daily
|
|
116
|
+
assert d.value(DCAT.landingPage).identifier == URIRef(remote_url)
|
|
113
117
|
expected_tags = set(Literal(t) for t in dataset.tags)
|
|
114
118
|
assert set(d.objects(DCAT.keyword)) == expected_tags
|
|
115
119
|
assert len(list(d.objects(DCAT.distribution))) == len(resources)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: udata
|
|
3
|
-
Version: 9.2.5.
|
|
3
|
+
Version: 9.2.5.dev32239
|
|
4
4
|
Summary: Open data portal
|
|
5
5
|
Home-page: https://github.com/opendatateam/udata
|
|
6
6
|
Author: Opendata Team
|
|
@@ -149,6 +149,7 @@ It is collectively taken care of by members of the
|
|
|
149
149
|
- Add a "filter by organization badge" for datasets, dataservices, reuses and organizations [#3155](https://github.com/opendatateam/udata/pull/3155]
|
|
150
150
|
- Add dataservices search with search-service [#3171](https://github.com/opendatateam/udata/pull/3171)
|
|
151
151
|
* you will need https://github.com/opendatateam/udata-search-service/pull/48
|
|
152
|
+
- Expose the "landingPage" in DCAT RDF [#3183](https://github.com/opendatateam/udata/pull/3183)
|
|
152
153
|
|
|
153
154
|
## 9.2.4 (2024-10-22)
|
|
154
155
|
|
|
@@ -85,13 +85,13 @@ udata/core/dataservices/apiv2.py,sha256=XIqJq58uLtxtt52iKYo7Fl0ZXv9Sz72uA7JIGwP8
|
|
|
85
85
|
udata/core/dataservices/factories.py,sha256=LDk8vvG0zhW8J-ZX5LoJQDU13pqeIyjQ05muuMro_eA,876
|
|
86
86
|
udata/core/dataservices/models.py,sha256=p9tn-YTrd01WHHke49EMx3msH9Fu49XtdQsII9sAJXE,8488
|
|
87
87
|
udata/core/dataservices/permissions.py,sha256=98zM_R4v2ZtRubflB7ajaVQz-DVc-pZBMgtKUYy34oI,169
|
|
88
|
-
udata/core/dataservices/rdf.py,sha256=
|
|
88
|
+
udata/core/dataservices/rdf.py,sha256=Uld0jKuI6qmbKT9AUVcixaYLqf7xDuMGXbBixuyA1uo,5258
|
|
89
89
|
udata/core/dataservices/search.py,sha256=htjh3sq3tDuD2qwgRgZsW6ClrHLF6hMwYO4nfBO0Hr4,4171
|
|
90
90
|
udata/core/dataservices/tasks.py,sha256=a43x1oKNF-EYmzM3O-8GQPJvZsgJmQiXOZx8Qti3M4E,960
|
|
91
91
|
udata/core/dataset/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
92
92
|
udata/core/dataset/actions.py,sha256=mX6xox0PiMrbcAPZ3VZsI26rfM-ciYfEXxN6sqqImKA,1222
|
|
93
93
|
udata/core/dataset/activities.py,sha256=v8k1jwhdx62Z2ARZq8Q-x86OWSsBK99hRloPl74OCgA,1502
|
|
94
|
-
udata/core/dataset/api.py,sha256=
|
|
94
|
+
udata/core/dataset/api.py,sha256=cfJU-Py0-4rNU5kpbA90htlCMoiYv_-SPczottDCEfs,29787
|
|
95
95
|
udata/core/dataset/api_fields.py,sha256=ZF24FhKYe5jlV8jXG6YR0Hko9WOuV0446FAlLkEgAWE,17295
|
|
96
96
|
udata/core/dataset/apiv2.py,sha256=VTE4eYx5udzOdHDUkD7TYpuCtppZMKp1okTSEE1fcgI,16925
|
|
97
97
|
udata/core/dataset/commands.py,sha256=__hPAk_6iHtgMnEG51ux0vbNWJHxUjXhi1ukH4hF5jY,3714
|
|
@@ -104,7 +104,7 @@ udata/core/dataset/forms.py,sha256=H2oeAD8XckMugnwUcyuKv7o1Xq1rEIlLz9FtxujqbIE,6
|
|
|
104
104
|
udata/core/dataset/models.py,sha256=ax4zO4N04DGUeAEz2Ee2AQo7L4ULjKUSmgpoM4GrCh8,36749
|
|
105
105
|
udata/core/dataset/permissions.py,sha256=zXQ6kU-Ni3Pl5tDtat-ZPupug9InsNeCN7xRLc2Vcrc,1097
|
|
106
106
|
udata/core/dataset/preview.py,sha256=IwCqiNTjjXbtA_SSKF52pwnzKKEz0GyYM95QNn2Dkog,2561
|
|
107
|
-
udata/core/dataset/rdf.py,sha256
|
|
107
|
+
udata/core/dataset/rdf.py,sha256=AExA1E3KAq1soXWtiRsrg0cNAND_wZctBG1y07XVnfk,25739
|
|
108
108
|
udata/core/dataset/search.py,sha256=NXPdBsKeLMeC0tsHSP7xFYilU58xCm4gdU0Yk5XHInM,5607
|
|
109
109
|
udata/core/dataset/signals.py,sha256=WN4sV-lJlNsRkhcnhoy0SYJvCoYmK_5QFYZd1u-h4gs,161
|
|
110
110
|
udata/core/dataset/tasks.py,sha256=F31TDKaawtOx6oxmWh9Vu24m0R4KVMouxFyAbaXVG6E,9609
|
|
@@ -637,7 +637,7 @@ udata/tests/dataset/test_dataset_actions.py,sha256=bgDjVYjOvu3sX_FCTCzf2snZYSprs
|
|
|
637
637
|
udata/tests/dataset/test_dataset_commands.py,sha256=zMPJG2wYwKBee2zI65kmboxf59Zqa84DDjT8V5wj9uo,801
|
|
638
638
|
udata/tests/dataset/test_dataset_events.py,sha256=hlrpoOiBbnX_COUI9Pzdqlp45GZZDqu5piwupbnPiTI,3601
|
|
639
639
|
udata/tests/dataset/test_dataset_model.py,sha256=oaqm7q3DwZa4GLCyv7rj3rvtBIKxdCf4wUQdYo1pOiU,29745
|
|
640
|
-
udata/tests/dataset/test_dataset_rdf.py,sha256=
|
|
640
|
+
udata/tests/dataset/test_dataset_rdf.py,sha256=ApOUVq1Vs1DywFYqfm1fI6lInjjBrVIXjRftSEKO5BE,34318
|
|
641
641
|
udata/tests/dataset/test_dataset_tasks.py,sha256=rSafDjCiOyEb2_tVUDN4wqGylF6Yf9VNB769SLmxlwI,2283
|
|
642
642
|
udata/tests/dataset/test_resource_preview.py,sha256=fp9mSL7unhyM66GR0gwhgX3OGQ4TJt7G9xU-CjsL3HI,3908
|
|
643
643
|
udata/tests/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -703,9 +703,9 @@ udata/translations/pt/LC_MESSAGES/udata.mo,sha256=TpMlhwj07t7CPkzXn-qmHG4aTq6ZT7
|
|
|
703
703
|
udata/translations/pt/LC_MESSAGES/udata.po,sha256=vRqSEt9Jds--Wic-hYMkdjYaWzeHFnUn3wD5XvQL-qE,44877
|
|
704
704
|
udata/translations/sr/LC_MESSAGES/udata.mo,sha256=bc-BmgT91ZJJB9DKc5YDsHqyxBhOjDJdbOy-UPo-NjA,28163
|
|
705
705
|
udata/translations/sr/LC_MESSAGES/udata.po,sha256=BKVmr4M88pfgZMU4sHIyDObV5M9E8ezZ9m7jviy2PE4,51369
|
|
706
|
-
udata-9.2.5.
|
|
707
|
-
udata-9.2.5.
|
|
708
|
-
udata-9.2.5.
|
|
709
|
-
udata-9.2.5.
|
|
710
|
-
udata-9.2.5.
|
|
711
|
-
udata-9.2.5.
|
|
706
|
+
udata-9.2.5.dev32239.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
|
|
707
|
+
udata-9.2.5.dev32239.dist-info/METADATA,sha256=8woHLfzk3iUE7oKjgAqHiV5FLwJJkRrvN-SvxvqqL1Y,133471
|
|
708
|
+
udata-9.2.5.dev32239.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
|
709
|
+
udata-9.2.5.dev32239.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
|
|
710
|
+
udata-9.2.5.dev32239.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
|
|
711
|
+
udata-9.2.5.dev32239.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|