@@ -301,12 +301,14 @@ ResourceSerializer.getFormattedFormat = function (formatId) {
301301
302302ResourceSerializer . formatCollection = function ( collectionId ) {
303303 const prefLabel = nyplCore . collections ( ) [ `nyplCollection:${ collectionId } ` ] ?. label
304+ const locationsPath = nyplCore . collections ( ) [ `nyplCollection:${ collectionId } ` ] ?. locationsPath
304305 const buildingLocationLabel = buildingLocations . find ( ( loc ) => loc . value === collectionId . slice ( 0 , 2 ) ) ?. label
305306 if ( ! prefLabel ) return null
306307 return {
307308 '@id' : collectionId ,
308309 prefLabel,
309- buildingLocationLabel
310+ buildingLocationLabel,
311+ locationsPath
310312 }
311313}
312314
@@ -374,10 +376,15 @@ class ItemResourceSerializer extends JsonLdItemSerializer {
374376 } )
375377 }
376378
379+ if ( this . body . holdingLocation ) {
380+ stmts . holdingLocation = ItemResourceSerializer . getFormattedHoldingLocation ( this . body . holdingLocation )
381+ }
382+
377383 // Override default serialization of item.electronicLocator statements (full digital surrogates):
378384 if ( this . body . electronicLocator ) {
379385 stmts . electronicLocator = this . body . electronicLocator . map ( ( link ) => ResourceSerializer . formatElectronicResourceBlankNode ( link , 'nypl:ElectronicLocation' ) )
380386 }
387+
381388 return stmts
382389 }
383390
@@ -386,6 +393,19 @@ class ItemResourceSerializer extends JsonLdItemSerializer {
386393 return ( new ItemResourceSerializer ( resp , options ) ) . format ( )
387394 }
388395
396+ static getFormattedHoldingLocation ( location ) {
397+ const loc = Array . isArray ( location ) ? location [ 0 ] : null
398+ if ( ! loc ) return [ ]
399+ const locationId = loc [ '@id' ] ?. split ( ':' ) [ 1 ]
400+ const sierraLocations = nyplCore . sierraLocations ( )
401+ const collectionAccessType = sierraLocations ?. [ locationId ] ?. collectionAccessType
402+ return [ {
403+ '@id' : loc [ '@id' ] ,
404+ prefLabel : loc ?. prefLabel ,
405+ collectionAccessType
406+ } ]
407+ }
408+
389409 // Given an item, returns item with an added `identifier`
390410 // of form 'urn:[sourceIdentifierPrefix]:[sourceIdentifier]'
391411 // e.g.
0 commit comments