foliolib.folio.api.inventoryStorage.InstanceStorage

class foliolib.folio.api.inventoryStorage.InstanceStorage(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Instance Storage API

Storage for instances in the inventory

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

delete_instance(instanceId)

Delete instance item with given {instanceId}

delete_instanceRelationship(relationshipId)

Delete instanceRelationship item with given {instanceRelationshipId}

delete_instances()

DELETE /instance-storage/instances

delete_marcJson(instanceId)

Delete marcJson item with given {marcJsonId}

delete_sourceRecord(instanceId, **kwargs)

Delete the source record.

get_instance(instanceId)

Get Instance by InstanceId Instances are stored and accessed by a hash of key properties.

get_instanceRelationship(relationshipId)

Get Instance Relationship

get_instanceRelationships(**kwargs)

Retrieve a list of instanceRelationship items.

get_instances(**kwargs)

Retrieve a list of instance items.

get_marcJson(instanceId)

Get Instance Relationship

get_mods_by_instance(instanceId)

GET /instance-storage/instances/{instanceId}/source-record/mods

modify_instance(instanceId, instance)

Update instance item with given {instanceId}

modify_instanceRelationship(relationshipId, ...)

Update instanceRelationship item with given {instanceRelationshipId}

modify_marcJson(instanceId, marcJson)

Update marcJson item with given {marcJsonId}

modify_mods(instanceId)

PUT /instance-storage/instances/{instanceId}/source-record/mods

set_instance(instance)

Create a new instance item.

set_instanceRelationship(instanceRelationship)

Create a new instanceRelationship item.

delete_instance(instanceId: str)

Delete instance item with given {instanceId}

DELETE /instance-storage/instances/{instanceId}

Parameters

instanceId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

delete_instanceRelationship(relationshipId: str)

Delete instanceRelationship item with given {instanceRelationshipId}

DELETE /instance-storage/instance-relationships/{relationshipId}

Parameters

relationshipId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

delete_instances()

DELETE /instance-storage/instances

delete_marcJson(instanceId: str)

Delete marcJson item with given {marcJsonId}

DELETE /instance-storage/instances/{instanceId}/source-record/marc-json

Parameters

instanceId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

delete_sourceRecord(instanceId: str, **kwargs)

Delete the source record. Note: When the Inventory instance record is deleted, its source record in mod-inventory-storage is automatically deleted. If the Inventory instance record is linked to a corresponding record in mod-source-record-storage, that SRS record is NOT automatically deleted.

DELETE /instance-storage/instances/{instanceId}/source-record

Parameters
  • instanceId (str) –

  • **kwargs (properties) – Keyword Arguments

Keyword Arguments

lang (str) – (default=en) Requested language. Optional. [lang=en]

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

get_instance(instanceId: str)

Get Instance by InstanceId Instances are stored and accessed by a hash of key properties. The rules which govern how instance hashes are computed are business rules and defined in the service layer. the storage layer only knows how to insert or retrieve instance records by ID.

GET /instance-storage/instances/{instanceId}

Parameters

instanceId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An instance record",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the instance record; a UUID",
      "$ref": "uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "hrid": {
      "type": "string",
      "description": "The human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID"
    },
    "matchKey": {
      "type": "string",
      "description": "A unique instance identifier matching a client-side bibliographic record identification scheme, in particular for a scenario where multiple separate catalogs with no shared record identifiers contribute to the same Instance in Inventory. A match key is typically generated from select, normalized pieces of metadata in bibliographic records"
    },
    "source": {
      "type": "string",
      "description": "The metadata source and its format of the underlying record to the instance record. (e.g. FOLIO if it's a record created in Inventory;  MARC if it's a MARC record created in MARCcat or EPKB if it's a record coming from eHoldings)"
    },
    "title": {
      "type": "string",
      "description": "The primary title (or label) associated with the resource"
    },
    "indexTitle": {
      "type": "string",
      "description": "Title normalized for browsing and searching; based on the title with articles removed"
    },
    "alternativeTitles": {
      "type": "array",
      "description": "List of alternative titles for the resource (e.g. original language version title of a movie)",
      "items": {
        "type": "object",
        "properties": {
          "alternativeTitleTypeId": {
            "type": "string",
            "description": "UUID for an alternative title qualifier",
            "$ref": "uuid.json"
          },
          "alternativeTitle": {
            "type": "string",
            "description": "An alternative title for the resource"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls an alternative title",
            "$ref": "uuid.json"
          }
        }
      },
      "uniqueItems": true
    },
    "editions": {
      "type": "array",
      "description": "The edition statement, imprint and other publication source information",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "series": {
      "type": "array",
      "description": "List of series titles associated with the resource (e.g. Harry Potter)",
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Series title value"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls an series title",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      },
      "uniqueItems": true
    },
    "identifiers": {
      "type": "array",
      "description": "An extensible set of name-value pairs of identifiers associated with the resource",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Resource identifier value"
          },
          "identifierTypeId": {
            "type": "string",
            "description": "UUID of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)",
            "$ref": "uuid.json"
          },
          "identifierTypeObject": {
            "type": "object",
            "description": "Information about identifier type, looked up from identifierTypeId",
            "folio:$ref": "illpolicy.json",
            "readonly": true,
            "folio:isVirtual": true,
            "folio:linkBase": "identifier-types",
            "folio:linkFromField": "identifierTypeId",
            "folio:linkToField": "id",
            "folio:includedElement": "identifierTypes.0"
          }
        },
        "additionalProperties": false,
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "contributors": {
      "type": "array",
      "description": "List of contributors",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Personal name, corporate name, meeting name"
          },
          "contributorTypeId": {
            "type": "string",
            "description": "UUID for the contributor type term defined in controlled vocabulary",
            "$ref": "uuid.json"
          },
          "contributorTypeText": {
            "type": "string",
            "description": "Free text element for adding contributor type terms other that defined by the MARC code list for relators"
          },
          "contributorNameTypeId": {
            "type": "string",
            "description": "UUID of contributor name type term defined by the MARC code list for relators",
            "$ref": "uuid.json"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls the contributor",
            "$ref": "uuid.json"
          },
          "contributorNameType": {
            "type": "object",
            "description": "Dereferenced contributor-name type",
            "javaType": "org.folio.rest.jaxrs.model.contributorNameTypeVirtual",
            "folio:$ref": "contributornametype.json",
            "readonly": true,
            "folio:isVirtual": true,
            "folio:linkBase": "contributor-name-types",
            "folio:linkFromField": "contributorNameTypeId",
            "folio:linkToField": "id",
            "folio:includedElement": "contributorNameTypes.0"
          },
          "primary": {
            "type": "boolean",
            "description": "Whether this is the primary contributor"
          }
        },
        "additionalProperties": false,
        "required": [
          "name",
          "contributorNameTypeId"
        ]
      }
    },
    "subjects": {
      "type": "array",
      "description": "List of subject headings",
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Subject heading value"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls a subject heading",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      },
      "uniqueItems": true
    },
    "classifications": {
      "type": "array",
      "description": "List of classifications",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "classificationNumber": {
            "type": "string",
            "description": "Classification (e.g. classification scheme, classification schedule)"
          },
          "classificationTypeId": {
            "type": "string",
            "description": "UUID of classification schema (e.g. LC, Canadian Classification, NLM, National Agricultural Library, UDC, and Dewey)",
            "$ref": "uuid.json"
          },
          "classificationType": {
            "type": "object",
            "description": "Dereferenced classification schema",
            "javaType": "org.folio.rest.jaxrs.model.classificationTypeVirtual",
            "folio:$ref": "classificationtype.json",
            "readonly": true,
            "folio:isVirtual": true,
            "folio:linkBase": "classification-types",
            "folio:linkFromField": "classificationTypeId",
            "folio:linkToField": "id",
            "folio:includedElement": "classificationTypes.0"
          }
        },
        "additionalProperties": false,
        "required": [
          "classificationNumber",
          "classificationTypeId"
        ]
      }
    },
    "publication": {
      "type": "array",
      "description": "List of publication items",
      "items": {
        "type": "object",
        "properties": {
          "publisher": {
            "type": "string",
            "description": "Name of publisher, distributor, etc."
          },
          "place": {
            "type": "string",
            "description": "Place of publication, distribution, etc."
          },
          "dateOfPublication": {
            "type": "string",
            "description": "Date (year YYYY) of publication, distribution, etc."
          },
          "role": {
            "type": "string",
            "description": "The role of the publisher, distributor, etc."
          }
        }
      }
    },
    "publicationFrequency": {
      "type": "array",
      "description": "List of intervals at which a serial appears (e.g. daily, weekly, monthly, quarterly, etc.)",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "publicationRange": {
      "type": "array",
      "description": "The range of sequential designation/chronology of publication, or date range",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "publicationPeriod": {
      "type": "object",
      "description": "Publication period",
      "properties": {
        "start": {
          "type": "integer",
          "description": "Publication start year"
        },
        "end": {
          "type": "integer",
          "description": "Publication end year"
        }
      },
      "additionalProperties": false
    },
    "electronicAccess": {
      "type": "array",
      "description": "List of electronic access items",
      "items": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string",
            "description": "uniform resource identifier (URI) is a string of characters designed for unambiguous identification of resources"
          },
          "linkText": {
            "type": "string",
            "description": "The value of the MARC tag field 856 2nd indicator, where the values are: no information provided, resource, version of resource, related resource, no display constant generated"
          },
          "materialsSpecification": {
            "type": "string",
            "description": "Materials specified is used to specify to what portion or aspect of the resource the electronic location and access information applies (e.g. a portion or subset of the item is electronic, or a related electronic resource is being linked to the record)"
          },
          "publicNote": {
            "type": "string",
            "description": "URL public note to be displayed in the discovery"
          },
          "relationshipId": {
            "type": "string",
            "description": "UUID for the type of relationship between the electronic resource at the location identified and the item described in the record as a whole",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "uri"
        ]
      }
    },
    "instanceTypeId": {
      "type": "string",
      "description": "UUID of the unique term for the resource type whether it's from the RDA content term list of locally defined",
      "$ref": "uuid.json"
    },
    "instanceFormatIds": {
      "type": "array",
      "description": "UUIDs for the unique terms for the format whether it's from the RDA carrier term list of locally defined",
      "items": {
        "type": "string",
        "$ref": "uuid.json"
      }
    },
    "instanceFormats": {
      "type": "array",
      "description": "List of dereferenced instance formats",
      "items": {
        "type": "object",
        "$ref": "instanceformat.json"
      },
      "readonly": true,
      "folio:isVirtual": true,
      "folio:linkBase": "instance-formats",
      "folio:linkFromField": "instanceFormatIds",
      "folio:linkToField": "id",
      "folio:includedElement": "instanceFormats"
    },
    "physicalDescriptions": {
      "type": "array",
      "description": "Physical description of the described resource, including its extent, dimensions, and such other physical details as a description of any accompanying materials and unit type and size",
      "items": {
        "type": "string"
      }
    },
    "languages": {
      "type": "array",
      "description": "The set of languages used by the resource",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "notes": {
      "type": "array",
      "description": "Bibliographic notes (e.g. general notes, specialized notes)",
      "items": {
        "type": "object",
        "properties": {
          "instanceNoteTypeId": {
            "description": "ID of the type of note",
            "$ref": "uuid.json"
          },
          "note": {
            "type": "string",
            "description": "Text content of the note"
          },
          "staffOnly": {
            "type": "boolean",
            "description": "If true, determines that the note should not be visible for others than staff",
            "default": false
          }
        }
      }
    },
    "administrativeNotes": {
      "type": "array",
      "description": "Administrative notes",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "modeOfIssuanceId": {
      "type": "string",
      "description": "UUID of the RDA mode of issuance, a categorization reflecting whether a resource is issued in one or more parts, the way it is updated, and whether its termination is predetermined or not (e.g. monograph,  sequential monograph, serial; integrating Resource, other)",
      "$ref": "uuid.json"
    },
    "catalogedDate": {
      "type": "string",
      "description": "Date or timestamp on an instance for when is was considered cataloged"
    },
    "previouslyHeld": {
      "type": "boolean",
      "description": "Records the fact that the resource was previously held by the library for things like Hathi access, etc.",
      "default": false
    },
    "staffSuppress": {
      "type": "boolean",
      "description": "Records the fact that the record should not be displayed for others than catalogers"
    },
    "discoverySuppress": {
      "type": "boolean",
      "description": "Records the fact that the record should not be displayed in a discovery system",
      "default": false
    },
    "statisticalCodeIds": {
      "type": "array",
      "description": "List of statistical code IDs",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "sourceRecordFormat": {
      "type": "string",
      "description": "Format of the instance source record, if a source record exists (e.g. FOLIO if it's a record created in Inventory,  MARC if it's a MARC record created in MARCcat or EPKB if it's a record coming from eHoldings)",
      "enum": [
        "MARC-JSON"
      ],
      "readonly": true
    },
    "statusId": {
      "type": "string",
      "description": "UUID for the Instance status term (e.g. cataloged, uncatalogued, batch loaded, temporary, other, not yet assigned)",
      "$ref": "uuid.json"
    },
    "statusUpdatedDate": {
      "type": "string",
      "description": "Date [or timestamp] for when the instance status was updated"
    },
    "tags": {
      "description": "arbitrary tags associated with this instance",
      "id": "tags",
      "type": "object",
      "$ref": "raml-util/schemas/tags.schema"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    },
    "holdingsRecords2": {
      "type": "array",
      "description": "List of holdings records",
      "items": {
        "type": "object",
        "$ref": "holdingsrecord.json"
      },
      "readonly": true,
      "folio:isVirtual": true,
      "folio:linkBase": "holdings-storage/holdings",
      "folio:linkFromField": "id",
      "folio:linkToField": "instanceId",
      "folio:includedElement": "holdingsRecords"
    },
    "natureOfContentTermIds": {
      "type": "array",
      "description": "Array of UUID for the Instance nature of content (e.g. bibliography, biography, exhibition catalogue, festschrift, newspaper, proceedings, research report, thesis or website)",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "description": "Single UUID for the Instance nature of content",
        "$ref": "uuid.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "source",
    "title",
    "instanceTypeId"
  ]
}
get_instanceRelationship(relationshipId: str)

Get Instance Relationship

GET /instance-storage/instance-relationships/{relationshipId}

Parameters

relationshipId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A relationship of a given type between a super-instance and a sub-instance",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "superInstanceId": {
      "description": "ID (a UUID) of the super-instance. References an Instance record",
      "type": "string"
    },
    "subInstanceId": {
      "description": "ID (a UUID) of the sub-instance. References an Instance record",
      "type": "string"
    },
    "instanceRelationshipTypeId": {
      "description": "ID (a UUID) of the InstanceRelationshipType. References controlled vocabulary InstanceRelationshipTypes. Indicates the type of relationship between two Instance records.",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "superInstanceId",
    "subInstanceId",
    "instanceRelationshipTypeId"
  ]
}
get_instanceRelationships(**kwargs)

