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

datastreams: affiliations: add EDMO organizations #435

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ptamarit
Copy link
Member

@ptamarit ptamarit commented Nov 18, 2024

❤️ Thank you for your contribution!

Fixes #433

Description

The pull requests provides a new datastream to import affiliations from the European Directory of Marine Organisations (EDMO).
There is no official mapping between EDMO and ROR, so for now we are importing them separately with a different main ID scheme.

There is no downloadable RDF file containing all the data, so we need to call a SPARQL endpoint in order to import the data.

The data can be imported with the following command:

$ invenio vocabularies import --vocabulary affiliations:edmo --origin https://edmo.seadatanet.org/sparql/sparql
EDMOOrganizationTransformer: ["No alpha_2 country found for: {'org': {'type': 'uri', 'value': 'https://edmo.seadatanet.org/report/1051'}, 'name': {'type': 'literal', 'value': 'UNKNOWN'}, 'countryName': {'type': 'literal', 'value': 'Unknown'}, 'locality': {'type': 'literal', 'value': 'UNKNOWN'}, 'deprecated': {'type': 'literal', 'datatype': 'http://www.w3.org/2001/XMLSchema#boolean', 'value': 'false'}}"]
Vocabulary affiliations:edmo imported. Total items 5656. 
5655 items succeeded
1 contained errors
0 were filtered.

Affiliations organizations autocomplete showing ROR and EDMO organizations side by side:
Affiliations organizations autocomplete

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

OPTIONAL { ?org <http://www.w3.org/2004/02/skos/core#altName> ?altName } .
OPTIONAL { ?org <http://www.w3.org/2006/vcard/ns#country-name> ?countryName } .
OPTIONAL { ?org <http://www.w3.org/2006/vcard/ns#locality> ?locality } .
?org <http://www.w3.org/2002/07/owl#deprecated> ?deprecated .
Copy link
Member Author

Choose a reason for hiding this comment

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

Here I took the decision of importing all organizations (the 5038 active ones and the 617 deprecated ones) and to the deprecated ones as inactive, but we could also filter out deprecated organizations by adding the following to the query:

FILTER (!?deprecated)

"""Applies the transformation to the stream entry."""
record = stream_entry.entry

id_ = record["org"]["value"]
Copy link
Member Author

Choose a reason for hiding this comment

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

Here I took the decision of storing the whole URL (e.g. "https://edmo.seadatanet.org/report/42") as the identifier.
Other options could be to store something like "edmo:42".

@ptamarit
Copy link
Member Author

  • Fix saving of records with EDMO affiliations.

Saving a record with an EDMO affiliations is failing with Creators: No valid scheme recognized for identifier:
Error message EDMO affiliations

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.

Import EDMO organizations into the affiliations vocabulary
1 participant