Skip to content

@univ-lehavre/atlas-validate-openalex ​

Interactive CLI for validating and assessing the reliability of OpenAlex bibliographic data. Guides a user through author search, affiliation selection, and publication curation using Effect.

Installation ​

bash
pnpm add @univ-lehavre/atlas-validate-openalex

Usage ​

bash
pnpm -F @univ-lehavre/atlas-validate-openalex start

The CLI prompts interactively to:

  1. Search for an author by name
  2. Select matching display name variants
  3. Select relevant affiliations
  4. Curate the final publication list

Configuration ​

Requires a .env file:

env
USER_AGENT=my-app/1.0
RATE_LIMIT={"limit":1,"interval":"1 seconds"}
API_URL=https://api.openalex.org
RESULTS_PER_PAGE=25
OPENALEX_API_KEY=          # optional

API ​

This package is primarily a CLI. Its internals are exported for programmatic use:

Fetch ​

ExportDescription
searchAuthorsByName(names, config)Search authors by name via fetch-openalex
searchAuthorsByORCID(orcids, config)Search authors by ORCID
searchWorksByAuthorIDs(ids, config)Fetch works by author IDs
searchWorksByORCID(orcid, config)Fetch works by ORCID
searchWorksByDOI(dois, config)Fetch works by DOI

Tools ​

ExportDescription
buildIntegrity(data)Generates a UUID v5 hash from JSON-stable-stringified data, scoped to the context namespace
uniqueSorted<T>(values)Returns a deduplicated and sorted array

Classes ​

ClassDescription
ContextStore-
EventsStore-
MetricsStore-

Interfaces ​

InterfaceDescription
Action-
IContext-
IEvent-
IEventData-
IEventMeta-

Type Aliases ​

Type AliasDescription
IContextType-
IEntity-
IField-
Status-

Variables ​

VariableDescription
actionsTODO // Institutions // Fiabilisation INST_FIA = 'Fiabiliser les formes imprimées des institutions', INST_FIA_Q1 = 'Sélectionnez l’institution à fiabiliser', INST_FIA_Q2 = 'Sélectionnez les formes imprimées correspondantes à cette institution', AUTH_FPU = 'Fiabiliser les publications de ce chercheur', // Institutions // Fiabilisation INST_RES = 'Fiabiliser les chercheurs d’une institution', // Auteurs // Ajout AUTH_AFF = 'Ajouter une affilication pour ce chercheur', AUTH_DOI = 'Ajouter une publication pour ce chercheur', // Actions tout le temps actives ORCID = 'Sélectionner un chercheur', ROR = 'Sélectionner une institution', DOI = 'Sélectionner une publication', EXIT = 'Quitter l’application',

Functions ​

FunctionDescription
action2option-
active_actions-
aggregateEventsAgrège les événements pour compter le nombre de publications par année et par affiliation
autocompleteMultiselect-
buildAuthorResultsPendingEvents-
buildEvent-
buildIntegrity-
buildReference-
confirm-
end-
events2optionsConverts a list of events to options for prompts.
existsAcceptedAuthorDisplayNameAlternative-
extendsEventsWithAlternativeStrings-
extendsToWorks-
filterAcceptedAuthorDisplayNameAlternatives-
filterDuplicatesFiltre les événements en double (en se basant sur la propriété dataIntegrity) avant de les ajouter au store.
filterEventsByAttributes-
filterPending-
getAcceptedAuthorAffiliations-
getAcceptedAuthorDisplayNameAlternatives-
getAcceptedAuthorInstitutions-
getAcceptedInstitutionDisplayNameAlternatives-
getAcceptedWorks-
getAffiliations-
getAuthorAlternativeStrings-
getContext-
getDisplayNameAlternatives-
getEventDataRécupère les données d'un événement.
getEvents-
getEventsDataRécupère les données de tous les événements dans le store.
getGlobalStatuses-
getManyEvent-
getOpenAlexIDByStatus-
getOpenAlexIDByStatusDashboard-
getOpenAlexIDsExtract OpenAlex IDs for an author identified by an ORCID from a set of events.
getOpenAlexIDsBasedOnAcceptedWorks-
getORCID-
getPendingOpenAlexIDs-
getRejectedOpenAlexIDs-
getStatuses-
getStatusesByValueGet the status of a specific event by its ID, entity, and field. Computes the status based on the number of unique value entries for each status.
getStatusOfAffiliation-
getStatusOfAuthorDisplayNameAlternative-
getStatusOfInstitutionAlternativesStrings-
getStatusOfWork-
hasAcceptedAuthorAffiliations-
hasAcceptedAuthorDisplayNameAlternatives-
hasAcceptedAuthorInstitutions-
hasAcceptedInstitutionDisplayNameAlternatives-
hasAcceptedOpenAlexIDs-
hasAcceptedValues-
hasAcceptedWorks-
hasAuthorAlternativeStrings-
hasEventsForThisORCID-
hasORCID-
hasPending-
hasPendings-
insert_new_ORCID-
intersectReturn the intersection of two string arrays.
isAuthorContext-
isContext-
isInteresting-
listAcceptedAuthorAffiliations-
listAcceptedAuthorDisplayNameAlternatives-
listAcceptedInstitutionDisplayNameAlternatives-
listAcceptedOpenAlexIDs-
listAcceptedWorks-
loadStores-
mark_alternative_strings_reliable-
multiselect-
notHasPendings-
outerLeft-
outerRight-
print_aggregate-
print_title-
provideContextStore-
provideEventsStore-
provideMetricsStore-
removeAuthorPendings-
removeDuplicatesRemoves duplicate events in a given list (based on the dataIntegrity property).
retrieveWorksByDOI-
retrieveWorksByORCID-
saveContextStore-
saveEventsStore-
saveStores-
saveStoresAndExit-
searchAuthorByName-
searchAuthorByORCID-
searchWorksByAuthorIDs-
searchWorksByDOI-
searchWorksByORCID-
select-
string2option-
strings2options-
taskLog-
text-
union-
uniqueSorted-
updateContextStore-
updateEventsStoreUpdates the EventsStore with new events, ensuring no duplicates.
updateEventsStoreBasedOnAcceptedValues-
updateNewEventsWithExistingMetadataUpdates new events with status and hasbeenextended metadata from existing events.