Retrieve a list of instanceRelationship items.

GET /instance-storage/instance-relationships

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • offset (int) –

    (default=0) Skip over a number of elements by specifying an offset value for the query

    Example

    • 0

  • limit (int) –

    (default=10) Limit the number of elements returned in the response

    Example

    • 10

  • query (str) –

    A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://dev.folio.org/reference/glossary#cql)) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    by parent ID or by child ID (using CQL)

    Example

    • (username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode

    • subInstanceId==83a50dc6-b887-43d9-93ee-28b2c4cd11f8 superInstanceId==30fcc8e7-a019-43f4-b642-2edc389f4501 instanceRelationshipTypeId==758f13db-ffb4-440e-bb10-8a364aa6cb4a AND superInstanceId=30fcc8e7-a019-43f4-b642-2edc389f4501

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of InstanceRelationship records",
  "type": "object",
  "properties": {
    "instanceRelationships": {
      "description": "List of instance relationships",
      "id": "instanceRelationships",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "instancerelationship.json"
      }
    },
    "totalRecords": {
      "description": "Estimated or exact total number of records",
      "type": "integer"
    }
  },
  "required": [
    "instanceRelationships",
    "totalRecords"
  ]
}
get_instances(**kwargs)

Retrieve a list of instance items.

GET /instance-storage/instances

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • offset (int) –

    (default=0) Skip over a number of elements by specifying an offset value for the query

    Example

    • 0

  • limit (int) –

    (default=10) Limit the number of elements returned in the response

    Example

    • 10

  • query (str) –

    A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://dev.folio.org/reference/glossary#cql)) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    by title (using CQL)

    Example

    • (username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode

    • title=”uproot

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of instance records",
  "type": "object",
  "properties": {
    "instances": {
      "description": "List of instance records",
      "id": "instances",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "instance.json"
      }
    },
    "totalRecords": {
      "description": "Estimated or exact total number of records",
      "type": "integer"
    },
    "resultInfo": {
      "$ref": "raml-util/schemas/resultInfo.schema",
      "readonly": true
    }
  },
  "required": [
    "instances",
    "totalRecords"
  ]
}
get_marcJson(instanceId: str)

