-
Notifications
You must be signed in to change notification settings - Fork 146
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 dct identifier to publisher #301
Merged
amercader
merged 4 commits into
ckan:master
from
Health-RI:add-dct-identifier-to-publisher
Sep 12, 2024
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,11 @@ dataset_fields: | |
|
||
- field_name: type | ||
label: Type | ||
|
||
- field_name: identifier | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add it to the dcat_ap_full.yaml file as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will do |
||
label: Identifier | ||
help_text: Unique identifier for the publisher, such as a ROR ID. | ||
|
||
help_text: Entity responsible for making the dataset available. | ||
|
||
- field_name: license_id | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -647,6 +647,7 @@ def test_publisher_foaf(self): | |
<foaf:mbox>[email protected]</foaf:mbox> | ||
<foaf:homepage>http://some.org</foaf:homepage> | ||
<dct:type rdf:resource="http://purl.org/adms/publishertype/NonProfitOrganisation"/> | ||
<dct:identifier rdf:resource="https://ror.org/05wg1m734"/> | ||
</foaf:Organization> | ||
</dct:publisher> | ||
</rdfs:SomeClass> | ||
|
@@ -666,6 +667,7 @@ def test_publisher_foaf(self): | |
assert publisher['email'] == '[email protected]' | ||
assert publisher['url'] == 'http://some.org' | ||
assert publisher['type'] == 'http://purl.org/adms/publishertype/NonProfitOrganisation' | ||
assert publisher['identifier'] == 'https://ror.org/05wg1m734' | ||
|
||
def test_publisher_ref(self): | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,7 @@ def _get_extra_value_as_list(key): | |
assert _get_extra_value('publisher_email') == '[email protected]' | ||
assert _get_extra_value('publisher_url') == 'http://some.org' | ||
assert _get_extra_value('publisher_type') == 'http://purl.org/adms/publishertype/NonProfitOrganisation' | ||
assert _get_extra_value('publisher_identifier') == 'https://ror.org/05wg1m734' | ||
assert _get_extra_value('contact_name') == 'Point of Contact' | ||
# mailto gets removed for storage and is added again on output | ||
assert _get_extra_value('contact_email') == '[email protected]' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,7 @@ def test_e2e_ckan_to_dcat(self): | |
"email": "[email protected]", | ||
"url": "https://example.org", | ||
"type": "public_body", | ||
"identifier": "http://example.org/publisher-id", | ||
}, | ||
], | ||
"temporal_coverage": [ | ||
|
@@ -301,6 +302,12 @@ def test_e2e_ckan_to_dcat(self): | |
DCT.type, | ||
dataset_dict["publisher"][0]["type"], | ||
) | ||
assert self._triple( | ||
g, | ||
publisher[0][2], | ||
DCT.identifier, | ||
dataset_dict["publisher"][0]["identifier"] | ||
hcvdwerf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
|
||
temporal = [t for t in g.triples((dataset_ref, DCT.temporal, None))] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,7 @@ def test_publisher_extras(self): | |
{'key': 'publisher_email', 'value': '[email protected]'}, | ||
{'key': 'publisher_url', 'value': 'http://example.com/publisher/home'}, | ||
{'key': 'publisher_type', 'value': 'http://purl.org/adms/publishertype/Company'}, | ||
{'key': 'publisher_identifier', 'value': 'https://ror.org/05wg1m734'}, | ||
] | ||
|
||
|
||
|
@@ -121,6 +122,7 @@ def test_publisher_extras(self): | |
assert str(publisher) == extras['publisher_uri'] | ||
assert self._triple(g, publisher, RDF.type, SCHEMA.Organization) | ||
assert self._triple(g, publisher, SCHEMA.name, extras['publisher_name']) | ||
assert self._triple(g, publisher, SCHEMA.identifier, extras['publisher_identifier']) | ||
|
||
contact_point = self._triple(g, publisher, SCHEMA.contactPoint, None)[2] | ||
assert contact_point | ||
|
@@ -144,6 +146,7 @@ def test_publisher_no_uri(self): | |
{'key': 'publisher_email', 'value': '[email protected]'}, | ||
{'key': 'publisher_url', 'value': 'http://example.com/publisher/home'}, | ||
{'key': 'publisher_type', 'value': 'http://purl.org/adms/publishertype/Company'}, | ||
{'key': 'publisher_identifier', 'value': 'https://ror.org/05wg1m734'}, | ||
] | ||
} | ||
extras = self._extras(dataset) | ||
|
@@ -158,6 +161,7 @@ def test_publisher_no_uri(self): | |
assert isinstance(publisher, BNode) | ||
assert self._triple(g, publisher, RDF.type, SCHEMA.Organization) | ||
assert self._triple(g, publisher, SCHEMA.name, extras['publisher_name']) | ||
assert self._triple(g, publisher, SCHEMA.identifier, extras['publisher_identifier']) | ||
|
||
contact_point = self._triple(g, publisher, SCHEMA.contactPoint, None)[2] | ||
assert contact_point | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will take care of the DCAT -> CKAN mapping, but you also need to add the other way around, CKAN -> DCAT. This is done a bit further down in the file here and here.
Additionally, this will cover the legacy way of defining publisher fields based on namespaced
publisher_*
extra fields, but going forward we want to support scheming objects ("publisher": {"id": xx, "name": yy, "url": zz}
). This is handled in theeuro_dcat_ap_scheming
profile here (for CKAN -> DCAT, the opposite should already be handled by the base profile). Do you mind adding support for the new field there as well? And if you extend this test to cover the new field, even better.@hcvdwerf Let me know if all this makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tnx for the comments. Verry helpful @amercader . Jut commit the changes