TAMULib / CatalogService

A service for interfacing with Library Catalogs
MIT License
0 stars 1 forks source link

Determine the strategy Catalog Service will use to connect and retrieve FOLIO data #71

Closed jsavell closed 1 year ago

jsavell commented 3 years ago

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)

jcreel commented 3 years 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

ghost commented 3 years ago

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

ghost commented 3 years ago

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'
ghost commented 3 years ago

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'
kaladay commented 3 years ago

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

ghost commented 3 years ago

Here is how it gets holdings from FOLIO.

https://github.com/vufind-org/vufind/blob/406cc6fadc043bb84d811a81a6ebc5b50520827b/module/VuFind/src/VuFind/ILS/Driver/Folio.php#L460

        $query = [
            'query' => '(instanceId=="' . $instance->id
                . '" NOT discoverySuppress==true)'
        ];
        $holdingResponse = $this->makeRequest(
            'GET',
            '/holdings-storage/holdings',
            $query
        );
ghost commented 3 years ago

Then iterates over holdings and gets the items

            $query = [
                'query' => '(holdingsRecordId=="' . $holding->id
                    . '" NOT discoverySuppress==true)'
            ];
            $itemResponse = $this->makeRequest('GET', '/item-storage/items', $query);
kaladay commented 3 years ago

This helps hint at the details on how it makes the oai request: https://github.com/vufind-org/vufind/blob/dc4677e100ecd786e5bb4b5b434a6ea08025aa9c/harvest/oai.ini