diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1dffeb98..88d8deaa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,7 @@ jobs: runs-on: ubuntu-latest container: image: ${{ matrix.ckan-image }} + options: --user root services: solr: image: ckan/ckan-solr:${{ matrix.ckan-version }}-solr9 diff --git a/ckanext/dcat/profiles/base.py b/ckanext/dcat/profiles/base.py index 5cf15c55..efb30d29 100644 --- a/ckanext/dcat/profiles/base.py +++ b/ckanext/dcat/profiles/base.py @@ -433,9 +433,6 @@ def _time_interval(self, subject, predicate, dcat_ap_version=1): It checks for time intervals defined with DCAT, W3C Time hasBeginning & hasEnd and schema.org startDate & endDate. - Note that partial dates will be expanded to the first month / day - value, eg '1904' -> '1904-01-01'. - Returns a tuple with the start and end date values, both of which can be None if not found """ diff --git a/ckanext/dcat/tests/profiles/base/test_base_profile.py b/ckanext/dcat/tests/profiles/base/test_base_profile.py index aa8daf1e..f7b6da9f 100644 --- a/ckanext/dcat/tests/profiles/base/test_base_profile.py +++ b/ckanext/dcat/tests/profiles/base/test_base_profile.py @@ -510,7 +510,7 @@ def test_time_interval_w3c_time_inXSDDateTime(self): - 1904 + 1904 @@ -532,7 +532,7 @@ def test_time_interval_w3c_time_inXSDDateTime(self): start, end = p._time_interval(URIRef('http://example.org'), DCT.temporal) - assert start == '1904-01-01' + assert start == '1904' assert end == '2014-03-22' def test_time_interval_w3c_time_inXSDDateTimeStamp(self): @@ -548,7 +548,7 @@ def test_time_interval_w3c_time_inXSDDateTimeStamp(self): - 1904 + 1904 @@ -570,7 +570,7 @@ def test_time_interval_w3c_time_inXSDDateTimeStamp(self): start, end = p._time_interval(URIRef('http://example.org'), DCT.temporal) - assert start == '1904-01-01' + assert start == '1904' assert end == '2014-03-22' def test_time_interval_w3c_time_inXSDDate(self): @@ -586,7 +586,7 @@ def test_time_interval_w3c_time_inXSDDate(self): - 1904 + 1904 @@ -608,7 +608,7 @@ def test_time_interval_w3c_time_inXSDDate(self): start, end = p._time_interval(URIRef('http://example.org'), DCT.temporal) - assert start == '1904-01-01' + assert start == '1904' assert end == '2014-03-22' def test_time_interval_multiple_w3c_time(self): @@ -627,9 +627,9 @@ def test_time_interval_multiple_w3c_time(self): - 2005 - 1904 - 1974 + 2005 + 1904 + 1974 @@ -653,7 +653,7 @@ def test_time_interval_multiple_w3c_time(self): start, end = p._time_interval(URIRef('http://example.org'), DCT.temporal) - assert start == '1904-01-01' + assert start == '1904' assert end == '2014-03-22' def test_time_interval_dcat(self): @@ -706,7 +706,7 @@ def test_time_interval_all_dcat_ap_2_dcat_found(self): - 1904 + 1904 @@ -763,7 +763,7 @@ def test_time_interval_all_dcat_ap_1_schema_org_found(self): - 1904 + 1904 @@ -827,7 +827,7 @@ def test_time_interval_all_dcat_ap_2_w3c_time_found(self): - 1904 + 1904 @@ -849,7 +849,7 @@ def test_time_interval_all_dcat_ap_2_w3c_time_found(self): start, end = p._time_interval(URIRef('http://example.org'), DCT.temporal, dcat_ap_version=2) - assert start == '1904-01-01' + assert start == '1904' assert end == '2014-03-22' def test_publisher_foaf(self): diff --git a/requirements.txt b/requirements.txt index 28bad239..0eb6dabe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -rdflib>=6.1.1,<7.1.0 +rdflib>=6.1.1,<7.2.0 geomet>=0.2.0 ckantoolkit>=0.0.7 future>=0.18.2