Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VCARD.hasURL property parsing/serialization #324

Merged
merged 13 commits into from
Dec 16, 2024

Conversation

Markus92
Copy link
Contributor

@Markus92 Markus92 commented Dec 4, 2024

As part of our HealthDCAT-AP work we identified a need to add the URL property to dcat:contactPoint. It is defined in the VCARD RDF ontology and meant to link to a contact page for example.

I cherrypicked another small fix in this branch, which is that the foaf:mbox property does not strip the mailto: prefix, which is consistently stripped in the rest of the CKAN DCAT extension. It made a few of our test cases fail, I'll include those with the HealthDCAT-AP PR.

amercader and others added 13 commits November 20, 2024 11:37
After changes in the CKAN Docker images (ckan/ckan-docker-base#80) the
images run in the test workflows does not use root by default anymore.
This is not supported in GitHub Actions so we need to pass `--user root`
option to avoid failures. To catch any permissions related issues, we
run the `ckan` and `pytest` commands with `sudo -u ckan`
Rdflib 7.1 introduced changes in [date parsing][1] that made some base
profile tests fail. Basically the previous rdflib versions incomplete
dates like

    <time:inXSDDateTimeStamp
         rdf:datatype="http://www.w3.org/2001/XMLSchema#date">
            1904
    </time:inXSDDateTimeStamp>

were expanded to `1904-01-01`. Of course this is not a valid date and
should be expressed using `gYear`:

    <time:inXSDDateTimeStamp
         rdf:datatype="http://www.w3.org/2001/XMLSchema#gYear">
            1904
    </time:inXSDDateTimeStamp>

and we should be expecting `1904`.
This should play nice with the time properties we are generating in CKAN as
they already handle automatically `gYear`, `gYearMonth`, `date` and
`dateTime`.
Sites importing external DCAT representations that use the wrong
encoding might need to check their parsers.

[1] RDFLib/rdflib#2929
Copy link
Member

@amercader amercader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the unrelated changed mentioned in the comment this looks good to go, thanks @Markus92

@@ -159,17 +159,12 @@ def _read_datasets_from_db(self, guid):
'''
Returns a database result of datasets matching the given guid.
'''
if toolkit.check_ckan_version(max_version="2.11"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was probably changed by mistake

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, when I revert this setting, the pipeline fails. Please refer to the following link for details: https://github.com/ckan/ckanext-dcat/actions/runs/12284575222. The tests seem to fail unexpectedly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something upstream changed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, the version check was wrong: 6bcf693

@amercader amercader merged commit 0d64786 into ckan:master Dec 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants