A bridge between OAI-PMH and Event Notifications.
git clone https://github.com/MellonScholarlyCommunication/oai2events
yarn install
The config.jsonld
file should contain the OAI-PMH endpoints that needs to be transformed into Event Notifications.
Each OAI-PMH entry should contain the fields:
@id
: the baseUrl of the OAI-PMH endpoint@type
:DefaultRecordResolver
for the default implementation of a OAI-PMH record resolverbaseUrl
: a copy of the baseUrl of the OAI-PMH endpointrecordUrlPrefix
: the record OAI-PMH prefix that is usedlandingPagePrefix
: the prefix of the landing page of the record
The landing page will be the OAI-PMH record identifier with recordUrlPrefix
replaced by landingPagePrefix
.
Run the Radboud University demo
yarn oai:radboud
The oai2event bridge will create for every record in an OAI-PMH response a ActivityStreams2 event notification in output directory (by default out
).
Start a new conversion by running the dist/client.js
script with an OAI-PMH baseurl:
node dist/client.js <baseurl>
The OAI-PMH parameters can be set with:
--metadataPrefix
: the default metadata prefix isoai_dc
--from
: the default date is yesterday--until
--setSpec
Dates can also be specified using an minimum and maximum offset:
--offset
: the from offset in days--offset2
: the util offset in days
The maximum number of records can be to be transformed can be set with:
--max
: the maximum number of records per oai2events run to transform--max-no-del
: the maximum number of non-deleted records per oai2events run to transform
The contents of the Event Notifications can be configures with using JSON configuration files:
config/context.json
config/actor.json
config/origin.json
config/target.json
The config/type_map.json
defines for which type of OAI-PMH events a particular Event Notification is created:
new
: all OAI-PMH records that are discovered the first time by oai2eventsupdate
: all OAI-PMH records known by oai2events that were updated since last harvestdelete
: all OAI-PMH records that were marked as deleted
The cache of known OAI-PMH records is in cache.db
this can be set with the --database
parameter.
In normal operation the oai2event scripts can be run as a cron script for periodical incremental transformation of OAI-PMH records into event notifications.