Skip to content

Commit

Permalink
Merge pull request #41 from OpenGov-OpenData/jguo144/2024-07-12/merge…
Browse files Browse the repository at this point in the history
…-upstream

Merge upstream changes
  • Loading branch information
peterVorman authored Sep 3, 2024
2 parents f5b59a7 + 932e24b commit 78b4bcf
Show file tree
Hide file tree
Showing 80 changed files with 8,000 additions and 2,544 deletions.
65 changes: 29 additions & 36 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: Tests
env:
COLUMNS: 120
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.9'
- name: Install requirements
run: pip install flake8 pycodestyle
- name: Check syntax
Expand All @@ -16,16 +18,22 @@ jobs:
test:
strategy:
matrix:
ckan-version: ["2.10", 2.9, 2.8, 2.7]
include:
- ckan-version: "2.11"
ckan-image: "ckan/ckan-dev:2.11-py3.10"
- ckan-version: "2.10"
ckan-image: "ckan/ckan-dev:2.10-py3.10"
- ckan-version: "2.9"
ckan-image: "ckan/ckan-dev:2.9-py3.9"
fail-fast: false

name: CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-20.04
container:
image: openknowledge/ckan-dev:${{ matrix.ckan-version }}
image: ${{ matrix.ckan-image }}
services:
solr:
image: ckan/ckan-solr:${{ matrix.ckan-version }}
image: ckan/ckan-solr:${{ matrix.ckan-version }}-solr9
postgres:
image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }}
env:
Expand All @@ -43,43 +51,28 @@ jobs:
CKAN_REDIS_URL: redis://redis:6379/1

steps:
- uses: actions/checkout@v3
- name: Install requirements (Python 3)
if: ${{ matrix.ckan-version != '2.7' && matrix.ckan-version != '2.8' && matrix.ckan-version != '2.9-py2'}}
- uses: actions/checkout@v4
- name: Install requirements (common)
run: |
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: Install requirements (Python 2)
if: ${{ matrix.ckan-version == '2.7' || matrix.ckan-version == '2.8' || matrix.ckan-version == '2.9-py2'}}
run: |
pip install -r requirements-py2.txt
pip install -r dev-requirements-py2.txt
- name: Install requirements (common)
run: |
pip install -e .
# Replace default path to CKAN core config file with the one on the container
sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini
- name: Setup extension (CKAN >= 2.9)
if: ${{ matrix.ckan-version != '2.7' && matrix.ckan-version != '2.8' }}
- name: Install requirements (2.9)
run: |
# Install ckanext-harvest
git clone https://github.com/OpenGov-OpenData/ckanext-harvest.git
pip install -e ckanext-harvest
pip install -r ckanext-harvest/pip-requirements.txt
ckan -c test.ini db init
ckan -c test.ini harvester initdb
- name: Setup extension (CKAN < 2.9)
if: ${{ matrix.ckan-version == '2.7' || matrix.ckan-version == '2.8' }}
pip install -U pytest-rerunfailures
if: ${{ matrix.ckan-version == '2.9' }}
- name: Setup other extensions
run: |
# Install ckanext-harvest version that supports 2.7
git clone https://github.com/OpenGov-OpenData/ckanext-harvest.git
git clone https://github.com/OpenGov-OpenData/ckanext-harvest
pip install -e ckanext-harvest
pip install -r ckanext-harvest/pip-requirements.txt
paster --plugin=ckan db init -c test.ini
paster --plugin=ckanext-harvest harvester initdb -c test.ini
pip install -r ckanext-harvest/requirements.txt
git clone https://github.com/OpenGov-OpenData/ckanext-scheming
pip install -e ckanext-scheming
- name: Setup extension
run: |
ckan -c test.ini db init
ckan -c test.ini db pending-migrations --apply
- name: Run tests
run: pytest --ckan-ini=test.ini --cov=ckanext.dcat --cov-report=xml --cov-append --disable-warnings ckanext/dcat/tests
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
run: pytest --ckan-ini=test.ini --cov=ckanext.dcat --cov-report=term-missing --cov-append --disable-warnings ckanext/dcat/tests
63 changes: 61 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,66 @@
# Changelog


## [Unreleased](https://github.com/ckan/ckanext-dcat/compare/v1.3.0...HEAD)
## [Unreleased](https://github.com/ckan/ckanext-dcat/compare/v1.7.0...HEAD)

