Skip to content

Commit c8a0028

Browse files
authored
Merge branch 'master' into improved-multilangual
2 parents af6c823 + c375c59 commit c8a0028

4 files changed

Lines changed: 267 additions & 246 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Changelog
22

3-
## [Unreleased](https://github.com/ckan/ckanext-dcat/compare/v2.4.0...HEAD)
3+
## [Unreleased](https://github.com/ckan/ckanext-dcat/compare/v2.4.1...HEAD)
4+
5+
## [v2.4.1](https://github.com/ckan/ckanext-dcat/compare/v2.4.0...v2.4.1) - 2025-09-25
6+
7+
* Fix regression redirect from /dataset to /dataset_series ([#362](https://github.com/ckan/ckanext-dcat/pull/362))
8+
* Provide default language in Croissant JSON-LD context ([#361](https://github.com/ckan/ckanext-dcat/pull/361))
9+
* Added [`IDCATURIGenerator`](https://docs.ckan.org/projects/ckanext-dcat/en/latest/uri-customization/)
10+
plugin interface to allow customization of the URIs generation ([#351](https://github.com/ckan/ckanext-dcat/pull/351))
11+
* Added support for new fields to DCAT classes: `dcat:Dataset` (`prov:wasGeneratedBy`, `prov:qualifiedAttribution`,
12+
`dcat:hasVersion`), `dcat:Catalog` (`foaf:homepage`), `dcat:DataService` (`dct:conformsTo`, `dct:format`,
13+
`dct:identifier`, `dct:language`, `dct:rights`, `dcat:landingPage`, `dcat:keyword`) ([#352](https://github.com/ckan/ckanext-dcat/pull/352))
14+
* Add HealthDCAT-AP mapping to CKAN field mapping table ([#347](https://github.com/ckan/ckanext-dcat/pull/347))
15+
* Docs: Add HealthDCAT-AP mapping to CKAN field mapping table ([#347](https://github.com/ckan/ckanext-dcat/pull/347))
416

517

618
## [v2.4.0](https://github.com/ckan/ckanext-dcat/compare/v2.3.0...v2.4.0) - 2025-05-20

ckanext/dcat/blueprints.py

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
from flask import Blueprint, jsonify, make_response
32

43
import ckantoolkit as toolkit
@@ -12,11 +11,7 @@
1211
config = toolkit.config
1312

1413

15-
dcat = Blueprint(
16-
'dcat',
17-
__name__,
18-
url_defaults={u'package_type': u'dataset'}
19-
)
14+
dcat = Blueprint("dcat", __name__, url_defaults={"package_type": "dataset"})
2015

2116

2217
def read_catalog(_format=None, package_type=None):
@@ -30,36 +25,44 @@ def read_dataset(_id, _format=None, package_type=None):
3025
if endpoints_enabled():
3126

3227
# requirements={'_format': 'xml|rdf|n3|ttl|jsonld'}
33-
dcat.add_url_rule(config.get('ckanext.dcat.catalog_endpoint',
34-
utils.DEFAULT_CATALOG_ENDPOINT).replace(
35-
'{_format}', '<_format>'),
36-
view_func=read_catalog)
28+
dcat.add_url_rule(
29+
config.get(
30+
"ckanext.dcat.catalog_endpoint", utils.DEFAULT_CATALOG_ENDPOINT
31+
).replace("{_format}", "<_format>"),
32+
view_func=read_catalog,
33+
)
3734

3835
# TODO: Generalize for all dataset types
39-
dcat.add_url_rule('/dataset_series/<_id>.<_format>', view_func=read_dataset)
40-
dcat.add_url_rule('/dataset/<_id>.<_format>', view_func=read_dataset)
36+
dcat.add_url_rule(
37+
"/dataset_series/<_id>.<_format>",
38+
view_func=read_dataset,
39+
endpoint="read_dataset_series",
40+
)
41+
dcat.add_url_rule(
42+
"/dataset/<_id>.<_format>", view_func=read_dataset, endpoint="read_dataset"
43+
)
4144

4245

4346
if toolkit.asbool(config.get(utils.ENABLE_CONTENT_NEGOTIATION_CONFIG)):
44-
dcat.add_url_rule('/', view_func=read_catalog)
47+
dcat.add_url_rule("/", view_func=read_catalog)
4548

46-
dcat.add_url_rule('/dataset/new', view_func=CreateView.as_view(str(u'new')))
47-
dcat.add_url_rule('/dataset/<_id>', view_func=read_dataset)
49+
dcat.add_url_rule("/dataset/new", view_func=CreateView.as_view(str("new")))
50+
dcat.add_url_rule("/dataset/<_id>", view_func=read_dataset)
4851

49-
dcat_json_interface = Blueprint('dcat_json_interface', __name__)
52+
dcat_json_interface = Blueprint("dcat_json_interface", __name__)
5053

5154

5255
def dcat_json():
5356
datasets = utils.dcat_json_page()
5457
return jsonify(datasets)
5558

5659

57-
dcat_json_interface.add_url_rule(config.get('ckanext.dcat.json_endpoint',
58-
'/dcat.json'),
59-
view_func=dcat_json)
60+
dcat_json_interface.add_url_rule(
61+
config.get("ckanext.dcat.json_endpoint", "/dcat.json"), view_func=dcat_json
62+
)
6063

6164

62-
croissant = Blueprint('croissant', __name__)
65+
croissant = Blueprint("croissant", __name__)
6366

6467

6568
def read_dataset_croissant(_id):
@@ -72,20 +75,22 @@ def read_dataset_croissant(_id):
7275
)
7376

7477
context = {
75-
'user': user_name,
78+
"user": user_name,
7679
}
77-
data_dict = {'id': _id}
80+
data_dict = {"id": _id}
7881

7982
dataset_dict = toolkit.get_action("package_show")(context, data_dict)
8083
except (toolkit.ObjectNotFound, toolkit.NotAuthorized):
8184
return toolkit.abort(
82-
404,
83-
toolkit._("Dataset not found or you have no permission to view it")
85+
404, toolkit._("Dataset not found or you have no permission to view it")
8486
)
8587

8688
response = make_response(croissant_serialization(dataset_dict))
8789
response.headers["Content-type"] = "application/ld+json"
8890

8991
return response
9092

91-
croissant.add_url_rule('/dataset/<_id>/croissant.jsonld', view_func=read_dataset_croissant)
93+
94+
croissant.add_url_rule(
95+
"/dataset/<_id>/croissant.jsonld", view_func=read_dataset_croissant
96+
)

0 commit comments

Comments
 (0)