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

Implement a service to deal with Institutions that should be collections #259

Closed
ManonGros opened this issue Nov 19, 2020 · 4 comments
Closed
Assignees
Labels
GRSciColl Issues related to institutions, collections and staff

Comments

@ManonGros
Copy link
Contributor

ManonGros commented Nov 19, 2020

Some institutions on GrSciColl should in fact be collections. This seems to be a relatively widespread issue (although I don't have any specific number) and contributes to the issue with duplicate institutions (#189)

Here are 25 examples that I checked manually:
Insitutions_that_should_be_collections_GrSciColl.tsv.zip

So one idea could be that it is just a special case of resolving duplicates.
It could be an option of the "replace by" mentioned here: #255
What it would do in addition to everything mentioned in the issue is to create a collection and add it to the institution that will be remaining.
Please share your ideas.

@ManonGros ManonGros added the GRSciColl Issues related to institutions, collections and staff label Nov 19, 2020
@marcos-lg
Copy link
Contributor

marcos-lg commented Nov 19, 2020

We'll implement a service in the API to convert an institution into a collection.

This service will do:

  1. Check that the institution doesn't have collections. Otherwise the service will return an error
  2. Create a new collection with the data from the institution. This includes moving the identifiers, machine tags, occurrence mappings and copying the contacts
  3. Delete the institution and set a convertedToCollection flag with the key of the new collection
  4. The service can receive an institution as a parameter that will be the institution of the new collection. If it doesn't receive this parameter it will create a new institution with the same code as the collection. The name of the new institution must also be specified as a parameter

@marcos-lg marcos-lg self-assigned this Nov 19, 2020
@marcos-lg marcos-lg changed the title Deal with Institutions that should be collections Implement a service to deal with Institutions that should be collections Nov 19, 2020
@marcos-lg
Copy link
Contributor

marcos-lg commented Dec 1, 2020

The endpoint is available now in UAT to receive POST requests at:

http://api.gbif-uat.org/v1/grscicoll/institution/{key}/convertToCollection

In the body it's required to pass either the institution key for the new collection or a name to create a new institution for this new collection. It has to be in JSON format:

{
    "institutionForNewCollectionKey": "dd155a13-33da-46be-9f6e-07809d2ab5ab",
    "nameForNewInstitution": "name"
}

Authentication is required and the user needs to be a GRSciColl admin or editor.

Curl request example:

curl -u username:password -X POST 'api.gbif-uat.org/v1/grscicoll/institution/b779903b-f02b-45f2-91ea-b3b28a0c408e/convertToCollection' \
--header 'Content-Type: application/json' \
--data-raw '{
    "institutionForNewCollectionKey": "dd155a13-33da-46be-9f6e-07809d2ab5ab"
}'

@marcos-lg
Copy link
Contributor

To be changed:

  • Don't move the identifiers, just duplicate them and filter the deleted ones in the lookup and in the identifier resolver

@marcos-lg
Copy link
Contributor

marcos-lg commented Dec 11, 2020

I also disallow the conversion iDigBio institutions and restricted the endpoint to GRSCICOLL_ADMINS users only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GRSciColl Issues related to institutions, collections and staff
Projects
None yet
Development

No branches or pull requests

2 participants