Closed jsavell closed 1 year ago
Right now we are not using VuFind as a datasource. But we are wanting to see how it is getting its data from FOLIO
I do know VuFind harvests MARC bibliographic records from edge-oai-pmh
and has to lookup holdings records. Far as I know holdings records can be retrieved from mod-inventory-storage
.
https://s3.amazonaws.com/foliodocs/api/mod-inventory-storage/holdings-storage.html https://s3.amazonaws.com/foliodocs/api/mod-inventory-storage/holdings-sources.html
Lookup holdings records by instance id
curl --location --request GET 'https://folio-okapi-q2.library.tamu.edu/holdings-storage/holdings?query=instanceId==41df7159-8e1f-4f39-a20a-803954ef7ce2' \
--header 'Content-Type: application/json' \
--header 'X-Okapi-Tenant: tamu' \
--header 'X-Okapi-Token: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0YW11X2FkbWluIiwidXNlcl9pZCI6ImFhYzQ5OWFlLTZmNmQtNGMyNi1hZjQ1LTg1ZTM3MWJiYWE1MSIsImlhdCI6MTYwNTQ1NDIxNCwidGVuYW50IjoidGFtdSJ9.pRx7NC8E5IncXg9FQ6yo6pnVwi15LbKjYEyPTQ7A7xc'
Lookup holdings record by holdings record id
curl --location --request GET 'https://folio-okapi-q2.library.tamu.edu/holdings-storage/holdings/4571ca09-5095-4f02-9e40-63a25600b184' \
--header 'Content-Type: application/json' \
--header 'X-Okapi-Tenant: tamu' \
--header 'X-Okapi-Token: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0YW11X2FkbWluIiwidXNlcl9pZCI6ImFhYzQ5OWFlLTZmNmQtNGMyNi1hZjQ1LTg1ZTM3MWJiYWE1MSIsImlhdCI6MTYwNTQ1NDIxNCwidGVuYW50IjoidGFtdSJ9.pRx7NC8E5IncXg9FQ6yo6pnVwi15LbKjYEyPTQ7A7xc'
Vufind gets (realtime) holdings here: https://github.com/vufind-org/vufind/blob/dc4677e100ecd786e5bb4b5b434a6ea08025aa9c/module/VuFind/src/VuFind/ILS/Logic/Holds.php#L183 https://github.com/vufind-org/vufind/blob/f0e13674b1335344f6d946fcdc19f89718b1f2f3/module/VuFind/src/VuFind/RecordDriver/IlsAwareTrait.php#L109
Here is how it gets holdings from FOLIO.
$query = [
'query' => '(instanceId=="' . $instance->id
. '" NOT discoverySuppress==true)'
];
$holdingResponse = $this->makeRequest(
'GET',
'/holdings-storage/holdings',
$query
);
Then iterates over holdings and gets the items
$query = [
'query' => '(holdingsRecordId=="' . $holding->id
. '" NOT discoverySuppress==true)'
];
$itemResponse = $this->makeRequest('GET', '/item-storage/items', $query);
This helps hint at the details on how it makes the oai request: https://github.com/vufind-org/vufind/blob/dc4677e100ecd786e5bb4b5b434a6ea08025aa9c/harvest/oai.ini
This strategy will need to support retrieving all holdings by a record identifier and retrieving a single holding by record id and holding id (this second method could be synthetically generated from the first endpoint, if necessary)