* Support for standard CKAN [ckanext-scheming](https://github.com/ckan/ckanext-scheming) schemas.
The DCAT profiles now seamlessly integrate with fields defined via the YAML or JSON scheming files.
Sites willing to migrate to a scheming based metadata schema can do
so by adding the `euro_dcat_ap_scheming` profile at the end of their profile chain (e.g.
`ckanext.dcat.rdf.profiles = euro_dcat_ap_2 euro_dcat_ap_scheming`), which will modify the existing profile
outputs to the expected format by the scheming validators. Sample schemas are provided
in the `ckanext/dcat/schemas` folder. See the [documentation](https://github.com/ckan/ckanext-dcat?tab=readme-ov-file#schemas)
for all details. Some highlights of the new scheming based profiles:

* Actual list support in the API output for list properties like `dct:language`
* Multiple objects now allowed for properties like `dcat:ContactPoint`, `dct:spatial` or `dct:temporal`
* Custom validators for date values that allow `xsd:gYear`, `xsd:gYearMonth`, `xsd:date` and `xsd:dateTime`

(#281)
* [SHACL validation](https://github.com/SEMICeu/DCAT-AP/tree/master/releases/2.1.1) for DCAT-AP 2.1.1 profile (scheming and legacy).
SHACL validation made surface the following issues in the existing profiles, which are now fixed:
* Cast `dcat:byteSize` and `dcat:spatialResolutionInMeters` as Decimal, not float
* Allow only one value of `dcat:spatialResolutionInMeters` and `dcat:temporalResolution`
* Only output the WKT version of geometries in `locn:geometry`, `dcat:bbox` and `dcat:centroid`. Sites that for some reason
require GeoJSON (or both) can use the `ckanext.dcat.output_spatial_format` config option
to choose which format to use
* When using the `euro_dcat_ap_2` profile, don't output temporal extent namespaced
both with `schema` and `dcat`, just with the latter (`dcat:startDate` and `dcat:endDate`)
(#288)
* New `ckan dcat consume` and `ckan dcat produce` CLI commands (#279)
* Parse dcat:spatialResolutionInMeters as float (#285)
* Split profile classes into their own separate files (#282)
* Catch Not Authorized in View (#280)
* CKAN 2.11 support and requirements updates (#270)


## [v1.7.0](https://github.com/ckan/ckanext-dcat/compare/v1.6.0...v1.7.0) - 2024-04-04

* Adds support for the latest Hydra vocabulary. For backward compatibility, the old properties are still supported but marked as deprecated. (#267)

## [v1.6.0](https://github.com/ckan/ckanext-dcat/compare/v1.5.1...v1.6.0) - 2024-02-29

* Add support for `DCATAP.applicableLegislation` and `DCATAP.hvdCategory` to the `euro_dcat_ap_2` profile (#262)
* Improve access service tests (#258)
* Fix missing access service items when parsing dataset (#256)

## [v1.5.1](https://github.com/ckan/ckanext-dcat/compare/v1.5.0...v1.5.1) - 2023-06-20

* Fix tests to work with `ckanext-harvest >= 1.5.4`. (#250)
* Add references for dcat:accessService to the `euro_dcat_ap_2` profile (#251)

## [v1.5.0](https://github.com/ckan/ckanext-dcat/compare/v1.4.0...v1.5.0) - 2023-05-02

* Remove support for old CKAN versions prior 2.9 and Python 2 (#244)
* Update hooks to support CKAN 2.10 (#241)
* Fix description for RDF endpoints in README (#246)
* Fix media type for links to the Turtle representation in HTML templates (#242)
* Ignore already deleted packages when deleting (#238)
* Add support for dcat:accessService in dcat:Distribution (#235)

## [v1.4.0](https://github.com/ckan/ckanext-dcat/compare/v1.3.0...v1.4.0) - 2022-12-05

* RDF serialization: Add fallback values for resource dates (#233)
* Add option for fallback distribution license if missing (#231)

## [v1.3.0](https://github.com/ckan/ckanext-dcat/compare/v1.2.0...v1.3.0) - 2022-08-01

Expand Down
Loading

0 comments on commit 78b4bcf

Please sign in to comment.