def relid_fetcher(dummy_record_uuid, data): """Fetch a relationship's ID.""" return FetchedPID( provider=None, pid_type='relid', pid_value=str(data['ID']), )
def zenodo_record_fetcher(dummy_record_uuid, data): """Fetch a record's identifiers.""" return FetchedPID( provider=None, pid_type='recid', pid_value=str(data['recid']), )
def lom_pid_fetcher(record_uuid, data): """Fetch lomrecord's identifier(PID).""" return FetchedPID( provider=None, pid_type="lomid", pid_value=data["id"].lower(), )
def pid_fetcher(record_uuid, data, provider_cls, pid_field="pid"): """Generic ILS PID fetcher.""" return FetchedPID( provider=provider_cls, pid_type=provider_cls.pid_type, pid_value=str(data[pid_field]), )
def workflow_fetcher(record_uuid, data): """Fetch a workflow identifier.""" return FetchedPID( provider=WorkflowUIProvider, pid_type=WorkflowUIProvider.pid_type, pid_value=str(data['id']), )
def zenodo_doi_fetcher(dummy_record_uuid, data): """Fetch a record's DOI.""" return FetchedPID( provider=None, pid_type='doi', pid_value=str(data['doi']), )
def tag_pid_fetcher(record_uuid, data): """Return Tag PID fetcher.""" return FetchedPID( provider=None, pid_type=TAG_PID_TYPE, pid_value=str(data["pid"]) )
def pid_to_fetched_recid(pid): """Build a fetched recid from a PersistentIdentifier.""" return FetchedPID( provider=RecordIdProvider, pid_type=RecordIdProvider.pid_type, pid_value=pid.pid_value, )
def vocabulary_pid_fetcher(record_uuid, data): """Dummy vocabulary fetcher.""" return FetchedPID( provider=None, pid_type=VOCABULARY_PID_TYPE, pid_value=str(data['id']), )
def deposit_fetcher(record_uuid, data): """Fetch a deposit identifier.""" return FetchedPID( provider=DepositProvider, pid_type=DepositProvider.pid_type, pid_value=str(data['_deposit']['id']), )
def location_pid_fetcher(record_uuid, data): """Return Location PID fetcher.""" return FetchedPID( provider=None, pid_type=LOCATION_PID_TYPE, pid_value=str(data["pid"]) )
def internal_location_pid_fetcher(record_uuid, data): """Return InternalLocation PID fetcher.""" return FetchedPID( provider=None, pid_type=INTERNAL_LOCATION_PID_TYPE, pid_value=str(data["pid"]) )
def eitem_pid_fetcher(record_uuid, data): """Return EItem PID fetcher.""" return FetchedPID( provider=None, pid_type=EITEM_PID_TYPE, pid_value=str(data["pid"]) )
def catid_fetcher(record_uuid, data): """Fetch PID from category record.""" return FetchedPID( provider=None, pid_type='catid', pid_value=str(data['name']) )
def pid_fetcher(record_uuid, data, provider_cls): """Generic file_management PID fetcher.""" return FetchedPID( provider=provider_cls, pid_type=provider_cls.pid_type, pid_value=str(data["id"]), )
def kwid_fetcher(record_uuid, data): """Fetch PID from keyword record.""" return FetchedPID( provider=None, pid_type='kwid', pid_value=str(data['key_id']) )
def report_number_fetcher(record_uuid, data): """Fetch report number.""" return FetchedPID( provider=CDSReportNumberProvider, pid_type='rn', pid_value=str(data['report_number'][0]) )
def doi_fetcher(record_uuid, data): """Fetch DOI.""" return FetchedPID( provider=None, pid_type='doi', pid_value=str(data['doi']) )
def grant_fetcher(record_uuid, data): """Fetch PID from grant record.""" return FetchedPID( provider=None, pid_type='grant', pid_value=str(data['internal_id']), )
def recid_fetcher(record_uuid, data): """Fetch PID from record.""" return FetchedPID( provider=CDSRecordIdProvider, pid_type='recid', pid_value=str(data['recid']) )
def draft_fetcher(record_uuid, data): fetched_pid = current_pidstore.fetchers[original_fetcher](record_uuid, data) return FetchedPID( provider=fetched_pid.provider, pid_type=draft_pid_type, pid_value=fetched_pid.pid_value, )
def funder_fetcher(record_uuid, data): """Fetch PID from funder record.""" return FetchedPID( provider=None, pid_type='frdoi', pid_value=str(data['doi']), )
def loan_pid_fetcher(record_uuid, data): """Fetch PID from loan record.""" return FetchedPID( provider=None, pid_type=_CIRCULATION_LOAN_PID_TYPE, pid_value=str(data[_CIRCULATION_LOAN_PID_TYPE]) )
def patron_pid_fetcher(record_uuid, data): """Dummy patron fetcher.""" return FetchedPID( provider=None, pid_type=PATRON_PID_TYPE, pid_value=str(data['id']), )
def document_request_pid_fetcher(record_uuid, data): """Return DocumentRequest PID fetcher.""" return FetchedPID( provider=None, pid_type=DOCUMENT_REQUEST_PID_TYPE, pid_value=str(data["pid"]) )
def series_pid_fetcher(record_uuid, data): """Return Series PID fetcher.""" return FetchedPID( provider=None, pid_type=SERIES_PID_TYPE, pid_value=str(data["pid"]) )
def identifiers_fetcher(record_uuid, data, pid_type): assert data, "no data" assert IDENTIFIERS_FIELD in data for schema in identifiers_schemas: if schema == pid_type: return FetchedPID(provider=IdentifiersProvider, pid_type=pid_type, pid_value=data[IDENTIFIERS_FIELD][schema])
def cap_deposit_fetcher(record_uuid, data): """Fetch a deposit's identifiers.""" try: pid_value = data['_deposit']['id'] except KeyError: return None return FetchedPID(provider=None, pid_type='depid', pid_value=pid_value)
def iroko_source_uuid_fetcher(source_uuid, data): assert data, "no data" assert pids.SOURCE_UUID_FIELD in data, "no source uuid in data" return FetchedPID( provider=providers.IrokoSourceUUIDProvider, pid_type=pids.SOURCE_UUID_PID_TYPE, pid_value=str(data[pids.SOURCE_UUID_FIELD]), )
def weko_deposit_fetcher(record_uuid, data): """Fetch a deposit identifier.""" pid_value = data.get('_deposit', {}).get('id') return FetchedPID( provider=None, pid_type='depid', pid_value=pid_value, ) if pid_value else None