diff --git a/src/gbif_registrar/register.py b/src/gbif_registrar/register.py index c29cab9..5ab96e2 100644 --- a/src/gbif_registrar/register.py +++ b/src/gbif_registrar/register.py @@ -189,13 +189,13 @@ def complete_registration_records(registrations): def get_local_dataset_group_id(local_dataset_id): - """Get the local_dataset_group_id value. + """Return the local_dataset_group_id value. Parameters ---------- local_dataset_id : str - Identifier of the local dataset to be registered with GBIF. The - local_dataset_group_id value is derived from this value. + The dataset identifier in the EDI repository. Has the format: + {scope}.{identifier}.{revision}. Returns ------- @@ -209,13 +209,13 @@ def get_local_dataset_group_id(local_dataset_id): def get_gbif_dataset_uuid(local_dataset_group_id, rgstrs): - """Get the gbif_dataset_uuid value. + """Return the gbif_dataset_uuid value. Parameters ---------- local_dataset_group_id : str - Identifier of the local dataset group to be registered with GBIF. The - gbif_dataset_uuid value is created by GBIF and returned upon request. + The dataset group identifier in the EDI repository. Has the format: + {scope}.{identifier}. rgstrs : pandas dataframe The registrations file as a dataframe. @@ -224,23 +224,21 @@ def get_gbif_dataset_uuid(local_dataset_group_id, rgstrs): ------- str The gbif_dataset_uuid value. This is the UUID assigned by GBIF to the - local dataset group. A new value will be returned if a + local dataset group identifier. A new value will be returned if a gbif_dataset_uuid value doesn't already exist for a local_dataset_group_id. Notes ----- - The local_dataset_group_id and gbif_dataset_uuid values have a one-to-one - relationship because this allows a dataset series (i.e. multiple versions - of a dataset) to be registered with GBIF as a single dataset and displayed - from a single URL endpoint on the GBIF system. - - The rgstrs dataframe is used to check if a gbif_dataset_uuid value already - exists for a local_dataset_group_id. If a gbif_dataset_uuid value already - exists for a local_dataset_group_id, then the existing gbif_dataset_uuid - value is returned. If a gbif_dataset_uuid value does not already exist - for a local_dataset_group_id, then a new gbif_dataset_uuid value is - created and returned. + The local_dataset_group_id and gbif_dataset_uuid values have a one-to-one + relationship because this allows a dataset series (i.e. multiple versions + of a dataset) to be registered with GBIF as a single dataset and displayed + from a single URL endpoint on the GBIF system. + + Examples + -------- + >>> registrations = read_registrations_file("registrations.csv") + >>> get_gbif_dataset_uuid("edi.929", registrations) """ # Look in the rgstrs dataframe to see if there is a matching # local_data_set_group_id value, and it has a non-empty gbif_dataset_uuid diff --git a/src/gbif_registrar/utilities.py b/src/gbif_registrar/utilities.py index 3d6e9ce..c1dd493 100644 --- a/src/gbif_registrar/utilities.py +++ b/src/gbif_registrar/utilities.py @@ -170,19 +170,23 @@ def is_synchronized(local_dataset_id, file_path): def get_local_dataset_endpoint(local_dataset_id): - """Get the local_dataset_endpoint value. + """Return the local_dataset_endpoint value. Parameters ---------- local_dataset_id : str - Identifier of the local dataset to be registered with GBIF. The - local_dataset_endpoint value is derived from this value. + The dataset identifier in the EDI repository. Has the format: + {scope}.{identifier}.{revision}. Returns ------- str The local_dataset_endpoint URL value. This is the URL GBIF will crawl to access the local dataset. + + Examples + -------- + >>> get_local_dataset_endpoint("knb-lter-nin.1.1") """ scope = local_dataset_id.split(".")[0] identifier = local_dataset_id.split(".")[1]