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

Solves URI from contact point #312

Merged
merged 7 commits into from
Oct 14, 2024

Conversation

hcvdwerf
Copy link
Contributor

@hcvdwerf hcvdwerf commented Oct 3, 2024

Description:

This pull request introduces functionality to resolve URIs for contact details, specifically targeting the retrieval of more detailed information (e.g., ORCID). Previously, the contact["uri"] field defaulted to either a string or an empty value. With this update, we attempt to resolve the URI and retrieve associated metadata (e.g., VCARD.hasUID) when available.

Changes:

  • Updated the _contact_details method to resolve URIs where applicable.
  • For agents that are not URIRef, the system now attempts to fetch the VCARD.hasUID property to enrich the URI field.

Benefits:

  • Improved Metadata Access: Resolving URIs, such as ORCIDs, allows us to retrieve richer and more accurate contact data (e.g., full names, affiliations, email addresses).

@amercader
Copy link
Member

Wouldn't it make more sense to store VCARD.hasUID in a dedicated key like contact["identifier"]. I get that in the case of ORCID those happen to be URIs as well but that might not be always be the case right? e.g. if using a UUID

Hans-Chrstian added 4 commits October 12, 2024 22:32
…ri-contact-point

# Conflicts:
#	ckanext/dcat/profiles/euro_dcat_ap_scheming.py
#	ckanext/dcat/tests/profiles/dcat_ap_3/test_euro_dcatap_3_profile_serialize.py
@@ -465,7 +465,8 @@ def _contact_details(self, subject, predicate):

for agent in self.g.objects(subject, predicate):

contact["uri"] = str(agent) if isinstance(agent, term.URIRef) else ""
contact["uri"] = (str(agent) if isinstance(agent, URIRef)
else self._get_vcard_property_value(agent, VCARD.hasUID))
Copy link
Member

Choose a reason for hiding this comment

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

Let's keep this as it was and not assign hasUID to uri as discussed.
Otherwise this is good to go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reverted this part back and added also the new mapping to the documentation

@hcvdwerf hcvdwerf requested a review from amercader October 14, 2024 13:31
@amercader amercader merged commit 5d3e9f4 into ckan:master Oct 14, 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.

2 participants