Get Instance Relationship

GET /instance-storage/instances/{instanceId}/source-record/marc-json

Parameters

instanceId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A relationship of a given type between a super-instance and a sub-instance",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "superInstanceId": {
      "description": "ID (a UUID) of the super-instance. References an Instance record",
      "type": "string"
    },
    "subInstanceId": {
      "description": "ID (a UUID) of the sub-instance. References an Instance record",
      "type": "string"
    },
    "instanceRelationshipTypeId": {
      "description": "ID (a UUID) of the InstanceRelationshipType. References controlled vocabulary InstanceRelationshipTypes. Indicates the type of relationship between two Instance records.",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "superInstanceId",
    "subInstanceId",
    "instanceRelationshipTypeId"
  ]
}
get_mods_by_instance(instanceId: str)

GET /instance-storage/instances/{instanceId}/source-record/mods

Parameters

instanceId (str) –

Raises

OkapiFatalError – Server Error

modify_instance(instanceId: str, instance: dict)

Update instance item with given {instanceId}

PUT /instance-storage/instances/{instanceId}

Parameters
  • instanceId (str) –

  • instance (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An instance record",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the instance record; a UUID",
      "$ref": "uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "hrid": {
      "type": "string",
      "description": "The human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID"
    },
    "matchKey": {
      "type": "string",
      "description": "A unique instance identifier matching a client-side bibliographic record identification scheme, in particular for a scenario where multiple separate catalogs with no shared record identifiers contribute to the same Instance in Inventory. A match key is typically generated from select, normalized pieces of metadata in bibliographic records"
    },
    "source": {
      "type": "string",
      "description": "The metadata source and its format of the underlying record to the instance record. (e.g. FOLIO if it's a record created in Inventory;  MARC if it's a MARC record created in MARCcat or EPKB if it's a record coming from eHoldings)"
    },
    "title": {
      "type": "string",
      "description": "The primary title (or label) associated with the resource"
    },
    "indexTitle": {
      "type": "string",
      "description": "Title normalized for browsing and searching; based on the title with articles removed"
    },
    "alternativeTitles": {
      "type": "array",
      "description": "List of alternative titles for the resource (e.g. original language version title of a movie)",
      "items": {
        "type": "object",
        "properties": {
          "alternativeTitleTypeId": {
            "type": "string",
            "description": "UUID for an alternative title qualifier",
            "$ref": "uuid.json"
          },
          "alternativeTitle": {
            "type": "string",
            "description": "An alternative title for the resource"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls an alternative title",
            "$ref": "uuid.json"
          }
        }
      },
      "uniqueItems": true
    },
    "editions": {
      "type": "array",
      "description": "The edition statement, imprint and other publication source information",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "series": {
      "type": "array",
      "description": "List of series titles associated with the resource (e.g. Harry Potter)",
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Series title value"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls an series title",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      },
      "uniqueItems": true
    },
    "identifiers": {
      "type": "array",
      "description": "An extensible set of name-value pairs of identifiers associated with the resource",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Resource identifier value"
          },
          "identifierTypeId": {
            "type": "string",
            "description": "UUID of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)",
            "$ref": "uuid.json"
          },
          "identifierTypeObject": {
            "type": "object",
            "description": "Information about identifier type, looked up from identifierTypeId",
            "folio:$ref": "illpolicy.json",
            "readonly": true,
            "folio:isVirtual": true,
            "folio:linkBase": "identifier-types",
            "folio:linkFromField": "identifierTypeId",
            "folio:linkToField": "id",
            "folio:includedElement": "identifierTypes.0"
          }
        },
        "additionalProperties": false,
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "contributors": {
      "type": "array",
      "description": "List of contributors",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Personal name, corporate name, meeting name"
          },
          "contributorTypeId": {
            "type": "string",
            "description": "UUID for the contributor type term defined in controlled vocabulary",
            "$ref": "uuid.json"
          },
          "contributorTypeText": {
            "type": "string",
            "description": "Free text element for adding contributor type terms other that defined by the MARC code list for relators"
          },
          "contributorNameTypeId": {
            "type": "string",
            "description": "UUID of contributor name type term defined by the MARC code list for relators",
            "$ref": "uuid.json"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls the contributor",
            "$ref": "uuid.json"
          },
          "contributorNameType": {
            "type": "object",
            "description": "Dereferenced contributor-name type",
            "javaType": "org.folio.rest.jaxrs.model.contributorNameTypeVirtual",
            "folio:$ref": "contributornametype.json",
            "readonly": true,
            "folio:isVirtual": true,
            "folio:linkBase": "contributor-name-types",
            "folio:linkFromField": "contributorNameTypeId",
            "folio:linkToField": "id",
            "folio:includedElement": "contributorNameTypes.0"
          },
          "primary": {
            "type": "boolean",
            "description": "Whether this is the primary contributor"
          }
        },
        "additionalProperties": false,
        "required": [
          "name",
          "contributorNameTypeId"
        ]
      }
    },
    "subjects": {
      "type": "array",
      "description": "List of subject headings",
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Subject heading value"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls a subject heading",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      },
      "uniqueItems": true
    },
    "classifications": {
      "type": "array",
      "description": "List of classifications",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "classificationNumber": {
            "type": "string",
            "description": "Classification (e.g. classification scheme, classification schedule)"
          },
          "classificationTypeId": {
            "type": "string",
            "description": "UUID of classification schema (e.g. LC, Canadian Classification, NLM, National Agricultural Library, UDC, and Dewey)",
            "$ref": "uuid.json"
          },
          "classificationType": {
            "type": "object",
            "description": "Dereferenced classification schema",
            "javaType": "org.folio.rest.jaxrs.model.classificationTypeVirtual",
            "folio:$ref": "classificationtype.json",
            "readonly": true,
            "folio:isVirtual": true,
            "folio:linkBase": "classification-types",
            "folio:linkFromField": "classificationTypeId",
            "folio:linkToField": "id",
            "folio:includedElement": "classificationTypes.0"
          }
        },
        "additionalProperties": false,
        "required": [
          "classificationNumber",
          "classificationTypeId"
        ]
      }
    },
    "publication": {
      "type": "array",
      "description": "List of publication items",
      "items": {
        "type": "object",
        "properties": {
          "publisher": {
            "type": "string",
            "description": "Name of publisher, distributor, etc."
          },
          "place": {
            "type": "string",
            "description": "Place of publication, distribution, etc."
          },
          "dateOfPublication": {
            "type": "string",
            "description": "Date (year YYYY) of publication, distribution, etc."
          },
          "role": {
            "type": "string",
            "description": "The role of the publisher, distributor, etc."
          }
        }
      }
    },
    "publicationFrequency": {
      "type": "array",
      "description": "List of intervals at which a serial appears (e.g. daily, weekly, monthly, quarterly, etc.)",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "publicationRange": {
      "type": "array",
      "description": "The range of sequential designation/chronology of publication, or date range",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "publicationPeriod": {
      "type": "object",
      "description": "Publication period",
      "properties": {
        "start": {
          "type": "integer",
          "description": "Publication start year"
        },
        "end": {
          "type": "integer",
          "description": "Publication end year"
        }
      },
      "additionalProperties": false
    },
    "electronicAccess": {
      "type": "array",
      "description": "List of electronic access items",
      "items": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string",
            "description": "uniform resource identifier (URI) is a string of characters designed for unambiguous identification of resources"
          },
          "linkText": {
            "type": "string",
            "description": "The value of the MARC tag field 856 2nd indicator, where the values are: no information provided, resource, version of resource, related resource, no display constant generated"
          },
          "materialsSpecification": {
            "type": "string",
            "description": "Materials specified is used to specify to what portion or aspect of the resource the electronic location and access information applies (e.g. a portion or subset of the item is electronic, or a related electronic resource is being linked to the record)"
          },
          "publicNote": {
            "type": "string",
            "description": "URL public note to be displayed in the discovery"
          },
          "relationshipId": {
            "type": "string",
            "description": "UUID for the type of relationship between the electronic resource at the location identified and the item described in the record as a whole",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "uri"
        ]
      }
    },
    "instanceTypeId": {
      "type": "string",
      "description": "UUID of the unique term for the resource type whether it's from the RDA content term list of locally defined",
      "$ref": "uuid.json"
    },
    "instanceFormatIds": {
      "type": "array",
      "description": "UUIDs for the unique terms for the format whether it's from the RDA carrier term list of locally defined",
      "items": {
        "type": "string",
        "$ref": "uuid.json"
      }
    },
    "instanceFormats": {
      "type": "array",
      "description": "List of dereferenced instance formats",
      "items": {
        "type": "object",
        "$ref": "instanceformat.json"
      },
      "readonly": true,
      "folio:isVirtual": true,
      "folio:linkBase": "instance-formats",
      "folio:linkFromField": "instanceFormatIds",
      "folio:linkToField": "id",
      "folio:includedElement": "instanceFormats"
    },
    "physicalDescriptions": {
      "type": "array",
      "description": "Physical description of the described resource, including its extent, dimensions, and such other physical details as a description of any accompanying materials and unit type and size",
      "items": {
        "type": "string"
      }
    },
    "languages": {
      "type": "array",
      "description": "The set of languages used by the resource",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "notes": {
      "type": "array",
      "description": "Bibliographic notes (e.g. general notes, specialized notes)",
      "items": {
        "type": "object",
        "properties": {
          "instanceNoteTypeId": {
            "description": "ID of the type of note",
            "$ref": "uuid.json"
          },
          "note": {
            "type": "string",
            "description": "Text content of the note"
          },
          "staffOnly": {
            "type": "boolean",
            "description": "If true, determines that the note should not be visible for others than staff",
            "default": false
          }
        }
      }
    },
    "administrativeNotes": {
      "type": "array",
      "description": "Administrative notes",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "modeOfIssuanceId": {
      "type": "string",
      "description": "UUID of the RDA mode of issuance, a categorization reflecting whether a resource is issued in one or more parts, the way it is updated, and whether its termination is predetermined or not (e.g. monograph,  sequential monograph, serial; integrating Resource, other)",
      "$ref": "uuid.json"
    },
    "catalogedDate": {
      "type": "string",
      "description": "Date or timestamp on an instance for when is was considered cataloged"
    },
    "previouslyHeld": {
      "type": "boolean",
      "description": "Records the fact that the resource was previously held by the library for things like Hathi access, etc.",
      "default": false
    },
    "staffSuppress": {
      "type": "boolean",
      "description": "Records the fact that the record should not be displayed for others than catalogers"
    },
    "discoverySuppress": {
      "type": "boolean",
      "description": "Records the fact that the record should not be displayed in a discovery system",
      "default": false
    },
    "statisticalCodeIds": {
      "type": "array",
      "description": "List of statistical code IDs",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "sourceRecordFormat": {
      "type": "string",
      "description": "Format of the instance source record, if a source record exists (e.g. FOLIO if it's a record created in Inventory,  MARC if it's a MARC record created in MARCcat or EPKB if it's a record coming from eHoldings)",
      "enum": [
        "MARC-JSON"
      ],
      "readonly": true
    },
    "statusId": {
      "type": "string",
      "description": "UUID for the Instance status term (e.g. cataloged, uncatalogued, batch loaded, temporary, other, not yet assigned)",
      "$ref": "uuid.json"
    },
    "statusUpdatedDate": {
      "type": "string",
      "description": "Date [or timestamp] for when the instance status was updated"
    },
    "tags": {
      "description": "arbitrary tags associated with this instance",
      "id": "tags",
      "type": "object",
      "$ref": "raml-util/schemas/tags.schema"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    },
    "holdingsRecords2": {
      "type": "array",
      "description": "List of holdings records",
      "items": {
        "type": "object",
        "$ref": "holdingsrecord.json"
      },
      "readonly": true,
      "folio:isVirtual": true,
      "folio:linkBase": "holdings-storage/holdings",
      "folio:linkFromField": "id",
      "folio:linkToField": "instanceId",
      "folio:includedElement": "holdingsRecords"
    },
    "natureOfContentTermIds": {
      "type": "array",
      "description": "Array of UUID for the Instance nature of content (e.g. bibliography, biography, exhibition catalogue, festschrift, newspaper, proceedings, research report, thesis or website)",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "description": "Single UUID for the Instance nature of content",
        "$ref": "uuid.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "source",
    "title",
    "instanceTypeId"
  ]
}
modify_instanceRelationship(relationshipId: str, instanceRelationship: dict)

Update instanceRelationship item with given {instanceRelationshipId}

PUT /instance-storage/instance-relationships/{relationshipId}

Parameters
  • relationshipId (str) –

  • instanceRelationship (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A relationship of a given type between a super-instance and a sub-instance",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "superInstanceId": {
      "description": "ID (a UUID) of the super-instance. References an Instance record",
      "type": "string"
    },
    "subInstanceId": {
      "description": "ID (a UUID) of the sub-instance. References an Instance record",
      "type": "string"
    },
    "instanceRelationshipTypeId": {
      "description": "ID (a UUID) of the InstanceRelationshipType. References controlled vocabulary InstanceRelationshipTypes. Indicates the type of relationship between two Instance records.",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "superInstanceId",
    "subInstanceId",
    "instanceRelationshipTypeId"
  ]
}
modify_marcJson(instanceId: str, marcJson: dict)

Update marcJson item with given {marcJsonId}

PUT /instance-storage/instances/{instanceId}/source-record/marc-json

Parameters
  • instanceId (str) –

  • marcJson (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "MARC record representation, compatible with MarcEdit's JSON export and import",
  "type": "object",
  "properties": {
    "id": {
      "description": "id (UUID) of this MARC record, equals to the id of the instance record",
      "type": "string"
    },
    "leader": {
      "description": "The first field of a MARC record. Fixed length (24 characters). Data elements that primarily provide information for the processing of the record.",
      "type": "string",
      "minLength": 24,
      "maxLength": 24
    },
    "fields": {
      "description": "The variable fields of a MARC record, each identified by a three-character numeric tag.",
      "type": "array",
      "minItems": 2
    }
  },
  "additionalProperties": false,
  "required": [
    "leader",
    "fields"
  ]
}
modify_mods(instanceId: str)

PUT /instance-storage/instances/{instanceId}/source-record/mods

Parameters

instanceId (str) –

Raises

OkapiFatalError – Server Error

set_instance(instance: dict)

Create a new instance item.

POST /instance-storage/instances

Parameters

instance (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created instance item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An instance record",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the instance record; a UUID",
      "$ref": "uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "hrid": {
      "type": "string",
      "description": "The human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID"
    },
    "matchKey": {
      "type": "string",
      "description": "A unique instance identifier matching a client-side bibliographic record identification scheme, in particular for a scenario where multiple separate catalogs with no shared record identifiers contribute to the same Instance in Inventory. A match key is typically generated from select, normalized pieces of metadata in bibliographic records"
    },
    "source": {
      "type": "string",
      "description": "The metadata source and its format of the underlying record to the instance record. (e.g. FOLIO if it's a record created in Inventory;  MARC if it's a MARC record created in MARCcat or EPKB if it's a record coming from eHoldings)"
    },
    "title": {
      "type": "string",
      "description": "The primary title (or label) associated with the resource"
    },
    "indexTitle": {
      "type": "string",
      "description": "Title normalized for browsing and searching; based on the title with articles removed"
    },
    "alternativeTitles": {
      "type": "array",
      "description": "List of alternative titles for the resource (e.g. original language version title of a movie)",
      "items": {
        "type": "object",
        "properties": {
          "alternativeTitleTypeId": {
            "type": "string",
            "description": "UUID for an alternative title qualifier",
            "$ref": "uuid.json"
          },
          "alternativeTitle": {
            "type": "string",
            "description": "An alternative title for the resource"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls an alternative title",
            "$ref": "uuid.json"
          }
        }
      },
      "uniqueItems": true
    },
    "editions": {
      "type": "array",
      "description": "The edition statement, imprint and other publication source information",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "series": {
      "type": "array",
      "description": "List of series titles associated with the resource (e.g. Harry Potter)",
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Series title value"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls an series title",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      },
      "uniqueItems": true
    },
    "identifiers": {
      "type": "array",
      "description": "An extensible set of name-value pairs of identifiers associated with the resource",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Resource identifier value"
          },
          "identifierTypeId": {
            "type": "string",
            "description": "UUID of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)",
            "$ref": "uuid.json"
          },
          "identifierTypeObject": {
            "type": "object",
            "description": "Information about identifier type, looked up from identifierTypeId",
            "folio:$ref": "illpolicy.json",
            "readonly": true,
            "folio:isVirtual": true,
            "folio:linkBase": "identifier-types",
            "folio:linkFromField": "identifierTypeId",
            "folio:linkToField": "id",
            "folio:includedElement": "identifierTypes.0"
          }
        },
        "additionalProperties": false,
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "contributors": {
      "type": "array",
      "description": "List of contributors",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Personal name, corporate name, meeting name"
          },
          "contributorTypeId": {
            "type": "string",
            "description": "UUID for the contributor type term defined in controlled vocabulary",
            "$ref": "uuid.json"
          },
          "contributorTypeText": {
            "type": "string",
            "description": "Free text element for adding contributor type terms other that defined by the MARC code list for relators"
          },
          "contributorNameTypeId": {
            "type": "string",
            "description": "UUID of contributor name type term defined by the MARC code list for relators",
            "$ref": "uuid.json"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls the contributor",
            "$ref": "uuid.json"
          },
          "contributorNameType": {
            "type": "object",
            "description": "Dereferenced contributor-name type",
            "javaType": "org.folio.rest.jaxrs.model.contributorNameTypeVirtual",
            "folio:$ref": "contributornametype.json",
            "readonly": true,
            "folio:isVirtual": true,
            "folio:linkBase": "contributor-name-types",
            "folio:linkFromField": "contributorNameTypeId",
            "folio:linkToField": "id",
            "folio:includedElement": "contributorNameTypes.0"
          },
          "primary": {
            "type": "boolean",
            "description": "Whether this is the primary contributor"
          }
        },
        "additionalProperties": false,
        "required": [
          "name",
          "contributorNameTypeId"
        ]
      }
    },
    "subjects": {
      "type": "array",
      "description": "List of subject headings",
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Subject heading value"
          },
          "authorityId": {
            "type": "string",
            "description": "UUID of authority record that controls a subject heading",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      },
      "uniqueItems": true
    },
    "classifications": {
      "type": "array",
      "description": "List of classifications",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "classificationNumber": {
            "type": "string",
            "description": "Classification (e.g. classification scheme, classification schedule)"
          },
          "classificationTypeId": {
            "type": "string",
            "description": "UUID of classification schema (e.g. LC, Canadian Classification, NLM, National Agricultural Library, UDC, and Dewey)",
            "$ref": "uuid.json"
          },
          "classificationType": {
            "type": "object",
            "description": "Dereferenced classification schema",
            "javaType": "org.folio.rest.jaxrs.model.classificationTypeVirtual",
            "folio:$ref": "classificationtype.json",
            "readonly": true,
            "folio:isVirtual": true,
            "folio:linkBase": "classification-types",
            "folio:linkFromField": "classificationTypeId",
            "folio:linkToField": "id",
            "folio:includedElement": "classificationTypes.0"
          }
        },
        "additionalProperties": false,
        "required": [
          "classificationNumber",
          "classificationTypeId"
        ]
      }
    },
    "publication": {
      "type": "array",
      "description": "List of publication items",
      "items": {
        "type": "object",
        "properties": {
          "publisher": {
            "type": "string",
            "description": "Name of publisher, distributor, etc."
          },
          "place": {
            "type": "string",
            "description": "Place of publication, distribution, etc."
          },
          "dateOfPublication": {
            "type": "string",
            "description": "Date (year YYYY) of publication, distribution, etc."
          },
          "role": {
            "type": "string",
            "description": "The role of the publisher, distributor, etc."
          }
        }
      }
    },
    "publicationFrequency": {
      "type": "array",
      "description": "List of intervals at which a serial appears (e.g. daily, weekly, monthly, quarterly, etc.)",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "publicationRange": {
      "type": "array",
      "description": "The range of sequential designation/chronology of publication, or date range",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "publicationPeriod": {
      "type": "object",
      "description": "Publication period",
      "properties": {
        "start": {
          "type": "integer",
          "description": "Publication start year"
        },
        "end": {
          "type": "integer",
          "description": "Publication end year"
        }
      },
      "additionalProperties": false
    },
    "electronicAccess": {
      "type": "array",
      "description": "List of electronic access items",
      "items": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string",
            "description": "uniform resource identifier (URI) is a string of characters designed for unambiguous identification of resources"
          },
          "linkText": {
            "type": "string",
            "description": "The value of the MARC tag field 856 2nd indicator, where the values are: no information provided, resource, version of resource, related resource, no display constant generated"
          },
          "materialsSpecification": {
            "type": "string",
            "description": "Materials specified is used to specify to what portion or aspect of the resource the electronic location and access information applies (e.g. a portion or subset of the item is electronic, or a related electronic resource is being linked to the record)"
          },
          "publicNote": {
            "type": "string",
            "description": "URL public note to be displayed in the discovery"
          },
          "relationshipId": {
            "type": "string",
            "description": "UUID for the type of relationship between the electronic resource at the location identified and the item described in the record as a whole",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "uri"
        ]
      }
    },
    "instanceTypeId": {
      "type": "string",
      "description": "UUID of the unique term for the resource type whether it's from the RDA content term list of locally defined",
      "$ref": "uuid.json"
    },
    "instanceFormatIds": {
      "type": "array",
      "description": "UUIDs for the unique terms for the format whether it's from the RDA carrier term list of locally defined",
      "items": {
        "type": "string",
        "$ref": "uuid.json"
      }
    },
    "instanceFormats": {
      "type": "array",
      "description": "List of dereferenced instance formats",
      "items": {
        "type": "object",
        "$ref": "instanceformat.json"
      },
      "readonly": true,
      "folio:isVirtual": true,
      "folio:linkBase": "instance-formats",
      "folio:linkFromField": "instanceFormatIds",
      "folio:linkToField": "id",
      "folio:includedElement": "instanceFormats"
    },
    "physicalDescriptions": {
      "type": "array",
      "description": "Physical description of the described resource, including its extent, dimensions, and such other physical details as a description of any accompanying materials and unit type and size",
      "items": {
        "type": "string"
      }
    },
    "languages": {
      "type": "array",
      "description": "The set of languages used by the resource",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "notes": {
      "type": "array",
      "description": "Bibliographic notes (e.g. general notes, specialized notes)",
      "items": {
        "type": "object",
        "properties": {
          "instanceNoteTypeId": {
            "description": "ID of the type of note",
            "$ref": "uuid.json"
          },
          "note": {
            "type": "string",
            "description": "Text content of the note"
          },
          "staffOnly": {
            "type": "boolean",
            "description": "If true, determines that the note should not be visible for others than staff",
            "default": false
          }
        }
      }
    },
    "administrativeNotes": {
      "type": "array",
      "description": "Administrative notes",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "modeOfIssuanceId": {
      "type": "string",
      "description": "UUID of the RDA mode of issuance, a categorization reflecting whether a resource is issued in one or more parts, the way it is updated, and whether its termination is predetermined or not (e.g. monograph,  sequential monograph, serial; integrating Resource, other)",
      "$ref": "uuid.json"
    },
    "catalogedDate": {
      "type": "string",
      "description": "Date or timestamp on an instance for when is was considered cataloged"
    },
    "previouslyHeld": {
      "type": "boolean",
      "description": "Records the fact that the resource was previously held by the library for things like Hathi access, etc.",
      "default": false
    },
    "staffSuppress": {
      "type": "boolean",
      "description": "Records the fact that the record should not be displayed for others than catalogers"
    },
    "discoverySuppress": {
      "type": "boolean",
      "description": "Records the fact that the record should not be displayed in a discovery system",
      "default": false
    },
    "statisticalCodeIds": {
      "type": "array",
      "description": "List of statistical code IDs",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "sourceRecordFormat": {
      "type": "string",
      "description": "Format of the instance source record, if a source record exists (e.g. FOLIO if it's a record created in Inventory,  MARC if it's a MARC record created in MARCcat or EPKB if it's a record coming from eHoldings)",
      "enum": [
        "MARC-JSON"
      ],
      "readonly": true
    },
    "statusId": {
      "type": "string",
      "description": "UUID for the Instance status term (e.g. cataloged, uncatalogued, batch loaded, temporary, other, not yet assigned)",
      "$ref": "uuid.json"
    },
    "statusUpdatedDate": {
      "type": "string",
      "description": "Date [or timestamp] for when the instance status was updated"
    },
    "tags": {
      "description": "arbitrary tags associated with this instance",
      "id": "tags",
      "type": "object",
      "$ref": "raml-util/schemas/tags.schema"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    },
    "holdingsRecords2": {
      "type": "array",
      "description": "List of holdings records",
      "items": {
        "type": "object",
        "$ref": "holdingsrecord.json"
      },
      "readonly": true,
      "folio:isVirtual": true,
      "folio:linkBase": "holdings-storage/holdings",
      "folio:linkFromField": "id",
      "folio:linkToField": "instanceId",
      "folio:includedElement": "holdingsRecords"
    },
    "natureOfContentTermIds": {
      "type": "array",
      "description": "Array of UUID for the Instance nature of content (e.g. bibliography, biography, exhibition catalogue, festschrift, newspaper, proceedings, research report, thesis or website)",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "description": "Single UUID for the Instance nature of content",
        "$ref": "uuid.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "source",
    "title",
    "instanceTypeId"
  ]
}
set_instanceRelationship(instanceRelationship: dict)

Create a new instanceRelationship item.

POST /instance-storage/instance-relationships

Parameters

instanceRelationship (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created instanceRelationship item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A relationship of a given type between a super-instance and a sub-instance",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "superInstanceId": {
      "description": "ID (a UUID) of the super-instance. References an Instance record",
      "type": "string"
    },
    "subInstanceId": {
      "description": "ID (a UUID) of the sub-instance. References an Instance record",
      "type": "string"
    },
    "instanceRelationshipTypeId": {
      "description": "ID (a UUID) of the InstanceRelationshipType. References controlled vocabulary InstanceRelationshipTypes. Indicates the type of relationship between two Instance records.",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "superInstanceId",
    "subInstanceId",
    "instanceRelationshipTypeId"
  ]
}