SDK Models#

This documentation auto-generates details about the Pydantic models used in the SDK.

For the most part, these models are used to define the API interface.

Imports#

Import process classes for the Destiny SDK.

class libs.sdk.src.destiny_sdk.imports.CollisionStrategy(*values)[source]#

The strategy to use when an identifier collision is detected.

Identifier collisions are detected on identifier_type and identifier (and other_identifier_name where relevant) already present in the database.

Enhancement collisions are detected on an entry with matching enhancement_type and source already being present on the collided reference.

  • discard: Do nothing with the incoming reference.

  • fail: Do nothing with the incoming reference and mark it as failed. This allows the importing process to “follow up” on the failure.

  • merge_aggressive: Prioritize the incoming reference’s identifiers and enhancements in the merge.

  • merge_defensive: Prioritize the existing reference’s identifiers and enhancements in the merge.

  • append: Performs an aggressive merge of identifiers, and an append of enhancements.

  • overwrite: Performs an aggressive merge of identifiers, and an overwrite of enhancements (deleting existing and recreating what is imported). This should be used sparingly and carefully.

APPEND = 'append'[source]#
DISCARD = 'discard'[source]#
FAIL = 'fail'[source]#
MERGE_AGGRESSIVE = 'merge_aggressive'[source]#
MERGE_DEFENSIVE = 'merge_defensive'[source]#
OVERWRITE = 'overwrite'[source]#
pydantic model libs.sdk.src.destiny_sdk.imports.ImportBatchIn[source]#

Input for creating an import batch.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchIn"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportBatchIn</b></td></tr><tr><td>collision_strategy</td><td port="collision_strategy">CollisionStrategy</td></tr><tr><td>storage_url</td><td port="storage_url">HttpUrl</td></tr><tr><td>callback_url</td><td port="callback_url">HttpUrl | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportBatchIn&#xA;&#xA;Input for creating an import batch.&#xA;"];
}

Show JSON schema
{
   "title": "ImportBatchIn",
   "description": "Input for creating an import batch.",
   "type": "object",
   "properties": {
      "collision_strategy": {
         "$ref": "#/$defs/CollisionStrategy",
         "default": "fail",
         "description": "\nThe strategy to use for each reference when an identifier collision occurs.\nDefault is `fail`, which allows the importing process to \"follow up\" on the collision.\n        "
      },
      "storage_url": {
         "description": "\nThe URL at which the set of references for this batch are stored. The file is a jsonl\nwith each line formatted according to\n:class:`ReferenceFileInput <libs.sdk.src.destiny_sdk.references.ReferenceFileInput>`.\n    ",
         "format": "uri",
         "maxLength": 2083,
         "minLength": 1,
         "title": "Storage Url",
         "type": "string"
      },
      "callback_url": {
         "anyOf": [
            {
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\nThe URL to which the processor should send a callback when the batch has been processed.\n        ",
         "title": "Callback Url"
      }
   },
   "$defs": {
      "CollisionStrategy": {
         "description": "The strategy to use when an identifier collision is detected.\n\nIdentifier collisions are detected on ``identifier_type`` and ``identifier``\n(and ``other_identifier_name`` where relevant) already present in the database.\n\nEnhancement collisions are detected on an entry with matching ``enhancement_type``\nand ``source`` already being present on the collided reference.\n\n- `discard`: Do nothing with the incoming reference.\n- `fail`: Do nothing with the incoming reference and mark it as failed. This\n  allows the importing process to \"follow up\" on the failure.\n- `merge_aggressive`: Prioritize the incoming reference's identifiers and\n  enhancements in the merge.\n- `merge_defensive`: Prioritize the existing reference's identifiers and\n  enhancements in the merge.\n- `append`: Performs an aggressive merge of identifiers, and an append of\n  enhancements.\n- `overwrite`: Performs an aggressive merge of identifiers, and an overwrite of\n  enhancements (deleting existing and recreating what is imported). This should\n  be used sparingly and carefully.",
         "enum": [
            "discard",
            "fail",
            "merge_aggressive",
            "merge_defensive",
            "append",
            "overwrite"
         ],
         "title": "CollisionStrategy",
         "type": "string"
      }
   },
   "required": [
      "storage_url"
   ]
}

Fields:
field callback_url: HttpUrl | None = None[source]#

The URL to which the processor should send a callback when the batch has been processed.

field collision_strategy: CollisionStrategy = CollisionStrategy.FAIL[source]#

The strategy to use for each reference when an identifier collision occurs. Default is fail, which allows the importing process to “follow up” on the collision.

field storage_url: HttpUrl [Required][source]#

The URL at which the set of references for this batch are stored. The file is a jsonl with each line formatted according to ReferenceFileInput.

pydantic model libs.sdk.src.destiny_sdk.imports.ImportBatchRead[source]#

Core import batch class.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportBatchRead</b></td></tr><tr><td>collision_strategy</td><td port="collision_strategy">CollisionStrategy</td></tr><tr><td>storage_url</td><td port="storage_url">HttpUrl</td></tr><tr><td>callback_url</td><td port="callback_url">HttpUrl | None</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>status</td><td port="status">ImportBatchStatus</td></tr><tr><td>import_record_id</td><td port="import_record_id">UUID</td></tr><tr><td>import_record</td><td port="import_record">ImportRecordRead | None</td></tr><tr><td>import_results</td><td port="import_results">list[ImportResultRead] | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportBatchRead&#xA;&#xA;Core import batch class.&#xA;"];
   "libs.sdk.src.destiny_sdk.imports.ImportRecordRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportRecordRead</b></td></tr><tr><td>search_string</td><td port="search_string">str | None</td></tr><tr><td>searched_at</td><td port="searched_at">PastDatetime</td></tr><tr><td>processor_name</td><td port="processor_name">str</td></tr><tr><td>processor_version</td><td port="processor_version">str</td></tr><tr><td>notes</td><td port="notes">str | None</td></tr><tr><td>expected_reference_count</td><td port="expected_reference_count">int</td></tr><tr><td>source_name</td><td port="source_name">str</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>status</td><td port="status">ImportRecordStatus</td></tr><tr><td>batches</td><td port="batches">list[ImportBatchRead] | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportRecordRead&#xA;&#xA;Core import record class.&#xA;"];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":import_record:e -> "libs.sdk.src.destiny_sdk.imports.ImportRecordRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.imports.ImportResultRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportResultRead</b></td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>reference_id</td><td port="reference_id">Optional[UUID]</td></tr><tr><td>failure_details</td><td port="failure_details">str | None</td></tr><tr><td>import_batch</td><td port="import_batch">ImportBatchRead | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportResultRead&#xA;&#xA;Core import result class.&#xA;"];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":import_results:e -> "libs.sdk.src.destiny_sdk.imports.ImportResultRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.imports.ImportRecordRead":batches:e -> "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.imports.ImportResultRead":import_batch:e -> "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
}

Show JSON schema
{
   "$defs": {
      "CollisionStrategy": {
         "description": "The strategy to use when an identifier collision is detected.\n\nIdentifier collisions are detected on ``identifier_type`` and ``identifier``\n(and ``other_identifier_name`` where relevant) already present in the database.\n\nEnhancement collisions are detected on an entry with matching ``enhancement_type``\nand ``source`` already being present on the collided reference.\n\n- `discard`: Do nothing with the incoming reference.\n- `fail`: Do nothing with the incoming reference and mark it as failed. This\n  allows the importing process to \"follow up\" on the failure.\n- `merge_aggressive`: Prioritize the incoming reference's identifiers and\n  enhancements in the merge.\n- `merge_defensive`: Prioritize the existing reference's identifiers and\n  enhancements in the merge.\n- `append`: Performs an aggressive merge of identifiers, and an append of\n  enhancements.\n- `overwrite`: Performs an aggressive merge of identifiers, and an overwrite of\n  enhancements (deleting existing and recreating what is imported). This should\n  be used sparingly and carefully.",
         "enum": [
            "discard",
            "fail",
            "merge_aggressive",
            "merge_defensive",
            "append",
            "overwrite"
         ],
         "title": "CollisionStrategy",
         "type": "string"
      },
      "ImportBatchRead": {
         "description": "Core import batch class.",
         "properties": {
            "collision_strategy": {
               "$ref": "#/$defs/CollisionStrategy",
               "default": "fail",
               "description": "\nThe strategy to use for each reference when an identifier collision occurs.\nDefault is `fail`, which allows the importing process to \"follow up\" on the collision.\n        "
            },
            "storage_url": {
               "description": "\nThe URL at which the set of references for this batch are stored. The file is a jsonl\nwith each line formatted according to\n:class:`ReferenceFileInput <libs.sdk.src.destiny_sdk.references.ReferenceFileInput>`.\n    ",
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "title": "Storage Url",
               "type": "string"
            },
            "callback_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nThe URL to which the processor should send a callback when the batch has been processed.\n        ",
               "title": "Callback Url"
            },
            "id": {
               "description": "The ID of the import batch",
               "format": "uuid4",
               "title": "Id",
               "type": "string"
            },
            "status": {
               "$ref": "#/$defs/ImportBatchStatus",
               "default": "created",
               "description": "The status of the batch."
            },
            "import_record_id": {
               "description": "The ID of the import record this batch is associated with",
               "format": "uuid4",
               "title": "Import Record Id",
               "type": "string"
            },
            "import_record": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ImportRecordRead"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent import record."
            },
            "import_results": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ImportResultRead"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The results from processing the batch.",
               "title": "Import Results"
            }
         },
         "required": [
            "storage_url",
            "id",
            "import_record_id"
         ],
         "title": "ImportBatchRead",
         "type": "object"
      },
      "ImportBatchStatus": {
         "description": "Describes the status of an import batch.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `failed`: Processing has failed.\n- `retrying`: Processing has failed, but is being retried.\n- `indexing`: The imports have been saved and are being indexed.\n- `indexing_failed`: The imports have been saved but were not indexed.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.",
         "enum": [
            "created",
            "started",
            "retrying",
            "failed",
            "indexing",
            "indexing_failed",
            "completed",
            "cancelled"
         ],
         "title": "ImportBatchStatus",
         "type": "string"
      },
      "ImportRecordRead": {
         "description": "Core import record class.",
         "properties": {
            "search_string": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The search string used to produce this import",
               "title": "Search String"
            },
            "searched_at": {
               "description": "\nThe timestamp (including timezone) at which the search which produced\nthis import was conducted. If no timezone is included, the timestamp\nis assumed to be in UTC.\n        ",
               "format": "date-time",
               "title": "Searched At",
               "type": "string"
            },
            "processor_name": {
               "description": "The name of the processor that is importing the data.",
               "title": "Processor Name",
               "type": "string"
            },
            "processor_version": {
               "description": "The version of the processor that is importing the data.",
               "title": "Processor Version",
               "type": "string"
            },
            "notes": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nAny additional notes regarding the import (eg. reason for importing, known\nissues).\n        ",
               "title": "Notes"
            },
            "expected_reference_count": {
               "description": "\nThe number of references expected to be included in this import.\n-1 is accepted if the number is unknown.\n",
               "minimum": -1,
               "title": "Expected Reference Count",
               "type": "integer"
            },
            "source_name": {
               "description": "The source of the reference being imported (eg. Open Alex)",
               "title": "Source Name",
               "type": "string"
            },
            "id": {
               "description": "The ID of the import record",
               "format": "uuid4",
               "title": "Id",
               "type": "string"
            },
            "status": {
               "$ref": "#/$defs/ImportRecordStatus",
               "default": "created",
               "description": "The status of the import record"
            },
            "batches": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ImportBatchRead"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of batches for the import record",
               "title": "Batches"
            }
         },
         "required": [
            "processor_name",
            "processor_version",
            "expected_reference_count",
            "source_name",
            "id"
         ],
         "title": "ImportRecordRead",
         "type": "object"
      },
      "ImportRecordStatus": {
         "description": "Describes the status of an import record.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.",
         "enum": [
            "created",
            "started",
            "completed",
            "cancelled"
         ],
         "title": "ImportRecordStatus",
         "type": "string"
      },
      "ImportResultRead": {
         "description": "Core import result class.",
         "properties": {
            "id": {
               "description": "The ID of the import result.",
               "format": "uuid4",
               "title": "Id",
               "type": "string"
            },
            "reference_id": {
               "anyOf": [
                  {
                     "format": "uuid4",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ID of the reference created by this import result.",
               "title": "Reference Id"
            },
            "failure_details": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The details of the failure, if the import result failed.",
               "title": "Failure Details"
            },
            "import_batch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ImportBatchRead"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent import batch."
            }
         },
         "required": [
            "id"
         ],
         "title": "ImportResultRead",
         "type": "object"
      }
   },
   "$ref": "#/$defs/ImportBatchRead"
}

Fields:
field callback_url: HttpUrl | None = None[source]#

The URL to which the processor should send a callback when the batch has been processed.

field collision_strategy: CollisionStrategy = CollisionStrategy.FAIL[source]#

The strategy to use for each reference when an identifier collision occurs. Default is fail, which allows the importing process to “follow up” on the collision.

field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The ID of the import batch

Constraints:
  • uuid_version = 4

field import_record: ImportRecordRead | None = None[source]#

The parent import record.

field import_record_id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The ID of the import record this batch is associated with

Constraints:
  • uuid_version = 4

field import_results: list[ImportResultRead] | None = None[source]#

The results from processing the batch.

field status: ImportBatchStatus = ImportBatchStatus.CREATED[source]#

The status of the batch.

field storage_url: HttpUrl [Required][source]#

The URL at which the set of references for this batch are stored. The file is a jsonl with each line formatted according to ReferenceFileInput.

class libs.sdk.src.destiny_sdk.imports.ImportBatchStatus(*values)[source]#

Describes the status of an import batch.

  • created: Created, but no processing has started.

  • started: Processing has started on the batch.

  • failed: Processing has failed.

  • retrying: Processing has failed, but is being retried.

  • indexing: The imports have been saved and are being indexed.

  • indexing_failed: The imports have been saved but were not indexed.

  • completed: Processing has been completed.

  • cancelled: Processing was cancelled by calling the API.

CANCELLED = 'cancelled'[source]#
COMPLETED = 'completed'[source]#
CREATED = 'created'[source]#
FAILED = 'failed'[source]#
INDEXING = 'indexing'[source]#
INDEXING_FAILED = 'indexing_failed'[source]#
RETRYING = 'retrying'[source]#
STARTED = 'started'[source]#
pydantic model libs.sdk.src.destiny_sdk.imports.ImportBatchSummary[source]#

A view for an import batch that includes a summary of its results.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchSummary"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportBatchSummary</b></td></tr><tr><td>collision_strategy</td><td port="collision_strategy">CollisionStrategy</td></tr><tr><td>storage_url</td><td port="storage_url">HttpUrl</td></tr><tr><td>callback_url</td><td port="callback_url">HttpUrl | None</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>import_batch_id</td><td port="import_batch_id">UUID</td></tr><tr><td>import_batch_status</td><td port="import_batch_status">ImportBatchStatus</td></tr><tr><td>results</td><td port="results">dict[ImportResultStatus, int]</td></tr><tr><td>failure_details</td><td port="failure_details">list[str] | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportBatchSummary&#xA;&#xA;A view for an import batch that includes a summary of its results.&#\
xA;"];
}

Show JSON schema
{
   "title": "ImportBatchSummary",
   "description": "A view for an import batch that includes a summary of its results.",
   "type": "object",
   "properties": {
      "collision_strategy": {
         "$ref": "#/$defs/CollisionStrategy",
         "default": "fail",
         "description": "\nThe strategy to use for each reference when an identifier collision occurs.\nDefault is `fail`, which allows the importing process to \"follow up\" on the collision.\n        "
      },
      "storage_url": {
         "description": "\nThe URL at which the set of references for this batch are stored. The file is a jsonl\nwith each line formatted according to\n:class:`ReferenceFileInput <libs.sdk.src.destiny_sdk.references.ReferenceFileInput>`.\n    ",
         "format": "uri",
         "maxLength": 2083,
         "minLength": 1,
         "title": "Storage Url",
         "type": "string"
      },
      "callback_url": {
         "anyOf": [
            {
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\nThe URL to which the processor should send a callback when the batch has been processed.\n        ",
         "title": "Callback Url"
      },
      "id": {
         "description": "\nThe identifier of the batch.\n",
         "format": "uuid4",
         "title": "Id",
         "type": "string"
      },
      "import_batch_id": {
         "description": "The ID of the batch being summarised",
         "format": "uuid4",
         "title": "Import Batch Id",
         "type": "string"
      },
      "import_batch_status": {
         "$ref": "#/$defs/ImportBatchStatus",
         "description": "The status of the batch being summarised"
      },
      "results": {
         "additionalProperties": {
            "type": "integer"
         },
         "description": "A count of references by their current import status.",
         "propertyNames": {
            "$ref": "#/$defs/ImportResultStatus"
         },
         "title": "Results",
         "type": "object"
      },
      "failure_details": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "description": "\n        The details of the failures that occurred.\n        Each failure will start with `\"Entry x\"` where x is the line number of the\n        jsonl object attempted to be imported.\n        ",
         "title": "Failure Details"
      }
   },
   "$defs": {
      "CollisionStrategy": {
         "description": "The strategy to use when an identifier collision is detected.\n\nIdentifier collisions are detected on ``identifier_type`` and ``identifier``\n(and ``other_identifier_name`` where relevant) already present in the database.\n\nEnhancement collisions are detected on an entry with matching ``enhancement_type``\nand ``source`` already being present on the collided reference.\n\n- `discard`: Do nothing with the incoming reference.\n- `fail`: Do nothing with the incoming reference and mark it as failed. This\n  allows the importing process to \"follow up\" on the failure.\n- `merge_aggressive`: Prioritize the incoming reference's identifiers and\n  enhancements in the merge.\n- `merge_defensive`: Prioritize the existing reference's identifiers and\n  enhancements in the merge.\n- `append`: Performs an aggressive merge of identifiers, and an append of\n  enhancements.\n- `overwrite`: Performs an aggressive merge of identifiers, and an overwrite of\n  enhancements (deleting existing and recreating what is imported). This should\n  be used sparingly and carefully.",
         "enum": [
            "discard",
            "fail",
            "merge_aggressive",
            "merge_defensive",
            "append",
            "overwrite"
         ],
         "title": "CollisionStrategy",
         "type": "string"
      },
      "ImportBatchStatus": {
         "description": "Describes the status of an import batch.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `failed`: Processing has failed.\n- `retrying`: Processing has failed, but is being retried.\n- `indexing`: The imports have been saved and are being indexed.\n- `indexing_failed`: The imports have been saved but were not indexed.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.",
         "enum": [
            "created",
            "started",
            "retrying",
            "failed",
            "indexing",
            "indexing_failed",
            "completed",
            "cancelled"
         ],
         "title": "ImportBatchStatus",
         "type": "string"
      },
      "ImportResultStatus": {
         "description": "Describes the status of an import result.\n\n- `created`: Created, but no processing has started.\n- `started`: The reference is currently being processed.\n- `completed`: The reference has been created.\n- `partially_failed`: The reference was created but one or more enhancements or\n  identifiers failed to be added. See the result's `failure_details` field for\n  more information.\n- `failed`: The reference failed to be created. See the result's `failure_details`\n  field for more information.\n- `cancelled`: Processing was cancelled by calling the API.",
         "enum": [
            "created",
            "started",
            "completed",
            "cancelled",
            "partially_failed",
            "failed"
         ],
         "title": "ImportResultStatus",
         "type": "string"
      }
   },
   "required": [
      "storage_url",
      "id",
      "import_batch_id",
      "import_batch_status",
      "results",
      "failure_details"
   ]
}

Fields:
field callback_url: HttpUrl | None = None[source]#

The URL to which the processor should send a callback when the batch has been processed.

field collision_strategy: CollisionStrategy = CollisionStrategy.FAIL[source]#

The strategy to use for each reference when an identifier collision occurs. Default is fail, which allows the importing process to “follow up” on the collision.

field failure_details: list[str] | None [Required][source]#

The details of the failures that occurred. Each failure will start with “Entry x” where x is the line number of the jsonl object attempted to be imported.

field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The identifier of the batch.

Constraints:
  • uuid_version = 4

field import_batch_id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The ID of the batch being summarised

Constraints:
  • uuid_version = 4

field import_batch_status: ImportBatchStatus [Required][source]#

The status of the batch being summarised

field results: dict[ImportResultStatus, int] [Required][source]#

A count of references by their current import status.

field storage_url: HttpUrl [Required][source]#

The URL at which the set of references for this batch are stored. The file is a jsonl with each line formatted according to ReferenceFileInput.

pydantic model libs.sdk.src.destiny_sdk.imports.ImportRecordIn[source]#

Input for creating an import record.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.imports.ImportRecordIn"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportRecordIn</b></td></tr><tr><td>search_string</td><td port="search_string">str | None</td></tr><tr><td>searched_at</td><td port="searched_at">PastDatetime</td></tr><tr><td>processor_name</td><td port="processor_name">str</td></tr><tr><td>processor_version</td><td port="processor_version">str</td></tr><tr><td>notes</td><td port="notes">str | None</td></tr><tr><td>expected_reference_count</td><td port="expected_reference_count">int</td></tr><tr><td>source_name</td><td port="source_name">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportRecordIn&#xA;&#xA;Input for creating an import record.&#xA;"];
}

Show JSON schema
{
   "title": "ImportRecordIn",
   "description": "Input for creating an import record.",
   "type": "object",
   "properties": {
      "search_string": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The search string used to produce this import",
         "title": "Search String"
      },
      "searched_at": {
         "description": "\nThe timestamp (including timezone) at which the search which produced\nthis import was conducted. If no timezone is included, the timestamp\nis assumed to be in UTC.\n        ",
         "format": "date-time",
         "title": "Searched At",
         "type": "string"
      },
      "processor_name": {
         "description": "The name of the processor that is importing the data.",
         "title": "Processor Name",
         "type": "string"
      },
      "processor_version": {
         "description": "The version of the processor that is importing the data.",
         "title": "Processor Version",
         "type": "string"
      },
      "notes": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\nAny additional notes regarding the import (eg. reason for importing, known\nissues).\n        ",
         "title": "Notes"
      },
      "expected_reference_count": {
         "description": "\nThe number of references expected to be included in this import.\n-1 is accepted if the number is unknown.\n",
         "minimum": -1,
         "title": "Expected Reference Count",
         "type": "integer"
      },
      "source_name": {
         "description": "The source of the reference being imported (eg. Open Alex)",
         "title": "Source Name",
         "type": "string"
      }
   },
   "required": [
      "processor_name",
      "processor_version",
      "expected_reference_count",
      "source_name"
   ]
}

Fields:
field expected_reference_count: int [Required][source]#

The number of references expected to be included in this import. -1 is accepted if the number is unknown.

Constraints:
  • ge = -1

field notes: str | None = None[source]#

Any additional notes regarding the import (eg. reason for importing, known issues).

field processor_name: str [Required][source]#

The name of the processor that is importing the data.

field processor_version: str [Required][source]#

The version of the processor that is importing the data.

field search_string: str | None = None[source]#

The search string used to produce this import

field searched_at: PastDatetime [Optional][source]#

The timestamp (including timezone) at which the search which produced this import was conducted. If no timezone is included, the timestamp is assumed to be in UTC.

field source_name: str [Required][source]#

The source of the reference being imported (eg. Open Alex)

pydantic model libs.sdk.src.destiny_sdk.imports.ImportRecordRead[source]#

Core import record class.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportBatchRead</b></td></tr><tr><td>collision_strategy</td><td port="collision_strategy">CollisionStrategy</td></tr><tr><td>storage_url</td><td port="storage_url">HttpUrl</td></tr><tr><td>callback_url</td><td port="callback_url">HttpUrl | None</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>status</td><td port="status">ImportBatchStatus</td></tr><tr><td>import_record_id</td><td port="import_record_id">UUID</td></tr><tr><td>import_record</td><td port="import_record">ImportRecordRead | None</td></tr><tr><td>import_results</td><td port="import_results">list[ImportResultRead] | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportBatchRead&#xA;&#xA;Core import batch class.&#xA;"];
   "libs.sdk.src.destiny_sdk.imports.ImportRecordRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportRecordRead</b></td></tr><tr><td>search_string</td><td port="search_string">str | None</td></tr><tr><td>searched_at</td><td port="searched_at">PastDatetime</td></tr><tr><td>processor_name</td><td port="processor_name">str</td></tr><tr><td>processor_version</td><td port="processor_version">str</td></tr><tr><td>notes</td><td port="notes">str | None</td></tr><tr><td>expected_reference_count</td><td port="expected_reference_count">int</td></tr><tr><td>source_name</td><td port="source_name">str</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>status</td><td port="status">ImportRecordStatus</td></tr><tr><td>batches</td><td port="batches">list[ImportBatchRead] | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportRecordRead&#xA;&#xA;Core import record class.&#xA;"];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":import_record:e -> "libs.sdk.src.destiny_sdk.imports.ImportRecordRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.imports.ImportResultRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportResultRead</b></td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>reference_id</td><td port="reference_id">Optional[UUID]</td></tr><tr><td>failure_details</td><td port="failure_details">str | None</td></tr><tr><td>import_batch</td><td port="import_batch">ImportBatchRead | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportResultRead&#xA;&#xA;Core import result class.&#xA;"];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":import_results:e -> "libs.sdk.src.destiny_sdk.imports.ImportResultRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.imports.ImportRecordRead":batches:e -> "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.imports.ImportResultRead":import_batch:e -> "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
}

Show JSON schema
{
   "$defs": {
      "CollisionStrategy": {
         "description": "The strategy to use when an identifier collision is detected.\n\nIdentifier collisions are detected on ``identifier_type`` and ``identifier``\n(and ``other_identifier_name`` where relevant) already present in the database.\n\nEnhancement collisions are detected on an entry with matching ``enhancement_type``\nand ``source`` already being present on the collided reference.\n\n- `discard`: Do nothing with the incoming reference.\n- `fail`: Do nothing with the incoming reference and mark it as failed. This\n  allows the importing process to \"follow up\" on the failure.\n- `merge_aggressive`: Prioritize the incoming reference's identifiers and\n  enhancements in the merge.\n- `merge_defensive`: Prioritize the existing reference's identifiers and\n  enhancements in the merge.\n- `append`: Performs an aggressive merge of identifiers, and an append of\n  enhancements.\n- `overwrite`: Performs an aggressive merge of identifiers, and an overwrite of\n  enhancements (deleting existing and recreating what is imported). This should\n  be used sparingly and carefully.",
         "enum": [
            "discard",
            "fail",
            "merge_aggressive",
            "merge_defensive",
            "append",
            "overwrite"
         ],
         "title": "CollisionStrategy",
         "type": "string"
      },
      "ImportBatchRead": {
         "description": "Core import batch class.",
         "properties": {
            "collision_strategy": {
               "$ref": "#/$defs/CollisionStrategy",
               "default": "fail",
               "description": "\nThe strategy to use for each reference when an identifier collision occurs.\nDefault is `fail`, which allows the importing process to \"follow up\" on the collision.\n        "
            },
            "storage_url": {
               "description": "\nThe URL at which the set of references for this batch are stored. The file is a jsonl\nwith each line formatted according to\n:class:`ReferenceFileInput <libs.sdk.src.destiny_sdk.references.ReferenceFileInput>`.\n    ",
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "title": "Storage Url",
               "type": "string"
            },
            "callback_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nThe URL to which the processor should send a callback when the batch has been processed.\n        ",
               "title": "Callback Url"
            },
            "id": {
               "description": "The ID of the import batch",
               "format": "uuid4",
               "title": "Id",
               "type": "string"
            },
            "status": {
               "$ref": "#/$defs/ImportBatchStatus",
               "default": "created",
               "description": "The status of the batch."
            },
            "import_record_id": {
               "description": "The ID of the import record this batch is associated with",
               "format": "uuid4",
               "title": "Import Record Id",
               "type": "string"
            },
            "import_record": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ImportRecordRead"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent import record."
            },
            "import_results": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ImportResultRead"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The results from processing the batch.",
               "title": "Import Results"
            }
         },
         "required": [
            "storage_url",
            "id",
            "import_record_id"
         ],
         "title": "ImportBatchRead",
         "type": "object"
      },
      "ImportBatchStatus": {
         "description": "Describes the status of an import batch.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `failed`: Processing has failed.\n- `retrying`: Processing has failed, but is being retried.\n- `indexing`: The imports have been saved and are being indexed.\n- `indexing_failed`: The imports have been saved but were not indexed.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.",
         "enum": [
            "created",
            "started",
            "retrying",
            "failed",
            "indexing",
            "indexing_failed",
            "completed",
            "cancelled"
         ],
         "title": "ImportBatchStatus",
         "type": "string"
      },
      "ImportRecordRead": {
         "description": "Core import record class.",
         "properties": {
            "search_string": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The search string used to produce this import",
               "title": "Search String"
            },
            "searched_at": {
               "description": "\nThe timestamp (including timezone) at which the search which produced\nthis import was conducted. If no timezone is included, the timestamp\nis assumed to be in UTC.\n        ",
               "format": "date-time",
               "title": "Searched At",
               "type": "string"
            },
            "processor_name": {
               "description": "The name of the processor that is importing the data.",
               "title": "Processor Name",
               "type": "string"
            },
            "processor_version": {
               "description": "The version of the processor that is importing the data.",
               "title": "Processor Version",
               "type": "string"
            },
            "notes": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nAny additional notes regarding the import (eg. reason for importing, known\nissues).\n        ",
               "title": "Notes"
            },
            "expected_reference_count": {
               "description": "\nThe number of references expected to be included in this import.\n-1 is accepted if the number is unknown.\n",
               "minimum": -1,
               "title": "Expected Reference Count",
               "type": "integer"
            },
            "source_name": {
               "description": "The source of the reference being imported (eg. Open Alex)",
               "title": "Source Name",
               "type": "string"
            },
            "id": {
               "description": "The ID of the import record",
               "format": "uuid4",
               "title": "Id",
               "type": "string"
            },
            "status": {
               "$ref": "#/$defs/ImportRecordStatus",
               "default": "created",
               "description": "The status of the import record"
            },
            "batches": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ImportBatchRead"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of batches for the import record",
               "title": "Batches"
            }
         },
         "required": [
            "processor_name",
            "processor_version",
            "expected_reference_count",
            "source_name",
            "id"
         ],
         "title": "ImportRecordRead",
         "type": "object"
      },
      "ImportRecordStatus": {
         "description": "Describes the status of an import record.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.",
         "enum": [
            "created",
            "started",
            "completed",
            "cancelled"
         ],
         "title": "ImportRecordStatus",
         "type": "string"
      },
      "ImportResultRead": {
         "description": "Core import result class.",
         "properties": {
            "id": {
               "description": "The ID of the import result.",
               "format": "uuid4",
               "title": "Id",
               "type": "string"
            },
            "reference_id": {
               "anyOf": [
                  {
                     "format": "uuid4",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ID of the reference created by this import result.",
               "title": "Reference Id"
            },
            "failure_details": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The details of the failure, if the import result failed.",
               "title": "Failure Details"
            },
            "import_batch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ImportBatchRead"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent import batch."
            }
         },
         "required": [
            "id"
         ],
         "title": "ImportResultRead",
         "type": "object"
      }
   },
   "$ref": "#/$defs/ImportRecordRead"
}

Fields:
field batches: list[ImportBatchRead] | None = None[source]#

A list of batches for the import record

field expected_reference_count: int [Required][source]#

The number of references expected to be included in this import. -1 is accepted if the number is unknown.

Constraints:
  • ge = -1

field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The ID of the import record

Constraints:
  • uuid_version = 4

field notes: str | None = None[source]#

Any additional notes regarding the import (eg. reason for importing, known issues).

field processor_name: str [Required][source]#

The name of the processor that is importing the data.

field processor_version: str [Required][source]#

The version of the processor that is importing the data.

field search_string: str | None = None[source]#

The search string used to produce this import

field searched_at: PastDatetime [Optional][source]#

The timestamp (including timezone) at which the search which produced this import was conducted. If no timezone is included, the timestamp is assumed to be in UTC.

field source_name: str [Required][source]#

The source of the reference being imported (eg. Open Alex)

field status: ImportRecordStatus = ImportRecordStatus.CREATED[source]#

The status of the import record

class libs.sdk.src.destiny_sdk.imports.ImportRecordStatus(*values)[source]#

Describes the status of an import record.

  • created: Created, but no processing has started.

  • started: Processing has started on the batch.

  • completed: Processing has been completed.

  • cancelled: Processing was cancelled by calling the API.

CANCELLED = 'cancelled'[source]#
COMPLETED = 'completed'[source]#
CREATED = 'created'[source]#
STARTED = 'started'[source]#
pydantic model libs.sdk.src.destiny_sdk.imports.ImportResultRead[source]#

Core import result class.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportBatchRead</b></td></tr><tr><td>collision_strategy</td><td port="collision_strategy">CollisionStrategy</td></tr><tr><td>storage_url</td><td port="storage_url">HttpUrl</td></tr><tr><td>callback_url</td><td port="callback_url">HttpUrl | None</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>status</td><td port="status">ImportBatchStatus</td></tr><tr><td>import_record_id</td><td port="import_record_id">UUID</td></tr><tr><td>import_record</td><td port="import_record">ImportRecordRead | None</td></tr><tr><td>import_results</td><td port="import_results">list[ImportResultRead] | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportBatchRead&#xA;&#xA;Core import batch class.&#xA;"];
   "libs.sdk.src.destiny_sdk.imports.ImportRecordRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportRecordRead</b></td></tr><tr><td>search_string</td><td port="search_string">str | None</td></tr><tr><td>searched_at</td><td port="searched_at">PastDatetime</td></tr><tr><td>processor_name</td><td port="processor_name">str</td></tr><tr><td>processor_version</td><td port="processor_version">str</td></tr><tr><td>notes</td><td port="notes">str | None</td></tr><tr><td>expected_reference_count</td><td port="expected_reference_count">int</td></tr><tr><td>source_name</td><td port="source_name">str</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>status</td><td port="status">ImportRecordStatus</td></tr><tr><td>batches</td><td port="batches">list[ImportBatchRead] | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportRecordRead&#xA;&#xA;Core import record class.&#xA;"];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":import_record:e -> "libs.sdk.src.destiny_sdk.imports.ImportRecordRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.imports.ImportResultRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ImportResultRead</b></td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>reference_id</td><td port="reference_id">Optional[UUID]</td></tr><tr><td>failure_details</td><td port="failure_details">str | None</td></tr><tr><td>import_batch</td><td port="import_batch">ImportBatchRead | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.imports.ImportResultRead&#xA;&#xA;Core import result class.&#xA;"];
   "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":import_results:e -> "libs.sdk.src.destiny_sdk.imports.ImportResultRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.imports.ImportRecordRead":batches:e -> "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.imports.ImportResultRead":import_batch:e -> "libs.sdk.src.destiny_sdk.imports.ImportBatchRead":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
}

Show JSON schema
{
   "$defs": {
      "CollisionStrategy": {
         "description": "The strategy to use when an identifier collision is detected.\n\nIdentifier collisions are detected on ``identifier_type`` and ``identifier``\n(and ``other_identifier_name`` where relevant) already present in the database.\n\nEnhancement collisions are detected on an entry with matching ``enhancement_type``\nand ``source`` already being present on the collided reference.\n\n- `discard`: Do nothing with the incoming reference.\n- `fail`: Do nothing with the incoming reference and mark it as failed. This\n  allows the importing process to \"follow up\" on the failure.\n- `merge_aggressive`: Prioritize the incoming reference's identifiers and\n  enhancements in the merge.\n- `merge_defensive`: Prioritize the existing reference's identifiers and\n  enhancements in the merge.\n- `append`: Performs an aggressive merge of identifiers, and an append of\n  enhancements.\n- `overwrite`: Performs an aggressive merge of identifiers, and an overwrite of\n  enhancements (deleting existing and recreating what is imported). This should\n  be used sparingly and carefully.",
         "enum": [
            "discard",
            "fail",
            "merge_aggressive",
            "merge_defensive",
            "append",
            "overwrite"
         ],
         "title": "CollisionStrategy",
         "type": "string"
      },
      "ImportBatchRead": {
         "description": "Core import batch class.",
         "properties": {
            "collision_strategy": {
               "$ref": "#/$defs/CollisionStrategy",
               "default": "fail",
               "description": "\nThe strategy to use for each reference when an identifier collision occurs.\nDefault is `fail`, which allows the importing process to \"follow up\" on the collision.\n        "
            },
            "storage_url": {
               "description": "\nThe URL at which the set of references for this batch are stored. The file is a jsonl\nwith each line formatted according to\n:class:`ReferenceFileInput <libs.sdk.src.destiny_sdk.references.ReferenceFileInput>`.\n    ",
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "title": "Storage Url",
               "type": "string"
            },
            "callback_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nThe URL to which the processor should send a callback when the batch has been processed.\n        ",
               "title": "Callback Url"
            },
            "id": {
               "description": "The ID of the import batch",
               "format": "uuid4",
               "title": "Id",
               "type": "string"
            },
            "status": {
               "$ref": "#/$defs/ImportBatchStatus",
               "default": "created",
               "description": "The status of the batch."
            },
            "import_record_id": {
               "description": "The ID of the import record this batch is associated with",
               "format": "uuid4",
               "title": "Import Record Id",
               "type": "string"
            },
            "import_record": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ImportRecordRead"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent import record."
            },
            "import_results": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ImportResultRead"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The results from processing the batch.",
               "title": "Import Results"
            }
         },
         "required": [
            "storage_url",
            "id",
            "import_record_id"
         ],
         "title": "ImportBatchRead",
         "type": "object"
      },
      "ImportBatchStatus": {
         "description": "Describes the status of an import batch.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `failed`: Processing has failed.\n- `retrying`: Processing has failed, but is being retried.\n- `indexing`: The imports have been saved and are being indexed.\n- `indexing_failed`: The imports have been saved but were not indexed.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.",
         "enum": [
            "created",
            "started",
            "retrying",
            "failed",
            "indexing",
            "indexing_failed",
            "completed",
            "cancelled"
         ],
         "title": "ImportBatchStatus",
         "type": "string"
      },
      "ImportRecordRead": {
         "description": "Core import record class.",
         "properties": {
            "search_string": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The search string used to produce this import",
               "title": "Search String"
            },
            "searched_at": {
               "description": "\nThe timestamp (including timezone) at which the search which produced\nthis import was conducted. If no timezone is included, the timestamp\nis assumed to be in UTC.\n        ",
               "format": "date-time",
               "title": "Searched At",
               "type": "string"
            },
            "processor_name": {
               "description": "The name of the processor that is importing the data.",
               "title": "Processor Name",
               "type": "string"
            },
            "processor_version": {
               "description": "The version of the processor that is importing the data.",
               "title": "Processor Version",
               "type": "string"
            },
            "notes": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nAny additional notes regarding the import (eg. reason for importing, known\nissues).\n        ",
               "title": "Notes"
            },
            "expected_reference_count": {
               "description": "\nThe number of references expected to be included in this import.\n-1 is accepted if the number is unknown.\n",
               "minimum": -1,
               "title": "Expected Reference Count",
               "type": "integer"
            },
            "source_name": {
               "description": "The source of the reference being imported (eg. Open Alex)",
               "title": "Source Name",
               "type": "string"
            },
            "id": {
               "description": "The ID of the import record",
               "format": "uuid4",
               "title": "Id",
               "type": "string"
            },
            "status": {
               "$ref": "#/$defs/ImportRecordStatus",
               "default": "created",
               "description": "The status of the import record"
            },
            "batches": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ImportBatchRead"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of batches for the import record",
               "title": "Batches"
            }
         },
         "required": [
            "processor_name",
            "processor_version",
            "expected_reference_count",
            "source_name",
            "id"
         ],
         "title": "ImportRecordRead",
         "type": "object"
      },
      "ImportRecordStatus": {
         "description": "Describes the status of an import record.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.",
         "enum": [
            "created",
            "started",
            "completed",
            "cancelled"
         ],
         "title": "ImportRecordStatus",
         "type": "string"
      },
      "ImportResultRead": {
         "description": "Core import result class.",
         "properties": {
            "id": {
               "description": "The ID of the import result.",
               "format": "uuid4",
               "title": "Id",
               "type": "string"
            },
            "reference_id": {
               "anyOf": [
                  {
                     "format": "uuid4",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ID of the reference created by this import result.",
               "title": "Reference Id"
            },
            "failure_details": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The details of the failure, if the import result failed.",
               "title": "Failure Details"
            },
            "import_batch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ImportBatchRead"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent import batch."
            }
         },
         "required": [
            "id"
         ],
         "title": "ImportResultRead",
         "type": "object"
      }
   },
   "$ref": "#/$defs/ImportResultRead"
}

Fields:
field failure_details: str | None = None[source]#

The details of the failure, if the import result failed.

field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The ID of the import result.

Constraints:
  • uuid_version = 4

field import_batch: ImportBatchRead | None = None[source]#

The parent import batch.

field reference_id: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None[source]#

The ID of the reference created by this import result.

class libs.sdk.src.destiny_sdk.imports.ImportResultStatus(*values)[source]#

Describes the status of an import result.

  • created: Created, but no processing has started.

  • started: The reference is currently being processed.

  • completed: The reference has been created.

  • partially_failed: The reference was created but one or more enhancements or identifiers failed to be added. See the result’s failure_details field for more information.

  • failed: The reference failed to be created. See the result’s failure_details field for more information.

  • cancelled: Processing was cancelled by calling the API.

CANCELLED = 'cancelled'[source]#
COMPLETED = 'completed'[source]#
CREATED = 'created'[source]#
FAILED = 'failed'[source]#
PARTIALLY_FAILED = 'partially_failed'[source]#
STARTED = 'started'[source]#

Visibility#

Visibility enum for repository data.

class libs.sdk.src.destiny_sdk.visibility.Visibility(*values)[source]#

The visibility of a data element in the repository.

This is used to manage whether information should be publicly available or restricted (generally due to copyright constraints from publishers).

TODO: Implement data governance layer to manage this.

Allowed values:

  • public: Visible to the general public without authentication.

  • restricted: Requires authentication to be visible.

  • hidden: Is not visible, but may be passed to data mining processes.

HIDDEN = 'hidden'[source]#
PUBLIC = 'public'[source]#
RESTRICTED = 'restricted'[source]#

Robots#

Schemas that define inputs/outputs for robots.

pydantic model libs.sdk.src.destiny_sdk.robots.BatchEnhancementRequestIn[source]#

The model for requesting multiple enhancements on specific references.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.BatchEnhancementRequestIn"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BatchEnhancementRequestIn</b></td></tr><tr><td>robot_id</td><td port="robot_id">UUID</td></tr><tr><td>reference_ids</td><td port="reference_ids">list[UUID]</td></tr><tr><td>source</td><td port="source">str | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.BatchEnhancementRequestIn&#xA;&#xA;The model for requesting multiple enhancements on specific references.&#\
xA;"];
}

Show JSON schema
{
   "title": "BatchEnhancementRequestIn",
   "description": "The model for requesting multiple enhancements on specific references.",
   "type": "object",
   "properties": {
      "robot_id": {
         "description": "The robot to be used to create the enhancements.",
         "format": "uuid4",
         "title": "Robot Id",
         "type": "string"
      },
      "reference_ids": {
         "description": "The IDs of the references to be enhanced.",
         "items": {
            "format": "uuid4",
            "type": "string"
         },
         "title": "Reference Ids",
         "type": "array"
      },
      "source": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The source of the batch enhancement request.",
         "title": "Source"
      }
   },
   "required": [
      "robot_id",
      "reference_ids"
   ]
}

Fields:
field reference_ids: list[UUID4] [Required][source]#

The IDs of the references to be enhanced.

field robot_id: UUID4 [Required][source]#

The robot to be used to create the enhancements.

Constraints:
  • uuid_version = 4

field source: str | None = None[source]#

The source of the batch enhancement request.

pydantic model libs.sdk.src.destiny_sdk.robots.BatchEnhancementRequestRead[source]#

Core batch enhancement request class.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.BatchEnhancementRequestRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BatchEnhancementRequestRead</b></td></tr><tr><td>robot_id</td><td port="robot_id">UUID</td></tr><tr><td>reference_ids</td><td port="reference_ids">list[UUID]</td></tr><tr><td>source</td><td port="source">str | None</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>request_status</td><td port="request_status">BatchEnhancementRequestStatus</td></tr><tr><td>reference_data_url</td><td port="reference_data_url">HttpUrl | None</td></tr><tr><td>result_storage_url</td><td port="result_storage_url">HttpUrl | None</td></tr><tr><td>validation_result_url</td><td port="validation_result_url">HttpUrl | None</td></tr><tr><td>error</td><td port="error">str | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.BatchEnhancementRequestRead&#xA;&#xA;Core batch enhancement request class.&#xA;"];
}

Show JSON schema
{
   "title": "BatchEnhancementRequestRead",
   "description": "Core batch enhancement request class.",
   "type": "object",
   "properties": {
      "robot_id": {
         "description": "The robot to be used to create the enhancements.",
         "format": "uuid4",
         "title": "Robot Id",
         "type": "string"
      },
      "reference_ids": {
         "description": "The IDs of the references to be enhanced.",
         "items": {
            "format": "uuid4",
            "type": "string"
         },
         "title": "Reference Ids",
         "type": "array"
      },
      "source": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The source of the batch enhancement request.",
         "title": "Source"
      },
      "id": {
         "format": "uuid4",
         "title": "Id",
         "type": "string"
      },
      "request_status": {
         "$ref": "#/$defs/BatchEnhancementRequestStatus",
         "description": "The status of the request to create enhancements"
      },
      "reference_data_url": {
         "anyOf": [
            {
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\nThe URL at which the set of references are stored. The file is a jsonl with each line\nformatted according to\n:class:`Reference <libs.sdk.src.destiny_sdk.references.Reference>`.\n, one reference per line.\nEach reference may have identifiers or enhancements attached, as\nrequired by the robot.\nIf the URL expires, a new one can be generated using\n``GET /references/enhancement/batch/<batch_request_id>``.\n        ",
         "title": "Reference Data Url"
      },
      "result_storage_url": {
         "anyOf": [
            {
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\nThe URL at which the set of enhancements are stored. The file is to be a jsonl\nwith each line formatted according to\n:class:`BatchEnhancementResultEntry <libs.sdk.src.destiny_sdk.robots.BatchEnhancementResultEntry>`.\nThis field is only relevant to robots.\nIf the URL expires, a new one can be generated using\n``GET /references/enhancement/batch/<batch_request_id>``.\n        ",
         "title": "Result Storage Url"
      },
      "validation_result_url": {
         "anyOf": [
            {
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\nThe URL at which the result of the batch enhancement request is stored.\nThis file is a txt file, one line per reference, with either an error\nor a success message.\nIf the URL expires, a new one can be generated using\n``GET /references/enhancement/batch/<batch_request_id>``.\n        ",
         "title": "Validation Result Url"
      },
      "error": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Error encountered during the enhancement process. This is only used if the entire batch enhancement request failed, rather than an individual reference. If there was an error with processing an individual reference, it is passed in the validation result file.",
         "title": "Error"
      }
   },
   "$defs": {
      "BatchEnhancementRequestStatus": {
         "description": "The status of an enhancement request.\n\n**Allowed values**:\n- `received`: Enhancement request has been received by the repo.\n- `accepted`: Enhancement request has been accepted by the robot.\n- `rejected`: Enhancement request has been rejected by the robot.\n- `partial_failed`: Some enhancements failed to create.\n- `failed`: All enhancements failed to create.\n- `importing`: Enhancements have been received by the repo and are being imported.\n- `indexing`: Enhancements have been imported and are being indexed.\n- `indexing_failed`: Enhancements have been imported but indexing failed.\n- `completed`: All enhancements have been created.",
         "enum": [
            "received",
            "accepted",
            "rejected",
            "partial_failed",
            "failed",
            "importing",
            "indexing",
            "indexing_failed",
            "completed"
         ],
         "title": "BatchEnhancementRequestStatus",
         "type": "string"
      }
   },
   "required": [
      "robot_id",
      "reference_ids",
      "id",
      "request_status"
   ]
}

Fields:
field error: str | None = None[source]#

Error encountered during the enhancement process. This is only used if the entire batch enhancement request failed, rather than an individual reference. If there was an error with processing an individual reference, it is passed in the validation result file.

field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#
Constraints:
  • uuid_version = 4

field reference_data_url: HttpUrl | None = None[source]#

The URL at which the set of references are stored. The file is a jsonl with each line formatted according to Reference. , one reference per line. Each reference may have identifiers or enhancements attached, as required by the robot. If the URL expires, a new one can be generated using GET /references/enhancement/batch/<batch_request_id>.

field reference_ids: list[UUID4] [Required][source]#

The IDs of the references to be enhanced.

field request_status: BatchEnhancementRequestStatus [Required][source]#

The status of the request to create enhancements

field result_storage_url: HttpUrl | None = None[source]#

The URL at which the set of enhancements are stored. The file is to be a jsonl with each line formatted according to BatchEnhancementResultEntry. This field is only relevant to robots. If the URL expires, a new one can be generated using GET /references/enhancement/batch/<batch_request_id>.

field robot_id: UUID4 [Required][source]#

The robot to be used to create the enhancements.

Constraints:
  • uuid_version = 4

field source: str | None = None[source]#

The source of the batch enhancement request.

field validation_result_url: HttpUrl | None = None[source]#

The URL at which the result of the batch enhancement request is stored. This file is a txt file, one line per reference, with either an error or a success message. If the URL expires, a new one can be generated using GET /references/enhancement/batch/<batch_request_id>.

class libs.sdk.src.destiny_sdk.robots.BatchEnhancementRequestStatus(*values)[source]#

The status of an enhancement request.

Allowed values: - received: Enhancement request has been received by the repo. - accepted: Enhancement request has been accepted by the robot. - rejected: Enhancement request has been rejected by the robot. - partial_failed: Some enhancements failed to create. - failed: All enhancements failed to create. - importing: Enhancements have been received by the repo and are being imported. - indexing: Enhancements have been imported and are being indexed. - indexing_failed: Enhancements have been imported but indexing failed. - completed: All enhancements have been created.

ACCEPTED = 'accepted'[source]#
COMPLETED = 'completed'[source]#
FAILED = 'failed'[source]#
IMPORTING = 'importing'[source]#
INDEXING = 'indexing'[source]#
INDEXING_FAILED = 'indexing_failed'[source]#
PARTIAL_FAILED = 'partial_failed'[source]#
RECEIVED = 'received'[source]#
REJECTED = 'rejected'[source]#
libs.sdk.src.destiny_sdk.robots.BatchEnhancementResultEntry[source]#

The result for a single reference when processed by a batch enhancement request. This is a single entry in the result file.

alias of Annotated[Enhancement | LinkedRobotError, FieldInfo(annotation=NoneType, required=True)]

pydantic model libs.sdk.src.destiny_sdk.robots.BatchRobotRequest[source]#

A batch enhancement request from the repo to a robot.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.BatchRobotRequest"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BatchRobotRequest</b></td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>reference_storage_url</td><td port="reference_storage_url">HttpUrl</td></tr><tr><td>result_storage_url</td><td port="result_storage_url">HttpUrl</td></tr><tr><td>extra_fields</td><td port="extra_fields">dict | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.BatchRobotRequest&#xA;&#xA;A batch enhancement request from the repo to a robot.&#xA;"];
}

Show JSON schema
{
   "title": "BatchRobotRequest",
   "description": "A batch enhancement request from the repo to a robot.",
   "type": "object",
   "properties": {
      "id": {
         "format": "uuid4",
         "title": "Id",
         "type": "string"
      },
      "reference_storage_url": {
         "description": "\nThe URL at which the set of references are stored. The file is a jsonl\nwith each line formatted according to\n:class:`Reference <libs.sdk.src.destiny_sdk.references.Reference>`, one\nreference per line.\nEach reference may have identifiers or enhancements attached, as\nrequired by the robot.\nIf the URL expires, a new one can be generated using\n``GET /references/enhancement/batch/<batch_request_id>``.\n",
         "format": "uri",
         "maxLength": 2083,
         "minLength": 1,
         "title": "Reference Storage Url",
         "type": "string"
      },
      "result_storage_url": {
         "description": "\nThe URL at which the set of enhancements are to be stored. The file is to be a jsonl\nwith each line formatted according to\n:class:`BatchEnhancementResultEntry <libs.sdk.src.destiny_sdk.robots.BatchEnhancementResultEntry>`.\nIf the URL expires, a new one can be generated using\n``GET /references/enhancement/batch/<batch_request_id>``.\n",
         "format": "uri",
         "maxLength": 2083,
         "minLength": 1,
         "title": "Result Storage Url",
         "type": "string"
      },
      "extra_fields": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Extra fields to pass to the robot. TBC.",
         "title": "Extra Fields"
      }
   },
   "required": [
      "id",
      "reference_storage_url",
      "result_storage_url"
   ]
}

Fields:
field extra_fields: dict | None = None[source]#

Extra fields to pass to the robot. TBC.

field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#
Constraints:
  • uuid_version = 4

field reference_storage_url: HttpUrl [Required][source]#

The URL at which the set of references are stored. The file is a jsonl with each line formatted according to Reference, one reference per line. Each reference may have identifiers or enhancements attached, as required by the robot. If the URL expires, a new one can be generated using GET /references/enhancement/batch/<batch_request_id>.

field result_storage_url: HttpUrl [Required][source]#

The URL at which the set of enhancements are to be stored. The file is to be a jsonl with each line formatted according to BatchEnhancementResultEntry. If the URL expires, a new one can be generated using GET /references/enhancement/batch/<batch_request_id>.

pydantic model libs.sdk.src.destiny_sdk.robots.BatchRobotResult[source]#

Used to indicate to the repository that the robot has finished processing.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.BatchRobotResult"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BatchRobotResult</b></td></tr><tr><td>request_id</td><td port="request_id">UUID</td></tr><tr><td>error</td><td port="error">RobotError | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.BatchRobotResult&#xA;&#xA;Used to indicate to the repository that the robot has finished processing.&#\
xA;"];
   "libs.sdk.src.destiny_sdk.robots.RobotError"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>RobotError</b></td></tr><tr><td>message</td><td port="message">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.RobotError&#xA;&#xA;A record of something going wrong with the robot.&#xA;"];
   "libs.sdk.src.destiny_sdk.robots.BatchRobotResult":error:e -> "libs.sdk.src.destiny_sdk.robots.RobotError":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "BatchRobotResult",
   "description": "Used to indicate to the repository that the robot has finished processing.",
   "type": "object",
   "properties": {
      "request_id": {
         "format": "uuid4",
         "title": "Request Id",
         "type": "string"
      },
      "error": {
         "anyOf": [
            {
               "$ref": "#/$defs/RobotError"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\nError the robot encountered while creating enhancements. If this field is populated,\nwe assume the entire batch or request failed, rather than an individual reference.\nIf there was an error with processing an individual reference, it should be passed in\nthe result file and this field should be left as None. Vice-versa, if this field is\nNone, the repository will assume that the result file is ready for processing.\n"
      }
   },
   "$defs": {
      "RobotError": {
         "description": "A record of something going wrong with the robot.",
         "properties": {
            "message": {
               "description": "Message which describes the error encountered during processing",
               "title": "Message",
               "type": "string"
            }
         },
         "required": [
            "message"
         ],
         "title": "RobotError",
         "type": "object"
      }
   },
   "required": [
      "request_id"
   ]
}

Fields:
field error: RobotError | None = None[source]#

Error the robot encountered while creating enhancements. If this field is populated, we assume the entire batch or request failed, rather than an individual reference. If there was an error with processing an individual reference, it should be passed in the result file and this field should be left as None. Vice-versa, if this field is None, the repository will assume that the result file is ready for processing.

field request_id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#
Constraints:
  • uuid_version = 4

pydantic model libs.sdk.src.destiny_sdk.robots.BatchRobotResultValidationEntry[source]#

A single entry in the validation result file for a batch enhancement request.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.BatchRobotResultValidationEntry"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BatchRobotResultValidationEntry</b></td></tr><tr><td>reference_id</td><td port="reference_id">Optional[UUID]</td></tr><tr><td>error</td><td port="error">str | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.BatchRobotResultValidationEntry&#xA;&#xA;A single entry in the validation result file for a batch \
enhancement request.&#xA;"];
}

Show JSON schema
{
   "title": "BatchRobotResultValidationEntry",
   "description": "A single entry in the validation result file for a batch enhancement request.",
   "type": "object",
   "properties": {
      "reference_id": {
         "anyOf": [
            {
               "format": "uuid4",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The ID of the reference which was enhanced. If this is empty, the BatchEnhancementResultEntry could not be parsed.",
         "title": "Reference Id"
      },
      "error": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Error encountered during the enhancement process for this reference. If this is empty, the enhancement was successfully created.",
         "title": "Error"
      }
   }
}

Fields:
field error: str | None = None[source]#

Error encountered during the enhancement process for this reference. If this is empty, the enhancement was successfully created.

field reference_id: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None[source]#

The ID of the reference which was enhanced. If this is empty, the BatchEnhancementResultEntry could not be parsed.

classmethod from_jsonl(jsonl: str) Self[source]#

Create an object from a JSONL string.

Parameters:

jsonl (str) – The JSONL string to parse.

Returns:

The created object.

Return type:

Self

to_jsonl() str[source]#

Convert the model to a JSONL string.

Returns:

The JSONL string representation of the model.

Return type:

str

pydantic model libs.sdk.src.destiny_sdk.robots.EnhancementRequestIn[source]#

The model for requesting an enhancement on specific reference.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.EnhancementRequestIn"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>EnhancementRequestIn</b></td></tr><tr><td>reference_id</td><td port="reference_id">UUID</td></tr><tr><td>robot_id</td><td port="robot_id">UUID</td></tr><tr><td>source</td><td port="source">str | None</td></tr><tr><td>enhancement_parameters</td><td port="enhancement_parameters">dict | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.EnhancementRequestIn&#xA;&#xA;The model for requesting an enhancement on specific reference.&#xA;"];
}

Show JSON schema
{
   "title": "EnhancementRequestIn",
   "description": "The model for requesting an enhancement on specific reference.",
   "type": "object",
   "properties": {
      "reference_id": {
         "description": "The ID of the reference to be enhanced.",
         "format": "uuid4",
         "title": "Reference Id",
         "type": "string"
      },
      "robot_id": {
         "description": "The robot to be used to create the enhancement.",
         "format": "uuid4",
         "title": "Robot Id",
         "type": "string"
      },
      "source": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The source of the batch enhancement request.",
         "title": "Source"
      },
      "enhancement_parameters": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Information needed to create the enhancement. TBC.",
         "title": "Enhancement Parameters"
      }
   },
   "required": [
      "reference_id",
      "robot_id"
   ]
}

Fields:
field enhancement_parameters: dict | None = None[source]#

Information needed to create the enhancement. TBC.

field reference_id: UUID4 [Required][source]#

The ID of the reference to be enhanced.

Constraints:
  • uuid_version = 4

field robot_id: UUID4 [Required][source]#

The robot to be used to create the enhancement.

Constraints:
  • uuid_version = 4

field source: str | None = None[source]#

The source of the batch enhancement request.

pydantic model libs.sdk.src.destiny_sdk.robots.EnhancementRequestRead[source]#

Core enhancement request class.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.EnhancementRequestRead"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>EnhancementRequestRead</b></td></tr><tr><td>reference_id</td><td port="reference_id">UUID</td></tr><tr><td>robot_id</td><td port="robot_id">UUID</td></tr><tr><td>source</td><td port="source">str | None</td></tr><tr><td>enhancement_parameters</td><td port="enhancement_parameters">dict | None</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>request_status</td><td port="request_status">EnhancementRequestStatus</td></tr><tr><td>error</td><td port="error">str | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.EnhancementRequestRead&#xA;&#xA;Core enhancement request class.&#xA;"];
}

Show JSON schema
{
   "title": "EnhancementRequestRead",
   "description": "Core enhancement request class.",
   "type": "object",
   "properties": {
      "reference_id": {
         "description": "The ID of the reference to be enhanced.",
         "format": "uuid4",
         "title": "Reference Id",
         "type": "string"
      },
      "robot_id": {
         "description": "The robot to be used to create the enhancement.",
         "format": "uuid4",
         "title": "Robot Id",
         "type": "string"
      },
      "source": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The source of the batch enhancement request.",
         "title": "Source"
      },
      "enhancement_parameters": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Information needed to create the enhancement. TBC.",
         "title": "Enhancement Parameters"
      },
      "id": {
         "format": "uuid4",
         "title": "Id",
         "type": "string"
      },
      "request_status": {
         "$ref": "#/$defs/EnhancementRequestStatus",
         "description": "The status of the request to create an enhancement"
      },
      "error": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Error encountered during the enhancement process",
         "title": "Error"
      }
   },
   "$defs": {
      "EnhancementRequestStatus": {
         "description": "The status of an enhancement request.\n\n**Allowed values**:\n- `received`: Enhancement request has been received.\n- `accepted`: Enhancement request has been accepted.\n- `rejected`: Enhancement request has been rejected.\n- `failed`: Enhancement failed to create.\n- `completed`: Enhancement has been created.",
         "enum": [
            "received",
            "accepted",
            "rejected",
            "failed",
            "completed"
         ],
         "title": "EnhancementRequestStatus",
         "type": "string"
      }
   },
   "required": [
      "reference_id",
      "robot_id",
      "id",
      "request_status"
   ]
}

Fields:
field enhancement_parameters: dict | None = None[source]#

Information needed to create the enhancement. TBC.

field error: str | None = None[source]#

Error encountered during the enhancement process

field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#
Constraints:
  • uuid_version = 4

field reference_id: UUID4 [Required][source]#

The ID of the reference to be enhanced.

Constraints:
  • uuid_version = 4

field request_status: EnhancementRequestStatus [Required][source]#

The status of the request to create an enhancement

field robot_id: UUID4 [Required][source]#

The robot to be used to create the enhancement.

Constraints:
  • uuid_version = 4

field source: str | None = None[source]#

The source of the batch enhancement request.

class libs.sdk.src.destiny_sdk.robots.EnhancementRequestStatus(*values)[source]#

The status of an enhancement request.

Allowed values: - received: Enhancement request has been received. - accepted: Enhancement request has been accepted. - rejected: Enhancement request has been rejected. - failed: Enhancement failed to create. - completed: Enhancement has been created.

ACCEPTED = 'accepted'[source]#
COMPLETED = 'completed'[source]#
FAILED = 'failed'[source]#
RECEIVED = 'received'[source]#
REJECTED = 'rejected'[source]#
pydantic model libs.sdk.src.destiny_sdk.robots.LinkedRobotError[source]#

A record of something going wrong when processing an individual reference.

Used in results for batch requests - in single requests, the reference id is derived from the request id.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.LinkedRobotError"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LinkedRobotError</b></td></tr><tr><td>message</td><td port="message">str</td></tr><tr><td>reference_id</td><td port="reference_id">UUID</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.LinkedRobotError&#xA;&#xA;A record of something going wrong when processing an individual reference.&#\
xA;&#xA;Used in results for batch requests - in single requests, the reference&#xA;id is derived from the request id.&#xA;"];
}

Show JSON schema
{
   "title": "LinkedRobotError",
   "description": "A record of something going wrong when processing an individual reference.\n\nUsed in results for batch requests - in single requests, the reference\nid is derived from the request id.",
   "type": "object",
   "properties": {
      "message": {
         "description": "Message which describes the error encountered during processing",
         "title": "Message",
         "type": "string"
      },
      "reference_id": {
         "description": "The ID of the reference which caused the error.",
         "format": "uuid4",
         "title": "Reference Id",
         "type": "string"
      }
   },
   "required": [
      "message",
      "reference_id"
   ]
}

Fields:
field message: Annotated[str, Field(description='Message which describes the error encountered during processing')] [Required][source]#

Message which describes the error encountered during processing

field reference_id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The ID of the reference which caused the error.

Constraints:
  • uuid_version = 4

classmethod from_jsonl(jsonl: str) Self[source]#

Create an object from a JSONL string.

Parameters:

jsonl (str) – The JSONL string to parse.

Returns:

The created object.

Return type:

Self

to_jsonl() str[source]#

Convert the model to a JSONL string.

Returns:

The JSONL string representation of the model.

Return type:

str

pydantic model libs.sdk.src.destiny_sdk.robots.ProvisionedRobot[source]#

The model for a provisioned robot.

Used only when a robot is initially created, or when cycling a robot’s client_secret.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.ProvisionedRobot"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ProvisionedRobot</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>base_url</td><td port="base_url">HttpUrl</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>owner</td><td port="owner">str</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>client_secret</td><td port="client_secret">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.ProvisionedRobot&#xA;&#xA;The model for a provisioned robot.&#xA;&#xA;Used only when a robot is \
initially created,&#xA;or when cycling a robot's client_secret.&#xA;"];
}

Show JSON schema
{
   "title": "ProvisionedRobot",
   "description": "The model for a provisioned robot.\n\nUsed only when a robot is initially created,\nor when cycling a robot's client_secret.",
   "type": "object",
   "properties": {
      "name": {
         "description": "The name of the robot, must be unique.",
         "title": "Name",
         "type": "string"
      },
      "base_url": {
         "description": "The base url of the robot. The robot must implement endpoints base_url/single for the enhancement of single references and base_url/batch for batch enhancements of references.",
         "format": "uri",
         "maxLength": 2083,
         "minLength": 1,
         "title": "Base Url",
         "type": "string"
      },
      "description": {
         "description": "Description of the enhancement the robot provides.",
         "title": "Description",
         "type": "string"
      },
      "owner": {
         "description": "The owner/publisher of the robot.",
         "title": "Owner",
         "type": "string"
      },
      "id": {
         "description": "The id of the robot provided by destiny repository. Used as the client_id when sending HMAC authenticated requests.",
         "format": "uuid4",
         "title": "Id",
         "type": "string"
      },
      "client_secret": {
         "description": "The client secret of the robot, used as the secret key when sending HMAC authenticated requests.",
         "title": "Client Secret",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "name",
      "base_url",
      "description",
      "owner",
      "id",
      "client_secret"
   ]
}

Config:
  • extra: str = forbid

Fields:
field base_url: HttpUrl [Required][source]#

The base url of the robot. The robot must implement endpoints base_url/single for the enhancement of single references and base_url/batch for batch enhancements of references.

field client_secret: str [Required][source]#

The client secret of the robot, used as the secret key when sending HMAC authenticated requests.

field description: str [Required][source]#

Description of the enhancement the robot provides.

field id: UUID4 [Required][source]#

The id of the robot provided by destiny repository. Used as the client_id when sending HMAC authenticated requests.

Constraints:
  • uuid_version = 4

field name: str [Required][source]#

The name of the robot, must be unique.

field owner: str [Required][source]#

The owner/publisher of the robot.

pydantic model libs.sdk.src.destiny_sdk.robots.Robot[source]#

Then model for a registered robot.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.Robot"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Robot</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>base_url</td><td port="base_url">HttpUrl</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>owner</td><td port="owner">str</td></tr><tr><td>id</td><td port="id">UUID</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.Robot&#xA;&#xA;Then model for a registered robot.&#xA;"];
}

Show JSON schema
{
   "title": "Robot",
   "description": "Then model for a registered robot.",
   "type": "object",
   "properties": {
      "name": {
         "description": "The name of the robot, must be unique.",
         "title": "Name",
         "type": "string"
      },
      "base_url": {
         "description": "The base url of the robot. The robot must implement endpoints base_url/single for the enhancement of single references and base_url/batch for batch enhancements of references.",
         "format": "uri",
         "maxLength": 2083,
         "minLength": 1,
         "title": "Base Url",
         "type": "string"
      },
      "description": {
         "description": "Description of the enhancement the robot provides.",
         "title": "Description",
         "type": "string"
      },
      "owner": {
         "description": "The owner/publisher of the robot.",
         "title": "Owner",
         "type": "string"
      },
      "id": {
         "description": "The id of the robot provided by destiny repository. Used as the client_id when sending HMAC authenticated requests.",
         "format": "uuid4",
         "title": "Id",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "name",
      "base_url",
      "description",
      "owner",
      "id"
   ]
}

Config:
  • extra: str = forbid

Fields:
field base_url: HttpUrl [Required][source]#

The base url of the robot. The robot must implement endpoints base_url/single for the enhancement of single references and base_url/batch for batch enhancements of references.

field description: str [Required][source]#

Description of the enhancement the robot provides.

field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The id of the robot provided by destiny repository. Used as the client_id when sending HMAC authenticated requests.

Constraints:
  • uuid_version = 4

field name: str [Required][source]#

The name of the robot, must be unique.

field owner: str [Required][source]#

The owner/publisher of the robot.

pydantic model libs.sdk.src.destiny_sdk.robots.RobotAutomation[source]#

Core Robot Automation class.

This is used as a source of truth for an Elasticsearch index that percolates references or enhancements against the queries. If a query matches, a request is sent to the specified robot to perform the enhancement.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.RobotAutomation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>RobotAutomation</b></td></tr><tr><td>query</td><td port="query">dict[str, Any]</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>robot_id</td><td port="robot_id">UUID</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.RobotAutomation&#xA;&#xA;Core Robot Automation class.&#xA;&#xA;This is used as a source of truth \
for an Elasticsearch index that percolates&#xA;references or enhancements against the queries. If a query matches, a request&#xA;\
is sent to the specified robot to perform the enhancement.&#xA;"];
}

Show JSON schema
{
   "title": "RobotAutomation",
   "description": "Core Robot Automation class.\n\nThis is used as a source of truth for an Elasticsearch index that percolates\nreferences or enhancements against the queries. If a query matches, a request\nis sent to the specified robot to perform the enhancement.",
   "type": "object",
   "properties": {
      "query": {
         "additionalProperties": true,
         "description": "The percolator query that will be used to match references  or enhancements against.",
         "title": "Query",
         "type": "object"
      },
      "id": {
         "description": "The ID of the robot automation.",
         "format": "uuid4",
         "title": "Id",
         "type": "string"
      },
      "robot_id": {
         "description": "The ID of the robot that will be used to enhance the reference.",
         "format": "uuid4",
         "title": "Robot Id",
         "type": "string"
      }
   },
   "required": [
      "query",
      "id",
      "robot_id"
   ]
}

Fields:
field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The ID of the robot automation.

Constraints:
  • uuid_version = 4

field query: dict[str, Any] [Required][source]#

The percolator query that will be used to match references or enhancements against.

field robot_id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The ID of the robot that will be used to enhance the reference.

Constraints:
  • uuid_version = 4

pydantic model libs.sdk.src.destiny_sdk.robots.RobotAutomationIn[source]#

Automation model for a robot.

This is used as a source of truth for an Elasticsearch index that percolates references or enhancements against the queries. If a query matches, a request is sent to the specified robot to perform the enhancement.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.RobotAutomationIn"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>RobotAutomationIn</b></td></tr><tr><td>query</td><td port="query">dict[str, Any]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.RobotAutomationIn&#xA;&#xA;Automation model for a robot.&#xA;&#xA;This is used as a source of truth \
for an Elasticsearch index that percolates&#xA;references or enhancements against the queries. If a query matches, a request&#xA;\
is sent to the specified robot to perform the enhancement.&#xA;"];
}

Show JSON schema
{
   "title": "RobotAutomationIn",
   "description": "Automation model for a robot.\n\nThis is used as a source of truth for an Elasticsearch index that percolates\nreferences or enhancements against the queries. If a query matches, a request\nis sent to the specified robot to perform the enhancement.",
   "type": "object",
   "properties": {
      "query": {
         "additionalProperties": true,
         "description": "The percolator query that will be used to match references  or enhancements against.",
         "title": "Query",
         "type": "object"
      }
   },
   "required": [
      "query"
   ]
}

Fields:
field query: dict[str, Any] [Required][source]#

The percolator query that will be used to match references or enhancements against.

pydantic model libs.sdk.src.destiny_sdk.robots.RobotError[source]#

A record of something going wrong with the robot.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.RobotError"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>RobotError</b></td></tr><tr><td>message</td><td port="message">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.RobotError&#xA;&#xA;A record of something going wrong with the robot.&#xA;"];
}

Show JSON schema
{
   "title": "RobotError",
   "description": "A record of something going wrong with the robot.",
   "type": "object",
   "properties": {
      "message": {
         "description": "Message which describes the error encountered during processing",
         "title": "Message",
         "type": "string"
      }
   },
   "required": [
      "message"
   ]
}

Fields:
field message: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Message which describes the error encountered during processing')] [Required][source]#

Message which describes the error encountered during processing

pydantic model libs.sdk.src.destiny_sdk.robots.RobotIn[source]#

The model for registering a new robot.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.robots.RobotIn"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>RobotIn</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>base_url</td><td port="base_url">HttpUrl</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>owner</td><td port="owner">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.RobotIn&#xA;&#xA;The model for registering a new robot.&#xA;"];
}

Show JSON schema
{
   "title": "RobotIn",
   "description": "The model for registering a new robot.",
   "type": "object",
   "properties": {
      "name": {
         "description": "The name of the robot, must be unique.",
         "title": "Name",
         "type": "string"
      },
      "base_url": {
         "description": "The base url of the robot. The robot must implement endpoints base_url/single for the enhancement of single references and base_url/batch for batch enhancements of references.",
         "format": "uri",
         "maxLength": 2083,
         "minLength": 1,
         "title": "Base Url",
         "type": "string"
      },
      "description": {
         "description": "Description of the enhancement the robot provides.",
         "title": "Description",
         "type": "string"
      },
      "owner": {
         "description": "The owner/publisher of the robot.",
         "title": "Owner",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "name",
      "base_url",
      "description",
      "owner"
   ]
}

Config:
  • extra: str = forbid

Fields:
field base_url: HttpUrl [Required][source]#

The base url of the robot. The robot must implement endpoints base_url/single for the enhancement of single references and base_url/batch for batch enhancements of references.

field description: str [Required][source]#

Description of the enhancement the robot provides.

field name: str [Required][source]#

The name of the robot, must be unique.

field owner: str [Required][source]#

The owner/publisher of the robot.

pydantic model libs.sdk.src.destiny_sdk.robots.RobotRequest[source]#

An enhancement request from the repo to a robot.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "destiny_sdk.enhancements.AbstractContentEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AbstractContentEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ABSTRACT]</td></tr><tr><td>process</td><td port="process">AbstractProcessType</td></tr><tr><td>abstract</td><td port="abstract">str</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.AbstractContentEnhancement&#xA;&#xA;An enhancement which is specific to the abstract of a reference.&#xA;&#\
xA;This is separate from the `BibliographicMetadata` for two reasons:&#xA;&#xA;1. Abstracts are increasingly missing from sources \
like OpenAlex, and may be&#xA;backfilled from other sources, without the bibliographic metadata.&#xA;2. They are also subject to \
copyright limitations in ways which metadata are&#xA;not, and thus need separate visibility controls.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AnnotationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ANNOTATION]</td></tr><tr><td>annotations</td><td port="annotations">list[BooleanAnnotation | ScoreAnnotation]</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.AnnotationEnhancement&#xA;&#xA;An enhancement which is composed of a list of Annotations.&#xA;"];
   "destiny_sdk.enhancements.BooleanAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BooleanAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.BOOLEAN]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>value</td><td port="value">bool</td></tr><tr><td>score</td><td port="score">float | None</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.BooleanAnnotation&#xA;&#xA;An annotation is a way of tagging the content with a label of some kind.&#xA;&#\
xA;This class will probably be broken up in the future, but covers most of our&#xA;initial cases.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "destiny_sdk.enhancements.BooleanAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.ScoreAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ScoreAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.SCORE]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>score</td><td port="score">float</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.ScoreAnnotation&#xA;&#xA;An annotation which represents the score for a label.&#xA;&#xA;This is similar \
to a BooleanAnnotation, but lacks a boolean determination&#xA;as to the application of the label.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "destiny_sdk.enhancements.ScoreAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Authorship"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Authorship</b></td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>orcid</td><td port="orcid">str</td></tr><tr><td>position</td><td port="position">AuthorPosition</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Authorship&#xA;&#xA;Represents a single author and their association with a reference.&#xA;&#xA;This is \
a simplification of the OpenAlex [Authorship&#xA;object](https://docs.openalex.org/api-entities/works/work-object/authorship-object)&#\
xA;for our purposes.&#xA;"];
   "destiny_sdk.enhancements.BibliographicMetadataEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BibliographicMetadataEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.BIBLIOGRAPHIC]</td></tr><tr><td>authorship</td><td port="authorship">list[Authorship] | None</td></tr><tr><td>cited_by_count</td><td port="cited_by_count">int | None</td></tr><tr><td>created_date</td><td port="created_date">date | None</td></tr><tr><td>publication_date</td><td port="publication_date">date | None</td></tr><tr><td>publication_year</td><td port="publication_year">int | None</td></tr><tr><td>publisher</td><td port="publisher">str | None</td></tr><tr><td>title</td><td port="title">str | None</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.BibliographicMetadataEnhancement&#xA;&#xA;An enhancement which is made up of bibliographic metadata.&#xA;&#\
xA;Generally this will be sourced from a database such as OpenAlex or similar.&#xA;For directly contributed references, these may \
not be complete.&#xA;"];
   "destiny_sdk.enhancements.BibliographicMetadataEnhancement":authorship:e -> "destiny_sdk.enhancements.Authorship":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Enhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Enhancement</b></td></tr><tr><td>reference_id</td><td port="reference_id">UUID</td></tr><tr><td>source</td><td port="source">str</td></tr><tr><td>visibility</td><td port="visibility">Visibility</td></tr><tr><td>robot_version</td><td port="robot_version">str | None</td></tr><tr><td>derived_from</td><td port="derived_from">list[UUID] | None</td></tr><tr><td>content</td><td port="content">BibliographicMetadataEnhancement | AbstractContentEnhancement | AnnotationEnhancement | LocationEnhancement</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Enhancement&#xA;&#xA;Core enhancement class.&#xA;"];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.AbstractContentEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.AnnotationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.BibliographicMetadataEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.LocationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LocationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.LOCATION]</td></tr><tr><td>locations</td><td port="locations">list[Location]</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.LocationEnhancement&#xA;&#xA;An enhancement which describes locations where this reference can be found.&#\
xA;&#xA;This maps closely (almost exactly) to OpenAlex's locations.&#xA;"];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.LocationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Location"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Location</b></td></tr><tr><td>is_oa</td><td port="is_oa">bool | None</td></tr><tr><td>version</td><td port="version">DriverVersion | None</td></tr><tr><td>landing_page_url</td><td port="landing_page_url">HttpUrl | None</td></tr><tr><td>pdf_url</td><td port="pdf_url">HttpUrl | None</td></tr><tr><td>license</td><td port="license">str | None</td></tr><tr><td>extra</td><td port="extra">dict | None</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Location&#xA;&#xA;A location where a reference can be found.&#xA;&#xA;This maps almost completely to the \
OpenAlex&#xA;[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)&#xA;"];
   "destiny_sdk.enhancements.LocationEnhancement":locations:e -> "destiny_sdk.enhancements.Location":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.identifiers.DOIIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DOIIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.DOI]</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.DOIIdentifier&#xA;&#xA;An external identifier representing a DOI.&#xA;"];
   "destiny_sdk.identifiers.OpenAlexIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>OpenAlexIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.OPEN_ALEX]</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.OpenAlexIdentifier&#xA;&#xA;An external identifier representing an OpenAlex ID.&#xA;"];
   "destiny_sdk.identifiers.OtherIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>OtherIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.OTHER]</td></tr><tr><td>other_identifier_name</td><td port="other_identifier_name">str</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.OtherIdentifier&#xA;&#xA;An external identifier not otherwise defined by the repository.&#xA;"];
   "destiny_sdk.identifiers.PubMedIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>PubMedIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">int</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.PM_ID]</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.PubMedIdentifier&#xA;&#xA;An external identifier representing a PubMed ID.&#xA;"];
   "destiny_sdk.references.Reference"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Reference</b></td></tr><tr><td>visibility</td><td port="visibility">Visibility</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>identifiers</td><td port="identifiers">list[DOIIdentifier | PubMedIdentifier | OpenAlexIdentifier | OtherIdentifier] | None</td></tr><tr><td>enhancements</td><td port="enhancements">list[Enhancement] | None</td></tr></table>>,
      tooltip="destiny_sdk.references.Reference&#xA;&#xA;Core reference class.&#xA;"];
   "destiny_sdk.references.Reference":enhancements:e -> "destiny_sdk.enhancements.Enhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.references.Reference":identifiers:e -> "destiny_sdk.identifiers.DOIIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.references.Reference":identifiers:e -> "destiny_sdk.identifiers.OpenAlexIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.references.Reference":identifiers:e -> "destiny_sdk.identifiers.OtherIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.references.Reference":identifiers:e -> "destiny_sdk.identifiers.PubMedIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.robots.RobotRequest"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>RobotRequest</b></td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>reference</td><td port="reference">Reference</td></tr><tr><td>extra_fields</td><td port="extra_fields">dict | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.RobotRequest&#xA;&#xA;An enhancement request from the repo to a robot.&#xA;"];
   "libs.sdk.src.destiny_sdk.robots.RobotRequest":reference:e -> "destiny_sdk.references.Reference":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "RobotRequest",
   "description": "An enhancement request from the repo to a robot.",
   "type": "object",
   "properties": {
      "id": {
         "format": "uuid4",
         "title": "Id",
         "type": "string"
      },
      "reference": {
         "$ref": "#/$defs/Reference"
      },
      "extra_fields": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "title": "Extra Fields"
      }
   },
   "$defs": {
      "AbstractContentEnhancement": {
         "description": "An enhancement which is specific to the abstract of a reference.\n\nThis is separate from the `BibliographicMetadata` for two reasons:\n\n1. Abstracts are increasingly missing from sources like OpenAlex, and may be\nbackfilled from other sources, without the bibliographic metadata.\n2. They are also subject to copyright limitations in ways which metadata are\nnot, and thus need separate visibility controls.",
         "properties": {
            "enhancement_type": {
               "const": "abstract",
               "default": "abstract",
               "title": "Enhancement Type",
               "type": "string"
            },
            "process": {
               "$ref": "#/$defs/AbstractProcessType",
               "description": "The process used to acquire the abstract."
            },
            "abstract": {
               "description": "The abstract of the reference.",
               "title": "Abstract",
               "type": "string"
            }
         },
         "required": [
            "process",
            "abstract"
         ],
         "title": "AbstractContentEnhancement",
         "type": "object"
      },
      "AbstractProcessType": {
         "description": "The process used to acquyire the abstract.\n\n**Allowed values**:\n- `uninverted`\n- `closed_api`\n- `other`",
         "enum": [
            "uninverted",
            "closed_api",
            "other"
         ],
         "title": "AbstractProcessType",
         "type": "string"
      },
      "AnnotationEnhancement": {
         "description": "An enhancement which is composed of a list of Annotations.",
         "properties": {
            "enhancement_type": {
               "const": "annotation",
               "default": "annotation",
               "title": "Enhancement Type",
               "type": "string"
            },
            "annotations": {
               "items": {
                  "discriminator": {
                     "mapping": {
                        "boolean": "#/$defs/BooleanAnnotation",
                        "score": "#/$defs/ScoreAnnotation"
                     },
                     "propertyName": "annotation_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/BooleanAnnotation"
                     },
                     {
                        "$ref": "#/$defs/ScoreAnnotation"
                     }
                  ]
               },
               "title": "Annotations",
               "type": "array"
            }
         },
         "required": [
            "annotations"
         ],
         "title": "AnnotationEnhancement",
         "type": "object"
      },
      "AuthorPosition": {
         "description": "The position of an author in a list of authorships.\n\nMaps to the data from OpenAlex.\n\n**Allowed values**:\n- `first`: The first author.\n- `middle`: Any middle author\n- `last`: The last author",
         "enum": [
            "first",
            "middle",
            "last"
         ],
         "title": "AuthorPosition",
         "type": "string"
      },
      "Authorship": {
         "description": "Represents a single author and their association with a reference.\n\nThis is a simplification of the OpenAlex [Authorship\nobject](https://docs.openalex.org/api-entities/works/work-object/authorship-object)\nfor our purposes.",
         "properties": {
            "display_name": {
               "description": "The display name of the author.",
               "title": "Display Name",
               "type": "string"
            },
            "orcid": {
               "description": "The ORCid of the author.",
               "title": "Orcid",
               "type": "string"
            },
            "position": {
               "$ref": "#/$defs/AuthorPosition",
               "description": "The position of the author within the list of authors."
            }
         },
         "required": [
            "display_name",
            "orcid",
            "position"
         ],
         "title": "Authorship",
         "type": "object"
      },
      "BibliographicMetadataEnhancement": {
         "description": "An enhancement which is made up of bibliographic metadata.\n\nGenerally this will be sourced from a database such as OpenAlex or similar.\nFor directly contributed references, these may not be complete.",
         "properties": {
            "enhancement_type": {
               "const": "bibliographic",
               "default": "bibliographic",
               "title": "Enhancement Type",
               "type": "string"
            },
            "authorship": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Authorship"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `Authorships` belonging to this reference.",
               "title": "Authorship"
            },
            "cited_by_count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex) The number of citations to this work. These are the times that\nother works have cited this work\n",
               "title": "Cited By Count"
            },
            "created_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ISO8601 date this metadata record was created",
               "title": "Created Date"
            },
            "publication_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The date which the version of record was published.",
               "title": "Publication Date"
            },
            "publication_year": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The year in which the version of record was published.",
               "title": "Publication Year"
            },
            "publisher": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the entity which published the version of record.",
               "title": "Publisher"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The title of the reference.",
               "title": "Title"
            }
         },
         "title": "BibliographicMetadataEnhancement",
         "type": "object"
      },
      "BooleanAnnotation": {
         "description": "An annotation is a way of tagging the content with a label of some kind.\n\nThis class will probably be broken up in the future, but covers most of our\ninitial cases.",
         "properties": {
            "annotation_type": {
               "const": "boolean",
               "default": "boolean",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of the annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "value": {
               "description": "Boolean flag for this annotation",
               "title": "Value",
               "type": "boolean"
            },
            "score": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A confidence score for this annotation",
               "title": "Score"
            },
            "data": {
               "additionalProperties": true,
               "description": "\nAn object representation of the annotation including any confidence scores or\ndescriptions.\n",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "value"
         ],
         "title": "BooleanAnnotation",
         "type": "object"
      },
      "DOIIdentifier": {
         "description": "An external identifier representing a DOI.",
         "properties": {
            "identifier": {
               "description": "The DOI of the reference.",
               "pattern": "^10\\.\\d{4,9}/[-._;()/:a-zA-Z0-9%<>\\[\\]+&]+$",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "doi",
               "default": "doi",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "DOIIdentifier",
         "type": "object"
      },
      "DriverVersion": {
         "description": "The version based on the DRIVER guidelines versioning scheme.\n\n(Borrowed from OpenAlex)\n\nAllowed values:\n- `publishedVersion`: The document's version of record. This is the most\nauthoritative version.\n- `acceptedVersion`: The document after having completed peer review and being\nofficially accepted for publication. It will lack publisher formatting, but the\ncontent should be interchangeable with the that of the publishedVersion.\n- `submittedVersion`: the document as submitted to the publisher by the authors, but\nbefore peer-review. Its content may differ significantly from that of the accepted\narticle.",
         "enum": [
            "publishedVersion",
            "acceptedVersion",
            "submittedVersion",
            "other"
         ],
         "title": "DriverVersion",
         "type": "string"
      },
      "Enhancement": {
         "description": "Core enhancement class.",
         "properties": {
            "reference_id": {
               "description": "The ID of the reference this enhancement is associated with.",
               "format": "uuid",
               "title": "Reference Id",
               "type": "string"
            },
            "source": {
               "description": "The enhancement source for tracking provenance.",
               "title": "Source",
               "type": "string"
            },
            "visibility": {
               "$ref": "#/$defs/Visibility",
               "description": "The level of visibility of the enhancement"
            },
            "robot_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The version of the robot that generated the content.",
               "title": "Robot Version"
            },
            "derived_from": {
               "anyOf": [
                  {
                     "items": {
                        "format": "uuid",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of enhancement IDs that this enhancement was derived from.",
               "title": "Derived From"
            },
            "content": {
               "description": "The content of the enhancement.",
               "discriminator": {
                  "mapping": {
                     "abstract": "#/$defs/AbstractContentEnhancement",
                     "annotation": "#/$defs/AnnotationEnhancement",
                     "bibliographic": "#/$defs/BibliographicMetadataEnhancement",
                     "location": "#/$defs/LocationEnhancement"
                  },
                  "propertyName": "enhancement_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/BibliographicMetadataEnhancement"
                  },
                  {
                     "$ref": "#/$defs/AbstractContentEnhancement"
                  },
                  {
                     "$ref": "#/$defs/AnnotationEnhancement"
                  },
                  {
                     "$ref": "#/$defs/LocationEnhancement"
                  }
               ],
               "title": "Content"
            }
         },
         "required": [
            "reference_id",
            "source",
            "visibility",
            "content"
         ],
         "title": "Enhancement",
         "type": "object"
      },
      "Location": {
         "description": "A location where a reference can be found.\n\nThis maps almost completely to the OpenAlex\n[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)",
         "properties": {
            "is_oa": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): True if an Open Access (OA) version of this work is available\nat this location. May be left as null if this is unknown (and thus)\ntreated effectively as `false`.\n",
               "title": "Is Oa"
            },
            "version": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DriverVersion"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nThe version (according to the DRIVER versioning scheme) of this location.\n"
            },
            "landing_page_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "(From OpenAlex): The landing page URL for this location.",
               "title": "Landing Page Url"
            },
            "pdf_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): A URL where you can find this location as a PDF.\n",
               "title": "Pdf Url"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): The location's publishing license. This can be a Creative\nCommons license such as cc0 or cc-by, a publisher-specific license, or null\nwhich means we are not able to determine a license for this location.\n",
               "title": "License"
            },
            "extra": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Any extra metadata about this location",
               "title": "Extra"
            }
         },
         "title": "Location",
         "type": "object"
      },
      "LocationEnhancement": {
         "description": "An enhancement which describes locations where this reference can be found.\n\nThis maps closely (almost exactly) to OpenAlex's locations.",
         "properties": {
            "enhancement_type": {
               "const": "location",
               "default": "location",
               "title": "Enhancement Type",
               "type": "string"
            },
            "locations": {
               "description": "A list of locations where this reference can be found.",
               "items": {
                  "$ref": "#/$defs/Location"
               },
               "title": "Locations",
               "type": "array"
            }
         },
         "required": [
            "locations"
         ],
         "title": "LocationEnhancement",
         "type": "object"
      },
      "OpenAlexIdentifier": {
         "description": "An external identifier representing an OpenAlex ID.",
         "properties": {
            "identifier": {
               "description": "The OpenAlex ID of the reference.",
               "pattern": "^W\\d+$",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "open_alex",
               "default": "open_alex",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "OpenAlexIdentifier",
         "type": "object"
      },
      "OtherIdentifier": {
         "description": "An external identifier not otherwise defined by the repository.",
         "properties": {
            "identifier": {
               "description": "The identifier of the reference.",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "other",
               "default": "other",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            },
            "other_identifier_name": {
               "description": "The name of the undocumented identifier type.",
               "title": "Other Identifier Name",
               "type": "string"
            }
         },
         "required": [
            "identifier",
            "other_identifier_name"
         ],
         "title": "OtherIdentifier",
         "type": "object"
      },
      "PubMedIdentifier": {
         "description": "An external identifier representing a PubMed ID.",
         "properties": {
            "identifier": {
               "description": "The PubMed ID of the reference.",
               "title": "Identifier",
               "type": "integer"
            },
            "identifier_type": {
               "const": "pm_id",
               "default": "pm_id",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "PubMedIdentifier",
         "type": "object"
      },
      "Reference": {
         "description": "Core reference class.",
         "properties": {
            "visibility": {
               "$ref": "#/$defs/Visibility",
               "default": "public",
               "description": "The level of visibility of the reference"
            },
            "id": {
               "description": "The ID of the reference",
               "format": "uuid4",
               "title": "Id",
               "type": "string"
            },
            "identifiers": {
               "anyOf": [
                  {
                     "items": {
                        "discriminator": {
                           "mapping": {
                              "doi": "#/$defs/DOIIdentifier",
                              "open_alex": "#/$defs/OpenAlexIdentifier",
                              "other": "#/$defs/OtherIdentifier",
                              "pm_id": "#/$defs/PubMedIdentifier"
                           },
                           "propertyName": "identifier_type"
                        },
                        "oneOf": [
                           {
                              "$ref": "#/$defs/DOIIdentifier"
                           },
                           {
                              "$ref": "#/$defs/PubMedIdentifier"
                           },
                           {
                              "$ref": "#/$defs/OpenAlexIdentifier"
                           },
                           {
                              "$ref": "#/$defs/OtherIdentifier"
                           }
                        ]
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `ExternalIdentifiers` for the Reference",
               "title": "Identifiers"
            },
            "enhancements": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Enhancement"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of enhancements for the reference",
               "title": "Enhancements"
            }
         },
         "required": [
            "id"
         ],
         "title": "Reference",
         "type": "object"
      },
      "ScoreAnnotation": {
         "description": "An annotation which represents the score for a label.\n\nThis is similar to a BooleanAnnotation, but lacks a boolean determination\nas to the application of the label.",
         "properties": {
            "annotation_type": {
               "const": "score",
               "default": "score",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "score": {
               "description": "Score for this annotation",
               "title": "Score",
               "type": "number"
            },
            "data": {
               "additionalProperties": true,
               "description": "An object representation of the annotation including any confidence scores or descriptions.",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "score"
         ],
         "title": "ScoreAnnotation",
         "type": "object"
      },
      "Visibility": {
         "description": "The visibility of a data element in the repository.\n\nThis is used to manage whether information should be publicly available or\nrestricted (generally due to copyright constraints from publishers).\n\nTODO: Implement data governance layer to manage this.\n\n**Allowed values**:\n\n- `public`: Visible to the general public without authentication.\n- `restricted`: Requires authentication to be visible.\n- `hidden`: Is not visible, but may be passed to data mining processes.",
         "enum": [
            "public",
            "restricted",
            "hidden"
         ],
         "title": "Visibility",
         "type": "string"
      }
   },
   "required": [
      "id",
      "reference",
      "extra_fields"
   ]
}

Fields:
field extra_fields: dict | None [Required][source]#
field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#
Constraints:
  • uuid_version = 4

field reference: Reference [Required][source]#
pydantic model libs.sdk.src.destiny_sdk.robots.RobotResult[source]#

The result of a robot request which is returned to the repo.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "destiny_sdk.enhancements.AbstractContentEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AbstractContentEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ABSTRACT]</td></tr><tr><td>process</td><td port="process">AbstractProcessType</td></tr><tr><td>abstract</td><td port="abstract">str</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.AbstractContentEnhancement&#xA;&#xA;An enhancement which is specific to the abstract of a reference.&#xA;&#\
xA;This is separate from the `BibliographicMetadata` for two reasons:&#xA;&#xA;1. Abstracts are increasingly missing from sources \
like OpenAlex, and may be&#xA;backfilled from other sources, without the bibliographic metadata.&#xA;2. They are also subject to \
copyright limitations in ways which metadata are&#xA;not, and thus need separate visibility controls.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AnnotationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ANNOTATION]</td></tr><tr><td>annotations</td><td port="annotations">list[BooleanAnnotation | ScoreAnnotation]</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.AnnotationEnhancement&#xA;&#xA;An enhancement which is composed of a list of Annotations.&#xA;"];
   "destiny_sdk.enhancements.BooleanAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BooleanAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.BOOLEAN]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>value</td><td port="value">bool</td></tr><tr><td>score</td><td port="score">float | None</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.BooleanAnnotation&#xA;&#xA;An annotation is a way of tagging the content with a label of some kind.&#xA;&#\
xA;This class will probably be broken up in the future, but covers most of our&#xA;initial cases.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "destiny_sdk.enhancements.BooleanAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.ScoreAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ScoreAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.SCORE]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>score</td><td port="score">float</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.ScoreAnnotation&#xA;&#xA;An annotation which represents the score for a label.&#xA;&#xA;This is similar \
to a BooleanAnnotation, but lacks a boolean determination&#xA;as to the application of the label.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "destiny_sdk.enhancements.ScoreAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Authorship"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Authorship</b></td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>orcid</td><td port="orcid">str</td></tr><tr><td>position</td><td port="position">AuthorPosition</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Authorship&#xA;&#xA;Represents a single author and their association with a reference.&#xA;&#xA;This is \
a simplification of the OpenAlex [Authorship&#xA;object](https://docs.openalex.org/api-entities/works/work-object/authorship-object)&#\
xA;for our purposes.&#xA;"];
   "destiny_sdk.enhancements.BibliographicMetadataEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BibliographicMetadataEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.BIBLIOGRAPHIC]</td></tr><tr><td>authorship</td><td port="authorship">list[Authorship] | None</td></tr><tr><td>cited_by_count</td><td port="cited_by_count">int | None</td></tr><tr><td>created_date</td><td port="created_date">date | None</td></tr><tr><td>publication_date</td><td port="publication_date">date | None</td></tr><tr><td>publication_year</td><td port="publication_year">int | None</td></tr><tr><td>publisher</td><td port="publisher">str | None</td></tr><tr><td>title</td><td port="title">str | None</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.BibliographicMetadataEnhancement&#xA;&#xA;An enhancement which is made up of bibliographic metadata.&#xA;&#\
xA;Generally this will be sourced from a database such as OpenAlex or similar.&#xA;For directly contributed references, these may \
not be complete.&#xA;"];
   "destiny_sdk.enhancements.BibliographicMetadataEnhancement":authorship:e -> "destiny_sdk.enhancements.Authorship":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Enhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Enhancement</b></td></tr><tr><td>reference_id</td><td port="reference_id">UUID</td></tr><tr><td>source</td><td port="source">str</td></tr><tr><td>visibility</td><td port="visibility">Visibility</td></tr><tr><td>robot_version</td><td port="robot_version">str | None</td></tr><tr><td>derived_from</td><td port="derived_from">list[UUID] | None</td></tr><tr><td>content</td><td port="content">BibliographicMetadataEnhancement | AbstractContentEnhancement | AnnotationEnhancement | LocationEnhancement</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Enhancement&#xA;&#xA;Core enhancement class.&#xA;"];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.AbstractContentEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.AnnotationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.BibliographicMetadataEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.LocationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LocationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.LOCATION]</td></tr><tr><td>locations</td><td port="locations">list[Location]</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.LocationEnhancement&#xA;&#xA;An enhancement which describes locations where this reference can be found.&#\
xA;&#xA;This maps closely (almost exactly) to OpenAlex's locations.&#xA;"];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.LocationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Location"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Location</b></td></tr><tr><td>is_oa</td><td port="is_oa">bool | None</td></tr><tr><td>version</td><td port="version">DriverVersion | None</td></tr><tr><td>landing_page_url</td><td port="landing_page_url">HttpUrl | None</td></tr><tr><td>pdf_url</td><td port="pdf_url">HttpUrl | None</td></tr><tr><td>license</td><td port="license">str | None</td></tr><tr><td>extra</td><td port="extra">dict | None</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Location&#xA;&#xA;A location where a reference can be found.&#xA;&#xA;This maps almost completely to the \
OpenAlex&#xA;[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)&#xA;"];
   "destiny_sdk.enhancements.LocationEnhancement":locations:e -> "destiny_sdk.enhancements.Location":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.robots.RobotError"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>RobotError</b></td></tr><tr><td>message</td><td port="message">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.RobotError&#xA;&#xA;A record of something going wrong with the robot.&#xA;"];
   "libs.sdk.src.destiny_sdk.robots.RobotResult"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>RobotResult</b></td></tr><tr><td>request_id</td><td port="request_id">UUID</td></tr><tr><td>error</td><td port="error">RobotError | None</td></tr><tr><td>enhancement</td><td port="enhancement">Enhancement | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.robots.RobotResult&#xA;&#xA;The result of a robot request which is returned to the repo.&#xA;"];
   "libs.sdk.src.destiny_sdk.robots.RobotResult":enhancement:e -> "destiny_sdk.enhancements.Enhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.robots.RobotResult":error:e -> "libs.sdk.src.destiny_sdk.robots.RobotError":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "RobotResult",
   "description": "The result of a robot request which is returned to the repo.",
   "type": "object",
   "properties": {
      "request_id": {
         "format": "uuid4",
         "title": "Request Id",
         "type": "string"
      },
      "error": {
         "anyOf": [
            {
               "$ref": "#/$defs/RobotError"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Error the robot encountered while creating enhancement."
      },
      "enhancement": {
         "anyOf": [
            {
               "$ref": "#/$defs/Enhancement"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "An enhancement to create"
      }
   },
   "$defs": {
      "AbstractContentEnhancement": {
         "description": "An enhancement which is specific to the abstract of a reference.\n\nThis is separate from the `BibliographicMetadata` for two reasons:\n\n1. Abstracts are increasingly missing from sources like OpenAlex, and may be\nbackfilled from other sources, without the bibliographic metadata.\n2. They are also subject to copyright limitations in ways which metadata are\nnot, and thus need separate visibility controls.",
         "properties": {
            "enhancement_type": {
               "const": "abstract",
               "default": "abstract",
               "title": "Enhancement Type",
               "type": "string"
            },
            "process": {
               "$ref": "#/$defs/AbstractProcessType",
               "description": "The process used to acquire the abstract."
            },
            "abstract": {
               "description": "The abstract of the reference.",
               "title": "Abstract",
               "type": "string"
            }
         },
         "required": [
            "process",
            "abstract"
         ],
         "title": "AbstractContentEnhancement",
         "type": "object"
      },
      "AbstractProcessType": {
         "description": "The process used to acquyire the abstract.\n\n**Allowed values**:\n- `uninverted`\n- `closed_api`\n- `other`",
         "enum": [
            "uninverted",
            "closed_api",
            "other"
         ],
         "title": "AbstractProcessType",
         "type": "string"
      },
      "AnnotationEnhancement": {
         "description": "An enhancement which is composed of a list of Annotations.",
         "properties": {
            "enhancement_type": {
               "const": "annotation",
               "default": "annotation",
               "title": "Enhancement Type",
               "type": "string"
            },
            "annotations": {
               "items": {
                  "discriminator": {
                     "mapping": {
                        "boolean": "#/$defs/BooleanAnnotation",
                        "score": "#/$defs/ScoreAnnotation"
                     },
                     "propertyName": "annotation_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/BooleanAnnotation"
                     },
                     {
                        "$ref": "#/$defs/ScoreAnnotation"
                     }
                  ]
               },
               "title": "Annotations",
               "type": "array"
            }
         },
         "required": [
            "annotations"
         ],
         "title": "AnnotationEnhancement",
         "type": "object"
      },
      "AuthorPosition": {
         "description": "The position of an author in a list of authorships.\n\nMaps to the data from OpenAlex.\n\n**Allowed values**:\n- `first`: The first author.\n- `middle`: Any middle author\n- `last`: The last author",
         "enum": [
            "first",
            "middle",
            "last"
         ],
         "title": "AuthorPosition",
         "type": "string"
      },
      "Authorship": {
         "description": "Represents a single author and their association with a reference.\n\nThis is a simplification of the OpenAlex [Authorship\nobject](https://docs.openalex.org/api-entities/works/work-object/authorship-object)\nfor our purposes.",
         "properties": {
            "display_name": {
               "description": "The display name of the author.",
               "title": "Display Name",
               "type": "string"
            },
            "orcid": {
               "description": "The ORCid of the author.",
               "title": "Orcid",
               "type": "string"
            },
            "position": {
               "$ref": "#/$defs/AuthorPosition",
               "description": "The position of the author within the list of authors."
            }
         },
         "required": [
            "display_name",
            "orcid",
            "position"
         ],
         "title": "Authorship",
         "type": "object"
      },
      "BibliographicMetadataEnhancement": {
         "description": "An enhancement which is made up of bibliographic metadata.\n\nGenerally this will be sourced from a database such as OpenAlex or similar.\nFor directly contributed references, these may not be complete.",
         "properties": {
            "enhancement_type": {
               "const": "bibliographic",
               "default": "bibliographic",
               "title": "Enhancement Type",
               "type": "string"
            },
            "authorship": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Authorship"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `Authorships` belonging to this reference.",
               "title": "Authorship"
            },
            "cited_by_count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex) The number of citations to this work. These are the times that\nother works have cited this work\n",
               "title": "Cited By Count"
            },
            "created_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ISO8601 date this metadata record was created",
               "title": "Created Date"
            },
            "publication_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The date which the version of record was published.",
               "title": "Publication Date"
            },
            "publication_year": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The year in which the version of record was published.",
               "title": "Publication Year"
            },
            "publisher": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the entity which published the version of record.",
               "title": "Publisher"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The title of the reference.",
               "title": "Title"
            }
         },
         "title": "BibliographicMetadataEnhancement",
         "type": "object"
      },
      "BooleanAnnotation": {
         "description": "An annotation is a way of tagging the content with a label of some kind.\n\nThis class will probably be broken up in the future, but covers most of our\ninitial cases.",
         "properties": {
            "annotation_type": {
               "const": "boolean",
               "default": "boolean",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of the annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "value": {
               "description": "Boolean flag for this annotation",
               "title": "Value",
               "type": "boolean"
            },
            "score": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A confidence score for this annotation",
               "title": "Score"
            },
            "data": {
               "additionalProperties": true,
               "description": "\nAn object representation of the annotation including any confidence scores or\ndescriptions.\n",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "value"
         ],
         "title": "BooleanAnnotation",
         "type": "object"
      },
      "DriverVersion": {
         "description": "The version based on the DRIVER guidelines versioning scheme.\n\n(Borrowed from OpenAlex)\n\nAllowed values:\n- `publishedVersion`: The document's version of record. This is the most\nauthoritative version.\n- `acceptedVersion`: The document after having completed peer review and being\nofficially accepted for publication. It will lack publisher formatting, but the\ncontent should be interchangeable with the that of the publishedVersion.\n- `submittedVersion`: the document as submitted to the publisher by the authors, but\nbefore peer-review. Its content may differ significantly from that of the accepted\narticle.",
         "enum": [
            "publishedVersion",
            "acceptedVersion",
            "submittedVersion",
            "other"
         ],
         "title": "DriverVersion",
         "type": "string"
      },
      "Enhancement": {
         "description": "Core enhancement class.",
         "properties": {
            "reference_id": {
               "description": "The ID of the reference this enhancement is associated with.",
               "format": "uuid",
               "title": "Reference Id",
               "type": "string"
            },
            "source": {
               "description": "The enhancement source for tracking provenance.",
               "title": "Source",
               "type": "string"
            },
            "visibility": {
               "$ref": "#/$defs/Visibility",
               "description": "The level of visibility of the enhancement"
            },
            "robot_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The version of the robot that generated the content.",
               "title": "Robot Version"
            },
            "derived_from": {
               "anyOf": [
                  {
                     "items": {
                        "format": "uuid",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of enhancement IDs that this enhancement was derived from.",
               "title": "Derived From"
            },
            "content": {
               "description": "The content of the enhancement.",
               "discriminator": {
                  "mapping": {
                     "abstract": "#/$defs/AbstractContentEnhancement",
                     "annotation": "#/$defs/AnnotationEnhancement",
                     "bibliographic": "#/$defs/BibliographicMetadataEnhancement",
                     "location": "#/$defs/LocationEnhancement"
                  },
                  "propertyName": "enhancement_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/BibliographicMetadataEnhancement"
                  },
                  {
                     "$ref": "#/$defs/AbstractContentEnhancement"
                  },
                  {
                     "$ref": "#/$defs/AnnotationEnhancement"
                  },
                  {
                     "$ref": "#/$defs/LocationEnhancement"
                  }
               ],
               "title": "Content"
            }
         },
         "required": [
            "reference_id",
            "source",
            "visibility",
            "content"
         ],
         "title": "Enhancement",
         "type": "object"
      },
      "Location": {
         "description": "A location where a reference can be found.\n\nThis maps almost completely to the OpenAlex\n[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)",
         "properties": {
            "is_oa": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): True if an Open Access (OA) version of this work is available\nat this location. May be left as null if this is unknown (and thus)\ntreated effectively as `false`.\n",
               "title": "Is Oa"
            },
            "version": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DriverVersion"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nThe version (according to the DRIVER versioning scheme) of this location.\n"
            },
            "landing_page_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "(From OpenAlex): The landing page URL for this location.",
               "title": "Landing Page Url"
            },
            "pdf_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): A URL where you can find this location as a PDF.\n",
               "title": "Pdf Url"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): The location's publishing license. This can be a Creative\nCommons license such as cc0 or cc-by, a publisher-specific license, or null\nwhich means we are not able to determine a license for this location.\n",
               "title": "License"
            },
            "extra": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Any extra metadata about this location",
               "title": "Extra"
            }
         },
         "title": "Location",
         "type": "object"
      },
      "LocationEnhancement": {
         "description": "An enhancement which describes locations where this reference can be found.\n\nThis maps closely (almost exactly) to OpenAlex's locations.",
         "properties": {
            "enhancement_type": {
               "const": "location",
               "default": "location",
               "title": "Enhancement Type",
               "type": "string"
            },
            "locations": {
               "description": "A list of locations where this reference can be found.",
               "items": {
                  "$ref": "#/$defs/Location"
               },
               "title": "Locations",
               "type": "array"
            }
         },
         "required": [
            "locations"
         ],
         "title": "LocationEnhancement",
         "type": "object"
      },
      "RobotError": {
         "description": "A record of something going wrong with the robot.",
         "properties": {
            "message": {
               "description": "Message which describes the error encountered during processing",
               "title": "Message",
               "type": "string"
            }
         },
         "required": [
            "message"
         ],
         "title": "RobotError",
         "type": "object"
      },
      "ScoreAnnotation": {
         "description": "An annotation which represents the score for a label.\n\nThis is similar to a BooleanAnnotation, but lacks a boolean determination\nas to the application of the label.",
         "properties": {
            "annotation_type": {
               "const": "score",
               "default": "score",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "score": {
               "description": "Score for this annotation",
               "title": "Score",
               "type": "number"
            },
            "data": {
               "additionalProperties": true,
               "description": "An object representation of the annotation including any confidence scores or descriptions.",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "score"
         ],
         "title": "ScoreAnnotation",
         "type": "object"
      },
      "Visibility": {
         "description": "The visibility of a data element in the repository.\n\nThis is used to manage whether information should be publicly available or\nrestricted (generally due to copyright constraints from publishers).\n\nTODO: Implement data governance layer to manage this.\n\n**Allowed values**:\n\n- `public`: Visible to the general public without authentication.\n- `restricted`: Requires authentication to be visible.\n- `hidden`: Is not visible, but may be passed to data mining processes.",
         "enum": [
            "public",
            "restricted",
            "hidden"
         ],
         "title": "Visibility",
         "type": "string"
      }
   },
   "required": [
      "request_id"
   ]
}

Fields:
Validators:
field enhancement: Enhancement | None = None[source]#

An enhancement to create

Validated by:
field error: RobotError | None = None[source]#

Error the robot encountered while creating enhancement.

Validated by:
field request_id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#
Constraints:
  • uuid_version = 4

Validated by:
validator validate_error_or_enhancement_set  »  all fields[source]#

Validate that a robot result has either an error or an enhancement set.

Enhancements#

Enhancement classes for the Destiny Repository.

pydantic model libs.sdk.src.destiny_sdk.enhancements.AbstractContentEnhancement[source]#

An enhancement which is specific to the abstract of a reference.

This is separate from the BibliographicMetadata for two reasons:

1. Abstracts are increasingly missing from sources like OpenAlex, and may be backfilled from other sources, without the bibliographic metadata. 2. They are also subject to copyright limitations in ways which metadata are not, and thus need separate visibility controls.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.enhancements.AbstractContentEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AbstractContentEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ABSTRACT]</td></tr><tr><td>process</td><td port="process">AbstractProcessType</td></tr><tr><td>abstract</td><td port="abstract">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.AbstractContentEnhancement&#xA;&#xA;An enhancement which is specific to the abstract of a \
reference.&#xA;&#xA;This is separate from the `BibliographicMetadata` for two reasons:&#xA;&#xA;1. Abstracts are increasingly missing \
from sources like OpenAlex, and may be&#xA;backfilled from other sources, without the bibliographic metadata.&#xA;2. They are also \
subject to copyright limitations in ways which metadata are&#xA;not, and thus need separate visibility controls.&#xA;"];
}

Show JSON schema
{
   "title": "AbstractContentEnhancement",
   "description": "An enhancement which is specific to the abstract of a reference.\n\nThis is separate from the `BibliographicMetadata` for two reasons:\n\n1. Abstracts are increasingly missing from sources like OpenAlex, and may be\nbackfilled from other sources, without the bibliographic metadata.\n2. They are also subject to copyright limitations in ways which metadata are\nnot, and thus need separate visibility controls.",
   "type": "object",
   "properties": {
      "enhancement_type": {
         "const": "abstract",
         "default": "abstract",
         "title": "Enhancement Type",
         "type": "string"
      },
      "process": {
         "$ref": "#/$defs/AbstractProcessType",
         "description": "The process used to acquire the abstract."
      },
      "abstract": {
         "description": "The abstract of the reference.",
         "title": "Abstract",
         "type": "string"
      }
   },
   "$defs": {
      "AbstractProcessType": {
         "description": "The process used to acquyire the abstract.\n\n**Allowed values**:\n- `uninverted`\n- `closed_api`\n- `other`",
         "enum": [
            "uninverted",
            "closed_api",
            "other"
         ],
         "title": "AbstractProcessType",
         "type": "string"
      }
   },
   "required": [
      "process",
      "abstract"
   ]
}

Fields:
field abstract: str [Required][source]#

The abstract of the reference.

field enhancement_type: Literal[EnhancementType.ABSTRACT] = EnhancementType.ABSTRACT[source]#
field process: AbstractProcessType [Required][source]#

The process used to acquire the abstract.

class libs.sdk.src.destiny_sdk.enhancements.AbstractProcessType(*values)[source]#

The process used to acquyire the abstract.

Allowed values: - uninverted - closed_api - other

CLOSED_API = 'closed_api'[source]#
OTHER = 'other'[source]#
UNINVERTED = 'uninverted'[source]#
libs.sdk.src.destiny_sdk.enhancements.Annotation[source]#

Union type for all annotations.

alias of Annotated[BooleanAnnotation | ScoreAnnotation, FieldInfo(annotation=NoneType, required=True, discriminator=’annotation_type’)]

pydantic model libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement[source]#

An enhancement which is composed of a list of Annotations.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AnnotationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ANNOTATION]</td></tr><tr><td>annotations</td><td port="annotations">list[BooleanAnnotation | ScoreAnnotation]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement&#xA;&#xA;An enhancement which is composed of a list of Annotations.&#\
xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BooleanAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.BOOLEAN]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>value</td><td port="value">bool</td></tr><tr><td>score</td><td port="score">float | None</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation&#xA;&#xA;An annotation is a way of tagging the content with a label of some \
kind.&#xA;&#xA;This class will probably be broken up in the future, but covers most of our&#xA;initial cases.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ScoreAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.SCORE]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>score</td><td port="score">float</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation&#xA;&#xA;An annotation which represents the score for a label.&#xA;&#xA;This \
is similar to a BooleanAnnotation, but lacks a boolean determination&#xA;as to the application of the label.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "AnnotationEnhancement",
   "description": "An enhancement which is composed of a list of Annotations.",
   "type": "object",
   "properties": {
      "enhancement_type": {
         "const": "annotation",
         "default": "annotation",
         "title": "Enhancement Type",
         "type": "string"
      },
      "annotations": {
         "items": {
            "discriminator": {
               "mapping": {
                  "boolean": "#/$defs/BooleanAnnotation",
                  "score": "#/$defs/ScoreAnnotation"
               },
               "propertyName": "annotation_type"
            },
            "oneOf": [
               {
                  "$ref": "#/$defs/BooleanAnnotation"
               },
               {
                  "$ref": "#/$defs/ScoreAnnotation"
               }
            ]
         },
         "title": "Annotations",
         "type": "array"
      }
   },
   "$defs": {
      "BooleanAnnotation": {
         "description": "An annotation is a way of tagging the content with a label of some kind.\n\nThis class will probably be broken up in the future, but covers most of our\ninitial cases.",
         "properties": {
            "annotation_type": {
               "const": "boolean",
               "default": "boolean",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of the annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "value": {
               "description": "Boolean flag for this annotation",
               "title": "Value",
               "type": "boolean"
            },
            "score": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A confidence score for this annotation",
               "title": "Score"
            },
            "data": {
               "additionalProperties": true,
               "description": "\nAn object representation of the annotation including any confidence scores or\ndescriptions.\n",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "value"
         ],
         "title": "BooleanAnnotation",
         "type": "object"
      },
      "ScoreAnnotation": {
         "description": "An annotation which represents the score for a label.\n\nThis is similar to a BooleanAnnotation, but lacks a boolean determination\nas to the application of the label.",
         "properties": {
            "annotation_type": {
               "const": "score",
               "default": "score",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "score": {
               "description": "Score for this annotation",
               "title": "Score",
               "type": "number"
            },
            "data": {
               "additionalProperties": true,
               "description": "An object representation of the annotation including any confidence scores or descriptions.",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "score"
         ],
         "title": "ScoreAnnotation",
         "type": "object"
      }
   },
   "required": [
      "annotations"
   ]
}

Fields:
field annotations: list[Annotated[BooleanAnnotation | ScoreAnnotation, FieldInfo(annotation=NoneType, required=True, discriminator='annotation_type')]] [Required][source]#
field enhancement_type: Literal[EnhancementType.ANNOTATION] = EnhancementType.ANNOTATION[source]#
class libs.sdk.src.destiny_sdk.enhancements.AnnotationType(*values)[source]#

The type of annotation.

This is used to identify the type of annotation in the Annotation class.

Allowed values: - boolean: An annotation which is the boolean application of a label across a reference. - score: An annotation which is a score for a label across a reference, without a boolean value.

BOOLEAN = 'boolean'[source]#
SCORE = 'score'[source]#
class libs.sdk.src.destiny_sdk.enhancements.AuthorPosition(*values)[source]#

The position of an author in a list of authorships.

Maps to the data from OpenAlex.

Allowed values: - first: The first author. - middle: Any middle author - last: The last author

FIRST = 'first'[source]#
LAST = 'last'[source]#
MIDDLE = 'middle'[source]#
pydantic model libs.sdk.src.destiny_sdk.enhancements.Authorship[source]#

Represents a single author and their association with a reference.

This is a simplification of the OpenAlex [Authorship object](https://docs.openalex.org/api-entities/works/work-object/authorship-object) for our purposes.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.enhancements.Authorship"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Authorship</b></td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>orcid</td><td port="orcid">str</td></tr><tr><td>position</td><td port="position">AuthorPosition</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.Authorship&#xA;&#xA;Represents a single author and their association with a reference.&#xA;&#\
xA;This is a simplification of the OpenAlex [Authorship&#xA;object](https://docs.openalex.org/api-entities/works/work-object/authorship-object)&#\
xA;for our purposes.&#xA;"];
}

Show JSON schema
{
   "title": "Authorship",
   "description": "Represents a single author and their association with a reference.\n\nThis is a simplification of the OpenAlex [Authorship\nobject](https://docs.openalex.org/api-entities/works/work-object/authorship-object)\nfor our purposes.",
   "type": "object",
   "properties": {
      "display_name": {
         "description": "The display name of the author.",
         "title": "Display Name",
         "type": "string"
      },
      "orcid": {
         "description": "The ORCid of the author.",
         "title": "Orcid",
         "type": "string"
      },
      "position": {
         "$ref": "#/$defs/AuthorPosition",
         "description": "The position of the author within the list of authors."
      }
   },
   "$defs": {
      "AuthorPosition": {
         "description": "The position of an author in a list of authorships.\n\nMaps to the data from OpenAlex.\n\n**Allowed values**:\n- `first`: The first author.\n- `middle`: Any middle author\n- `last`: The last author",
         "enum": [
            "first",
            "middle",
            "last"
         ],
         "title": "AuthorPosition",
         "type": "string"
      }
   },
   "required": [
      "display_name",
      "orcid",
      "position"
   ]
}

Fields:
field display_name: str [Required][source]#

The display name of the author.

field orcid: str [Required][source]#

The ORCid of the author.

field position: AuthorPosition [Required][source]#

The position of the author within the list of authors.

pydantic model libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement[source]#

An enhancement which is made up of bibliographic metadata.

Generally this will be sourced from a database such as OpenAlex or similar. For directly contributed references, these may not be complete.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.enhancements.Authorship"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Authorship</b></td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>orcid</td><td port="orcid">str</td></tr><tr><td>position</td><td port="position">AuthorPosition</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.Authorship&#xA;&#xA;Represents a single author and their association with a reference.&#xA;&#\
xA;This is a simplification of the OpenAlex [Authorship&#xA;object](https://docs.openalex.org/api-entities/works/work-object/authorship-object)&#\
xA;for our purposes.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BibliographicMetadataEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.BIBLIOGRAPHIC]</td></tr><tr><td>authorship</td><td port="authorship">list[Authorship] | None</td></tr><tr><td>cited_by_count</td><td port="cited_by_count">int | None</td></tr><tr><td>created_date</td><td port="created_date">date | None</td></tr><tr><td>publication_date</td><td port="publication_date">date | None</td></tr><tr><td>publication_year</td><td port="publication_year">int | None</td></tr><tr><td>publisher</td><td port="publisher">str | None</td></tr><tr><td>title</td><td port="title">str | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement&#xA;&#xA;An enhancement which is made up of bibliographic \
metadata.&#xA;&#xA;Generally this will be sourced from a database such as OpenAlex or similar.&#xA;For directly contributed references, \
these may not be complete.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement":authorship:e -> "libs.sdk.src.destiny_sdk.enhancements.Authorship":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "BibliographicMetadataEnhancement",
   "description": "An enhancement which is made up of bibliographic metadata.\n\nGenerally this will be sourced from a database such as OpenAlex or similar.\nFor directly contributed references, these may not be complete.",
   "type": "object",
   "properties": {
      "enhancement_type": {
         "const": "bibliographic",
         "default": "bibliographic",
         "title": "Enhancement Type",
         "type": "string"
      },
      "authorship": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Authorship"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of `Authorships` belonging to this reference.",
         "title": "Authorship"
      },
      "cited_by_count": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\n(From OpenAlex) The number of citations to this work. These are the times that\nother works have cited this work\n",
         "title": "Cited By Count"
      },
      "created_date": {
         "anyOf": [
            {
               "format": "date",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The ISO8601 date this metadata record was created",
         "title": "Created Date"
      },
      "publication_date": {
         "anyOf": [
            {
               "format": "date",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The date which the version of record was published.",
         "title": "Publication Date"
      },
      "publication_year": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The year in which the version of record was published.",
         "title": "Publication Year"
      },
      "publisher": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The name of the entity which published the version of record.",
         "title": "Publisher"
      },
      "title": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The title of the reference.",
         "title": "Title"
      }
   },
   "$defs": {
      "AuthorPosition": {
         "description": "The position of an author in a list of authorships.\n\nMaps to the data from OpenAlex.\n\n**Allowed values**:\n- `first`: The first author.\n- `middle`: Any middle author\n- `last`: The last author",
         "enum": [
            "first",
            "middle",
            "last"
         ],
         "title": "AuthorPosition",
         "type": "string"
      },
      "Authorship": {
         "description": "Represents a single author and their association with a reference.\n\nThis is a simplification of the OpenAlex [Authorship\nobject](https://docs.openalex.org/api-entities/works/work-object/authorship-object)\nfor our purposes.",
         "properties": {
            "display_name": {
               "description": "The display name of the author.",
               "title": "Display Name",
               "type": "string"
            },
            "orcid": {
               "description": "The ORCid of the author.",
               "title": "Orcid",
               "type": "string"
            },
            "position": {
               "$ref": "#/$defs/AuthorPosition",
               "description": "The position of the author within the list of authors."
            }
         },
         "required": [
            "display_name",
            "orcid",
            "position"
         ],
         "title": "Authorship",
         "type": "object"
      }
   }
}

Fields:
field authorship: list[Authorship] | None = None[source]#

A list of Authorships belonging to this reference.

field cited_by_count: int | None = None[source]#

(From OpenAlex) The number of citations to this work. These are the times that other works have cited this work

field created_date: date | None = None[source]#

The ISO8601 date this metadata record was created

field enhancement_type: Literal[EnhancementType.BIBLIOGRAPHIC] = EnhancementType.BIBLIOGRAPHIC[source]#
field publication_date: date | None = None[source]#

The date which the version of record was published.

field publication_year: int | None = None[source]#

The year in which the version of record was published.

field publisher: str | None = None[source]#

The name of the entity which published the version of record.

field title: str | None = None[source]#

The title of the reference.

pydantic model libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation[source]#

An annotation is a way of tagging the content with a label of some kind.

This class will probably be broken up in the future, but covers most of our initial cases.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BooleanAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.BOOLEAN]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>value</td><td port="value">bool</td></tr><tr><td>score</td><td port="score">float | None</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation&#xA;&#xA;An annotation is a way of tagging the content with a label of some \
kind.&#xA;&#xA;This class will probably be broken up in the future, but covers most of our&#xA;initial cases.&#xA;"];
}

Show JSON schema
{
   "title": "BooleanAnnotation",
   "description": "An annotation is a way of tagging the content with a label of some kind.\n\nThis class will probably be broken up in the future, but covers most of our\ninitial cases.",
   "type": "object",
   "properties": {
      "annotation_type": {
         "const": "boolean",
         "default": "boolean",
         "title": "Annotation Type",
         "type": "string"
      },
      "scheme": {
         "description": "An identifier for the scheme of the annotation",
         "examples": [
            "openalex:topic",
            "pubmed:mesh"
         ],
         "title": "Scheme",
         "type": "string"
      },
      "label": {
         "description": "A high level label for this annotation like the name of the topic",
         "title": "Label",
         "type": "string"
      },
      "value": {
         "description": "Boolean flag for this annotation",
         "title": "Value",
         "type": "boolean"
      },
      "score": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A confidence score for this annotation",
         "title": "Score"
      },
      "data": {
         "additionalProperties": true,
         "description": "\nAn object representation of the annotation including any confidence scores or\ndescriptions.\n",
         "title": "Data",
         "type": "object"
      }
   },
   "required": [
      "scheme",
      "label",
      "value"
   ]
}

Fields:
field annotation_type: Literal[AnnotationType.BOOLEAN] = AnnotationType.BOOLEAN[source]#
field data: dict [Optional][source]#

An object representation of the annotation including any confidence scores or descriptions.

field label: str [Required][source]#

A high level label for this annotation like the name of the topic

field scheme: str [Required][source]#

An identifier for the scheme of the annotation

field score: float | None = None[source]#

A confidence score for this annotation

field value: bool [Required][source]#

Boolean flag for this annotation

class libs.sdk.src.destiny_sdk.enhancements.DriverVersion(*values)[source]#

The version based on the DRIVER guidelines versioning scheme.

(Borrowed from OpenAlex)

Allowed values: - publishedVersion: The document’s version of record. This is the most authoritative version. - acceptedVersion: The document after having completed peer review and being officially accepted for publication. It will lack publisher formatting, but the content should be interchangeable with the that of the publishedVersion. - submittedVersion: the document as submitted to the publisher by the authors, but before peer-review. Its content may differ significantly from that of the accepted article.

ACCEPTED_VERSION = 'acceptedVersion'[source]#
OTHER = 'other'[source]#
PUBLISHED_VERSION = 'publishedVersion'[source]#
SUBMITTED_VERSION = 'submittedVersion'[source]#
pydantic model libs.sdk.src.destiny_sdk.enhancements.Enhancement[source]#

Core enhancement class.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.enhancements.AbstractContentEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AbstractContentEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ABSTRACT]</td></tr><tr><td>process</td><td port="process">AbstractProcessType</td></tr><tr><td>abstract</td><td port="abstract">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.AbstractContentEnhancement&#xA;&#xA;An enhancement which is specific to the abstract of a \
reference.&#xA;&#xA;This is separate from the `BibliographicMetadata` for two reasons:&#xA;&#xA;1. Abstracts are increasingly missing \
from sources like OpenAlex, and may be&#xA;backfilled from other sources, without the bibliographic metadata.&#xA;2. They are also \
subject to copyright limitations in ways which metadata are&#xA;not, and thus need separate visibility controls.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AnnotationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ANNOTATION]</td></tr><tr><td>annotations</td><td port="annotations">list[BooleanAnnotation | ScoreAnnotation]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement&#xA;&#xA;An enhancement which is composed of a list of Annotations.&#\
xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BooleanAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.BOOLEAN]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>value</td><td port="value">bool</td></tr><tr><td>score</td><td port="score">float | None</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation&#xA;&#xA;An annotation is a way of tagging the content with a label of some \
kind.&#xA;&#xA;This class will probably be broken up in the future, but covers most of our&#xA;initial cases.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ScoreAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.SCORE]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>score</td><td port="score">float</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation&#xA;&#xA;An annotation which represents the score for a label.&#xA;&#xA;This \
is similar to a BooleanAnnotation, but lacks a boolean determination&#xA;as to the application of the label.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.Authorship"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Authorship</b></td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>orcid</td><td port="orcid">str</td></tr><tr><td>position</td><td port="position">AuthorPosition</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.Authorship&#xA;&#xA;Represents a single author and their association with a reference.&#xA;&#\
xA;This is a simplification of the OpenAlex [Authorship&#xA;object](https://docs.openalex.org/api-entities/works/work-object/authorship-object)&#\
xA;for our purposes.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BibliographicMetadataEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.BIBLIOGRAPHIC]</td></tr><tr><td>authorship</td><td port="authorship">list[Authorship] | None</td></tr><tr><td>cited_by_count</td><td port="cited_by_count">int | None</td></tr><tr><td>created_date</td><td port="created_date">date | None</td></tr><tr><td>publication_date</td><td port="publication_date">date | None</td></tr><tr><td>publication_year</td><td port="publication_year">int | None</td></tr><tr><td>publisher</td><td port="publisher">str | None</td></tr><tr><td>title</td><td port="title">str | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement&#xA;&#xA;An enhancement which is made up of bibliographic \
metadata.&#xA;&#xA;Generally this will be sourced from a database such as OpenAlex or similar.&#xA;For directly contributed references, \
these may not be complete.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement":authorship:e -> "libs.sdk.src.destiny_sdk.enhancements.Authorship":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.Enhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Enhancement</b></td></tr><tr><td>reference_id</td><td port="reference_id">UUID</td></tr><tr><td>source</td><td port="source">str</td></tr><tr><td>visibility</td><td port="visibility">Visibility</td></tr><tr><td>robot_version</td><td port="robot_version">str | None</td></tr><tr><td>derived_from</td><td port="derived_from">list[UUID] | None</td></tr><tr><td>content</td><td port="content">BibliographicMetadataEnhancement | AbstractContentEnhancement | AnnotationEnhancement | LocationEnhancement</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.Enhancement&#xA;&#xA;Core enhancement class.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.Enhancement":content:e -> "libs.sdk.src.destiny_sdk.enhancements.AbstractContentEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.Enhancement":content:e -> "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.Enhancement":content:e -> "libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LocationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.LOCATION]</td></tr><tr><td>locations</td><td port="locations">list[Location]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement&#xA;&#xA;An enhancement which describes locations where this reference \
can be found.&#xA;&#xA;This maps closely (almost exactly) to OpenAlex's locations.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.Enhancement":content:e -> "libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.Location"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Location</b></td></tr><tr><td>is_oa</td><td port="is_oa">bool | None</td></tr><tr><td>version</td><td port="version">DriverVersion | None</td></tr><tr><td>landing_page_url</td><td port="landing_page_url">HttpUrl | None</td></tr><tr><td>pdf_url</td><td port="pdf_url">HttpUrl | None</td></tr><tr><td>license</td><td port="license">str | None</td></tr><tr><td>extra</td><td port="extra">dict | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.Location&#xA;&#xA;A location where a reference can be found.&#xA;&#xA;This maps almost completely \
to the OpenAlex&#xA;[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement":locations:e -> "libs.sdk.src.destiny_sdk.enhancements.Location":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "Enhancement",
   "description": "Core enhancement class.",
   "type": "object",
   "properties": {
      "reference_id": {
         "description": "The ID of the reference this enhancement is associated with.",
         "format": "uuid",
         "title": "Reference Id",
         "type": "string"
      },
      "source": {
         "description": "The enhancement source for tracking provenance.",
         "title": "Source",
         "type": "string"
      },
      "visibility": {
         "$ref": "#/$defs/Visibility",
         "description": "The level of visibility of the enhancement"
      },
      "robot_version": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The version of the robot that generated the content.",
         "title": "Robot Version"
      },
      "derived_from": {
         "anyOf": [
            {
               "items": {
                  "format": "uuid",
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of enhancement IDs that this enhancement was derived from.",
         "title": "Derived From"
      },
      "content": {
         "description": "The content of the enhancement.",
         "discriminator": {
            "mapping": {
               "abstract": "#/$defs/AbstractContentEnhancement",
               "annotation": "#/$defs/AnnotationEnhancement",
               "bibliographic": "#/$defs/BibliographicMetadataEnhancement",
               "location": "#/$defs/LocationEnhancement"
            },
            "propertyName": "enhancement_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/BibliographicMetadataEnhancement"
            },
            {
               "$ref": "#/$defs/AbstractContentEnhancement"
            },
            {
               "$ref": "#/$defs/AnnotationEnhancement"
            },
            {
               "$ref": "#/$defs/LocationEnhancement"
            }
         ],
         "title": "Content"
      }
   },
   "$defs": {
      "AbstractContentEnhancement": {
         "description": "An enhancement which is specific to the abstract of a reference.\n\nThis is separate from the `BibliographicMetadata` for two reasons:\n\n1. Abstracts are increasingly missing from sources like OpenAlex, and may be\nbackfilled from other sources, without the bibliographic metadata.\n2. They are also subject to copyright limitations in ways which metadata are\nnot, and thus need separate visibility controls.",
         "properties": {
            "enhancement_type": {
               "const": "abstract",
               "default": "abstract",
               "title": "Enhancement Type",
               "type": "string"
            },
            "process": {
               "$ref": "#/$defs/AbstractProcessType",
               "description": "The process used to acquire the abstract."
            },
            "abstract": {
               "description": "The abstract of the reference.",
               "title": "Abstract",
               "type": "string"
            }
         },
         "required": [
            "process",
            "abstract"
         ],
         "title": "AbstractContentEnhancement",
         "type": "object"
      },
      "AbstractProcessType": {
         "description": "The process used to acquyire the abstract.\n\n**Allowed values**:\n- `uninverted`\n- `closed_api`\n- `other`",
         "enum": [
            "uninverted",
            "closed_api",
            "other"
         ],
         "title": "AbstractProcessType",
         "type": "string"
      },
      "AnnotationEnhancement": {
         "description": "An enhancement which is composed of a list of Annotations.",
         "properties": {
            "enhancement_type": {
               "const": "annotation",
               "default": "annotation",
               "title": "Enhancement Type",
               "type": "string"
            },
            "annotations": {
               "items": {
                  "discriminator": {
                     "mapping": {
                        "boolean": "#/$defs/BooleanAnnotation",
                        "score": "#/$defs/ScoreAnnotation"
                     },
                     "propertyName": "annotation_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/BooleanAnnotation"
                     },
                     {
                        "$ref": "#/$defs/ScoreAnnotation"
                     }
                  ]
               },
               "title": "Annotations",
               "type": "array"
            }
         },
         "required": [
            "annotations"
         ],
         "title": "AnnotationEnhancement",
         "type": "object"
      },
      "AuthorPosition": {
         "description": "The position of an author in a list of authorships.\n\nMaps to the data from OpenAlex.\n\n**Allowed values**:\n- `first`: The first author.\n- `middle`: Any middle author\n- `last`: The last author",
         "enum": [
            "first",
            "middle",
            "last"
         ],
         "title": "AuthorPosition",
         "type": "string"
      },
      "Authorship": {
         "description": "Represents a single author and their association with a reference.\n\nThis is a simplification of the OpenAlex [Authorship\nobject](https://docs.openalex.org/api-entities/works/work-object/authorship-object)\nfor our purposes.",
         "properties": {
            "display_name": {
               "description": "The display name of the author.",
               "title": "Display Name",
               "type": "string"
            },
            "orcid": {
               "description": "The ORCid of the author.",
               "title": "Orcid",
               "type": "string"
            },
            "position": {
               "$ref": "#/$defs/AuthorPosition",
               "description": "The position of the author within the list of authors."
            }
         },
         "required": [
            "display_name",
            "orcid",
            "position"
         ],
         "title": "Authorship",
         "type": "object"
      },
      "BibliographicMetadataEnhancement": {
         "description": "An enhancement which is made up of bibliographic metadata.\n\nGenerally this will be sourced from a database such as OpenAlex or similar.\nFor directly contributed references, these may not be complete.",
         "properties": {
            "enhancement_type": {
               "const": "bibliographic",
               "default": "bibliographic",
               "title": "Enhancement Type",
               "type": "string"
            },
            "authorship": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Authorship"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `Authorships` belonging to this reference.",
               "title": "Authorship"
            },
            "cited_by_count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex) The number of citations to this work. These are the times that\nother works have cited this work\n",
               "title": "Cited By Count"
            },
            "created_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ISO8601 date this metadata record was created",
               "title": "Created Date"
            },
            "publication_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The date which the version of record was published.",
               "title": "Publication Date"
            },
            "publication_year": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The year in which the version of record was published.",
               "title": "Publication Year"
            },
            "publisher": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the entity which published the version of record.",
               "title": "Publisher"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The title of the reference.",
               "title": "Title"
            }
         },
         "title": "BibliographicMetadataEnhancement",
         "type": "object"
      },
      "BooleanAnnotation": {
         "description": "An annotation is a way of tagging the content with a label of some kind.\n\nThis class will probably be broken up in the future, but covers most of our\ninitial cases.",
         "properties": {
            "annotation_type": {
               "const": "boolean",
               "default": "boolean",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of the annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "value": {
               "description": "Boolean flag for this annotation",
               "title": "Value",
               "type": "boolean"
            },
            "score": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A confidence score for this annotation",
               "title": "Score"
            },
            "data": {
               "additionalProperties": true,
               "description": "\nAn object representation of the annotation including any confidence scores or\ndescriptions.\n",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "value"
         ],
         "title": "BooleanAnnotation",
         "type": "object"
      },
      "DriverVersion": {
         "description": "The version based on the DRIVER guidelines versioning scheme.\n\n(Borrowed from OpenAlex)\n\nAllowed values:\n- `publishedVersion`: The document's version of record. This is the most\nauthoritative version.\n- `acceptedVersion`: The document after having completed peer review and being\nofficially accepted for publication. It will lack publisher formatting, but the\ncontent should be interchangeable with the that of the publishedVersion.\n- `submittedVersion`: the document as submitted to the publisher by the authors, but\nbefore peer-review. Its content may differ significantly from that of the accepted\narticle.",
         "enum": [
            "publishedVersion",
            "acceptedVersion",
            "submittedVersion",
            "other"
         ],
         "title": "DriverVersion",
         "type": "string"
      },
      "Location": {
         "description": "A location where a reference can be found.\n\nThis maps almost completely to the OpenAlex\n[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)",
         "properties": {
            "is_oa": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): True if an Open Access (OA) version of this work is available\nat this location. May be left as null if this is unknown (and thus)\ntreated effectively as `false`.\n",
               "title": "Is Oa"
            },
            "version": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DriverVersion"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nThe version (according to the DRIVER versioning scheme) of this location.\n"
            },
            "landing_page_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "(From OpenAlex): The landing page URL for this location.",
               "title": "Landing Page Url"
            },
            "pdf_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): A URL where you can find this location as a PDF.\n",
               "title": "Pdf Url"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): The location's publishing license. This can be a Creative\nCommons license such as cc0 or cc-by, a publisher-specific license, or null\nwhich means we are not able to determine a license for this location.\n",
               "title": "License"
            },
            "extra": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Any extra metadata about this location",
               "title": "Extra"
            }
         },
         "title": "Location",
         "type": "object"
      },
      "LocationEnhancement": {
         "description": "An enhancement which describes locations where this reference can be found.\n\nThis maps closely (almost exactly) to OpenAlex's locations.",
         "properties": {
            "enhancement_type": {
               "const": "location",
               "default": "location",
               "title": "Enhancement Type",
               "type": "string"
            },
            "locations": {
               "description": "A list of locations where this reference can be found.",
               "items": {
                  "$ref": "#/$defs/Location"
               },
               "title": "Locations",
               "type": "array"
            }
         },
         "required": [
            "locations"
         ],
         "title": "LocationEnhancement",
         "type": "object"
      },
      "ScoreAnnotation": {
         "description": "An annotation which represents the score for a label.\n\nThis is similar to a BooleanAnnotation, but lacks a boolean determination\nas to the application of the label.",
         "properties": {
            "annotation_type": {
               "const": "score",
               "default": "score",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "score": {
               "description": "Score for this annotation",
               "title": "Score",
               "type": "number"
            },
            "data": {
               "additionalProperties": true,
               "description": "An object representation of the annotation including any confidence scores or descriptions.",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "score"
         ],
         "title": "ScoreAnnotation",
         "type": "object"
      },
      "Visibility": {
         "description": "The visibility of a data element in the repository.\n\nThis is used to manage whether information should be publicly available or\nrestricted (generally due to copyright constraints from publishers).\n\nTODO: Implement data governance layer to manage this.\n\n**Allowed values**:\n\n- `public`: Visible to the general public without authentication.\n- `restricted`: Requires authentication to be visible.\n- `hidden`: Is not visible, but may be passed to data mining processes.",
         "enum": [
            "public",
            "restricted",
            "hidden"
         ],
         "title": "Visibility",
         "type": "string"
      }
   },
   "required": [
      "reference_id",
      "source",
      "visibility",
      "content"
   ]
}

Fields:
field content: Annotated[BibliographicMetadataEnhancement | AbstractContentEnhancement | AnnotationEnhancement | LocationEnhancement, FieldInfo(annotation=NoneType, required=True, discriminator='enhancement_type'), FieldInfo(annotation=NoneType, required=True, description='The content of the enhancement.', discriminator='enhancement_type')] [Required][source]#

The content of the enhancement.

field derived_from: list[UUID] | None = None[source]#

List of enhancement IDs that this enhancement was derived from.

field reference_id: UUID [Required][source]#

The ID of the reference this enhancement is associated with.

field robot_version: str | None = None[source]#

The version of the robot that generated the content.

field source: str [Required][source]#

The enhancement source for tracking provenance.

field visibility: Visibility [Required][source]#

The level of visibility of the enhancement

classmethod from_jsonl(jsonl: str) Self[source]#

Create an object from a JSONL string.

Parameters:

jsonl (str) – The JSONL string to parse.

Returns:

The created object.

Return type:

Self

to_jsonl() str[source]#

Convert the model to a JSONL string.

Returns:

The JSONL string representation of the model.

Return type:

str

libs.sdk.src.destiny_sdk.enhancements.EnhancementContent[source]#

Union type for all enhancement content types.

alias of Annotated[BibliographicMetadataEnhancement | AbstractContentEnhancement | AnnotationEnhancement | LocationEnhancement, FieldInfo(annotation=NoneType, required=True, discriminator=’enhancement_type’)]

pydantic model libs.sdk.src.destiny_sdk.enhancements.EnhancementFileInput[source]#

Enhancement model used to marshall a file input to new references.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.enhancements.AbstractContentEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AbstractContentEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ABSTRACT]</td></tr><tr><td>process</td><td port="process">AbstractProcessType</td></tr><tr><td>abstract</td><td port="abstract">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.AbstractContentEnhancement&#xA;&#xA;An enhancement which is specific to the abstract of a \
reference.&#xA;&#xA;This is separate from the `BibliographicMetadata` for two reasons:&#xA;&#xA;1. Abstracts are increasingly missing \
from sources like OpenAlex, and may be&#xA;backfilled from other sources, without the bibliographic metadata.&#xA;2. They are also \
subject to copyright limitations in ways which metadata are&#xA;not, and thus need separate visibility controls.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AnnotationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ANNOTATION]</td></tr><tr><td>annotations</td><td port="annotations">list[BooleanAnnotation | ScoreAnnotation]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement&#xA;&#xA;An enhancement which is composed of a list of Annotations.&#\
xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BooleanAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.BOOLEAN]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>value</td><td port="value">bool</td></tr><tr><td>score</td><td port="score">float | None</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation&#xA;&#xA;An annotation is a way of tagging the content with a label of some \
kind.&#xA;&#xA;This class will probably be broken up in the future, but covers most of our&#xA;initial cases.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "libs.sdk.src.destiny_sdk.enhancements.BooleanAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ScoreAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.SCORE]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>score</td><td port="score">float</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation&#xA;&#xA;An annotation which represents the score for a label.&#xA;&#xA;This \
is similar to a BooleanAnnotation, but lacks a boolean determination&#xA;as to the application of the label.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.Authorship"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Authorship</b></td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>orcid</td><td port="orcid">str</td></tr><tr><td>position</td><td port="position">AuthorPosition</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.Authorship&#xA;&#xA;Represents a single author and their association with a reference.&#xA;&#\
xA;This is a simplification of the OpenAlex [Authorship&#xA;object](https://docs.openalex.org/api-entities/works/work-object/authorship-object)&#\
xA;for our purposes.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BibliographicMetadataEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.BIBLIOGRAPHIC]</td></tr><tr><td>authorship</td><td port="authorship">list[Authorship] | None</td></tr><tr><td>cited_by_count</td><td port="cited_by_count">int | None</td></tr><tr><td>created_date</td><td port="created_date">date | None</td></tr><tr><td>publication_date</td><td port="publication_date">date | None</td></tr><tr><td>publication_year</td><td port="publication_year">int | None</td></tr><tr><td>publisher</td><td port="publisher">str | None</td></tr><tr><td>title</td><td port="title">str | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement&#xA;&#xA;An enhancement which is made up of bibliographic \
metadata.&#xA;&#xA;Generally this will be sourced from a database such as OpenAlex or similar.&#xA;For directly contributed references, \
these may not be complete.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement":authorship:e -> "libs.sdk.src.destiny_sdk.enhancements.Authorship":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.EnhancementFileInput"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>EnhancementFileInput</b></td></tr><tr><td>source</td><td port="source">str</td></tr><tr><td>visibility</td><td port="visibility">Visibility</td></tr><tr><td>enhancement_type</td><td port="enhancement_type">EnhancementType</td></tr><tr><td>robot_version</td><td port="robot_version">str | None</td></tr><tr><td>content</td><td port="content">BibliographicMetadataEnhancement | AbstractContentEnhancement | AnnotationEnhancement | LocationEnhancement</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.EnhancementFileInput&#xA;&#xA;Enhancement model used to marshall a file input to new references.&#\
xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.EnhancementFileInput":content:e -> "libs.sdk.src.destiny_sdk.enhancements.AbstractContentEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.EnhancementFileInput":content:e -> "libs.sdk.src.destiny_sdk.enhancements.AnnotationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.EnhancementFileInput":content:e -> "libs.sdk.src.destiny_sdk.enhancements.BibliographicMetadataEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LocationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.LOCATION]</td></tr><tr><td>locations</td><td port="locations">list[Location]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement&#xA;&#xA;An enhancement which describes locations where this reference \
can be found.&#xA;&#xA;This maps closely (almost exactly) to OpenAlex's locations.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.EnhancementFileInput":content:e -> "libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.enhancements.Location"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Location</b></td></tr><tr><td>is_oa</td><td port="is_oa">bool | None</td></tr><tr><td>version</td><td port="version">DriverVersion | None</td></tr><tr><td>landing_page_url</td><td port="landing_page_url">HttpUrl | None</td></tr><tr><td>pdf_url</td><td port="pdf_url">HttpUrl | None</td></tr><tr><td>license</td><td port="license">str | None</td></tr><tr><td>extra</td><td port="extra">dict | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.Location&#xA;&#xA;A location where a reference can be found.&#xA;&#xA;This maps almost completely \
to the OpenAlex&#xA;[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement":locations:e -> "libs.sdk.src.destiny_sdk.enhancements.Location":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "EnhancementFileInput",
   "description": "Enhancement model used to marshall a file input to new references.",
   "type": "object",
   "properties": {
      "source": {
         "description": "The enhancement source for tracking provenance.",
         "title": "Source",
         "type": "string"
      },
      "visibility": {
         "$ref": "#/$defs/Visibility",
         "description": "The level of visibility of the enhancement"
      },
      "enhancement_type": {
         "$ref": "#/$defs/EnhancementType",
         "description": "The type of enhancement."
      },
      "processor_version": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The version of the robot that generated the content.",
         "title": "Processor Version"
      },
      "content": {
         "description": "The content of the enhancement.",
         "discriminator": {
            "mapping": {
               "abstract": "#/$defs/AbstractContentEnhancement",
               "annotation": "#/$defs/AnnotationEnhancement",
               "bibliographic": "#/$defs/BibliographicMetadataEnhancement",
               "location": "#/$defs/LocationEnhancement"
            },
            "propertyName": "enhancement_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/BibliographicMetadataEnhancement"
            },
            {
               "$ref": "#/$defs/AbstractContentEnhancement"
            },
            {
               "$ref": "#/$defs/AnnotationEnhancement"
            },
            {
               "$ref": "#/$defs/LocationEnhancement"
            }
         ],
         "title": "Content"
      }
   },
   "$defs": {
      "AbstractContentEnhancement": {
         "description": "An enhancement which is specific to the abstract of a reference.\n\nThis is separate from the `BibliographicMetadata` for two reasons:\n\n1. Abstracts are increasingly missing from sources like OpenAlex, and may be\nbackfilled from other sources, without the bibliographic metadata.\n2. They are also subject to copyright limitations in ways which metadata are\nnot, and thus need separate visibility controls.",
         "properties": {
            "enhancement_type": {
               "const": "abstract",
               "default": "abstract",
               "title": "Enhancement Type",
               "type": "string"
            },
            "process": {
               "$ref": "#/$defs/AbstractProcessType",
               "description": "The process used to acquire the abstract."
            },
            "abstract": {
               "description": "The abstract of the reference.",
               "title": "Abstract",
               "type": "string"
            }
         },
         "required": [
            "process",
            "abstract"
         ],
         "title": "AbstractContentEnhancement",
         "type": "object"
      },
      "AbstractProcessType": {
         "description": "The process used to acquyire the abstract.\n\n**Allowed values**:\n- `uninverted`\n- `closed_api`\n- `other`",
         "enum": [
            "uninverted",
            "closed_api",
            "other"
         ],
         "title": "AbstractProcessType",
         "type": "string"
      },
      "AnnotationEnhancement": {
         "description": "An enhancement which is composed of a list of Annotations.",
         "properties": {
            "enhancement_type": {
               "const": "annotation",
               "default": "annotation",
               "title": "Enhancement Type",
               "type": "string"
            },
            "annotations": {
               "items": {
                  "discriminator": {
                     "mapping": {
                        "boolean": "#/$defs/BooleanAnnotation",
                        "score": "#/$defs/ScoreAnnotation"
                     },
                     "propertyName": "annotation_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/BooleanAnnotation"
                     },
                     {
                        "$ref": "#/$defs/ScoreAnnotation"
                     }
                  ]
               },
               "title": "Annotations",
               "type": "array"
            }
         },
         "required": [
            "annotations"
         ],
         "title": "AnnotationEnhancement",
         "type": "object"
      },
      "AuthorPosition": {
         "description": "The position of an author in a list of authorships.\n\nMaps to the data from OpenAlex.\n\n**Allowed values**:\n- `first`: The first author.\n- `middle`: Any middle author\n- `last`: The last author",
         "enum": [
            "first",
            "middle",
            "last"
         ],
         "title": "AuthorPosition",
         "type": "string"
      },
      "Authorship": {
         "description": "Represents a single author and their association with a reference.\n\nThis is a simplification of the OpenAlex [Authorship\nobject](https://docs.openalex.org/api-entities/works/work-object/authorship-object)\nfor our purposes.",
         "properties": {
            "display_name": {
               "description": "The display name of the author.",
               "title": "Display Name",
               "type": "string"
            },
            "orcid": {
               "description": "The ORCid of the author.",
               "title": "Orcid",
               "type": "string"
            },
            "position": {
               "$ref": "#/$defs/AuthorPosition",
               "description": "The position of the author within the list of authors."
            }
         },
         "required": [
            "display_name",
            "orcid",
            "position"
         ],
         "title": "Authorship",
         "type": "object"
      },
      "BibliographicMetadataEnhancement": {
         "description": "An enhancement which is made up of bibliographic metadata.\n\nGenerally this will be sourced from a database such as OpenAlex or similar.\nFor directly contributed references, these may not be complete.",
         "properties": {
            "enhancement_type": {
               "const": "bibliographic",
               "default": "bibliographic",
               "title": "Enhancement Type",
               "type": "string"
            },
            "authorship": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Authorship"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `Authorships` belonging to this reference.",
               "title": "Authorship"
            },
            "cited_by_count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex) The number of citations to this work. These are the times that\nother works have cited this work\n",
               "title": "Cited By Count"
            },
            "created_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ISO8601 date this metadata record was created",
               "title": "Created Date"
            },
            "publication_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The date which the version of record was published.",
               "title": "Publication Date"
            },
            "publication_year": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The year in which the version of record was published.",
               "title": "Publication Year"
            },
            "publisher": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the entity which published the version of record.",
               "title": "Publisher"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The title of the reference.",
               "title": "Title"
            }
         },
         "title": "BibliographicMetadataEnhancement",
         "type": "object"
      },
      "BooleanAnnotation": {
         "description": "An annotation is a way of tagging the content with a label of some kind.\n\nThis class will probably be broken up in the future, but covers most of our\ninitial cases.",
         "properties": {
            "annotation_type": {
               "const": "boolean",
               "default": "boolean",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of the annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "value": {
               "description": "Boolean flag for this annotation",
               "title": "Value",
               "type": "boolean"
            },
            "score": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A confidence score for this annotation",
               "title": "Score"
            },
            "data": {
               "additionalProperties": true,
               "description": "\nAn object representation of the annotation including any confidence scores or\ndescriptions.\n",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "value"
         ],
         "title": "BooleanAnnotation",
         "type": "object"
      },
      "DriverVersion": {
         "description": "The version based on the DRIVER guidelines versioning scheme.\n\n(Borrowed from OpenAlex)\n\nAllowed values:\n- `publishedVersion`: The document's version of record. This is the most\nauthoritative version.\n- `acceptedVersion`: The document after having completed peer review and being\nofficially accepted for publication. It will lack publisher formatting, but the\ncontent should be interchangeable with the that of the publishedVersion.\n- `submittedVersion`: the document as submitted to the publisher by the authors, but\nbefore peer-review. Its content may differ significantly from that of the accepted\narticle.",
         "enum": [
            "publishedVersion",
            "acceptedVersion",
            "submittedVersion",
            "other"
         ],
         "title": "DriverVersion",
         "type": "string"
      },
      "EnhancementType": {
         "description": "The type of enhancement.\n\nThis is used to identify the type of enhancement in the `Enhancement` class.\n\n**Allowed values**:\n- `bibliographic`: Bibliographic metadata.\n- `abstract`: The abstract of a reference.\n- `annotation`: A free-form enhancement for tagging with labels.\n- `locations`: Locations where the reference can be found.\n- `full_text`: The full text of the reference. (To be implemeted)",
         "enum": [
            "bibliographic",
            "abstract",
            "annotation",
            "location",
            "full_text"
         ],
         "title": "EnhancementType",
         "type": "string"
      },
      "Location": {
         "description": "A location where a reference can be found.\n\nThis maps almost completely to the OpenAlex\n[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)",
         "properties": {
            "is_oa": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): True if an Open Access (OA) version of this work is available\nat this location. May be left as null if this is unknown (and thus)\ntreated effectively as `false`.\n",
               "title": "Is Oa"
            },
            "version": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DriverVersion"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nThe version (according to the DRIVER versioning scheme) of this location.\n"
            },
            "landing_page_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "(From OpenAlex): The landing page URL for this location.",
               "title": "Landing Page Url"
            },
            "pdf_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): A URL where you can find this location as a PDF.\n",
               "title": "Pdf Url"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): The location's publishing license. This can be a Creative\nCommons license such as cc0 or cc-by, a publisher-specific license, or null\nwhich means we are not able to determine a license for this location.\n",
               "title": "License"
            },
            "extra": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Any extra metadata about this location",
               "title": "Extra"
            }
         },
         "title": "Location",
         "type": "object"
      },
      "LocationEnhancement": {
         "description": "An enhancement which describes locations where this reference can be found.\n\nThis maps closely (almost exactly) to OpenAlex's locations.",
         "properties": {
            "enhancement_type": {
               "const": "location",
               "default": "location",
               "title": "Enhancement Type",
               "type": "string"
            },
            "locations": {
               "description": "A list of locations where this reference can be found.",
               "items": {
                  "$ref": "#/$defs/Location"
               },
               "title": "Locations",
               "type": "array"
            }
         },
         "required": [
            "locations"
         ],
         "title": "LocationEnhancement",
         "type": "object"
      },
      "ScoreAnnotation": {
         "description": "An annotation which represents the score for a label.\n\nThis is similar to a BooleanAnnotation, but lacks a boolean determination\nas to the application of the label.",
         "properties": {
            "annotation_type": {
               "const": "score",
               "default": "score",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "score": {
               "description": "Score for this annotation",
               "title": "Score",
               "type": "number"
            },
            "data": {
               "additionalProperties": true,
               "description": "An object representation of the annotation including any confidence scores or descriptions.",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "score"
         ],
         "title": "ScoreAnnotation",
         "type": "object"
      },
      "Visibility": {
         "description": "The visibility of a data element in the repository.\n\nThis is used to manage whether information should be publicly available or\nrestricted (generally due to copyright constraints from publishers).\n\nTODO: Implement data governance layer to manage this.\n\n**Allowed values**:\n\n- `public`: Visible to the general public without authentication.\n- `restricted`: Requires authentication to be visible.\n- `hidden`: Is not visible, but may be passed to data mining processes.",
         "enum": [
            "public",
            "restricted",
            "hidden"
         ],
         "title": "Visibility",
         "type": "string"
      }
   },
   "required": [
      "source",
      "visibility",
      "enhancement_type",
      "content"
   ]
}

Fields:
field content: Annotated[BibliographicMetadataEnhancement | AbstractContentEnhancement | AnnotationEnhancement | LocationEnhancement, FieldInfo(annotation=NoneType, required=True, discriminator='enhancement_type')] [Required][source]#

The content of the enhancement.

field enhancement_type: EnhancementType [Required][source]#

The type of enhancement.

field robot_version: str | None = None (alias 'processor_version')[source]#

The version of the robot that generated the content.

field source: str [Required][source]#

The enhancement source for tracking provenance.

field visibility: Visibility [Required][source]#

The level of visibility of the enhancement

class libs.sdk.src.destiny_sdk.enhancements.EnhancementType(*values)[source]#

The type of enhancement.

This is used to identify the type of enhancement in the Enhancement class.

Allowed values: - bibliographic: Bibliographic metadata. - abstract: The abstract of a reference. - annotation: A free-form enhancement for tagging with labels. - locations: Locations where the reference can be found. - full_text: The full text of the reference. (To be implemeted)

ABSTRACT = 'abstract'[source]#
ANNOTATION = 'annotation'[source]#
BIBLIOGRAPHIC = 'bibliographic'[source]#
FULL_TEXT = 'full_text'[source]#
LOCATION = 'location'[source]#
pydantic model libs.sdk.src.destiny_sdk.enhancements.Location[source]#

A location where a reference can be found.

This maps almost completely to the OpenAlex [Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.enhancements.Location"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Location</b></td></tr><tr><td>is_oa</td><td port="is_oa">bool | None</td></tr><tr><td>version</td><td port="version">DriverVersion | None</td></tr><tr><td>landing_page_url</td><td port="landing_page_url">HttpUrl | None</td></tr><tr><td>pdf_url</td><td port="pdf_url">HttpUrl | None</td></tr><tr><td>license</td><td port="license">str | None</td></tr><tr><td>extra</td><td port="extra">dict | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.Location&#xA;&#xA;A location where a reference can be found.&#xA;&#xA;This maps almost completely \
to the OpenAlex&#xA;[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)&#xA;"];
}

Show JSON schema
{
   "title": "Location",
   "description": "A location where a reference can be found.\n\nThis maps almost completely to the OpenAlex\n[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)",
   "type": "object",
   "properties": {
      "is_oa": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\n(From OpenAlex): True if an Open Access (OA) version of this work is available\nat this location. May be left as null if this is unknown (and thus)\ntreated effectively as `false`.\n",
         "title": "Is Oa"
      },
      "version": {
         "anyOf": [
            {
               "$ref": "#/$defs/DriverVersion"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\nThe version (according to the DRIVER versioning scheme) of this location.\n"
      },
      "landing_page_url": {
         "anyOf": [
            {
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "(From OpenAlex): The landing page URL for this location.",
         "title": "Landing Page Url"
      },
      "pdf_url": {
         "anyOf": [
            {
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\n(From OpenAlex): A URL where you can find this location as a PDF.\n",
         "title": "Pdf Url"
      },
      "license": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\n(From OpenAlex): The location's publishing license. This can be a Creative\nCommons license such as cc0 or cc-by, a publisher-specific license, or null\nwhich means we are not able to determine a license for this location.\n",
         "title": "License"
      },
      "extra": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Any extra metadata about this location",
         "title": "Extra"
      }
   },
   "$defs": {
      "DriverVersion": {
         "description": "The version based on the DRIVER guidelines versioning scheme.\n\n(Borrowed from OpenAlex)\n\nAllowed values:\n- `publishedVersion`: The document's version of record. This is the most\nauthoritative version.\n- `acceptedVersion`: The document after having completed peer review and being\nofficially accepted for publication. It will lack publisher formatting, but the\ncontent should be interchangeable with the that of the publishedVersion.\n- `submittedVersion`: the document as submitted to the publisher by the authors, but\nbefore peer-review. Its content may differ significantly from that of the accepted\narticle.",
         "enum": [
            "publishedVersion",
            "acceptedVersion",
            "submittedVersion",
            "other"
         ],
         "title": "DriverVersion",
         "type": "string"
      }
   }
}

Fields:
field extra: dict | None = None[source]#

Any extra metadata about this location

field is_oa: bool | None = None[source]#

(From OpenAlex): True if an Open Access (OA) version of this work is available at this location. May be left as null if this is unknown (and thus) treated effectively as false.

field landing_page_url: HttpUrl | None = None[source]#

(From OpenAlex): The landing page URL for this location.

field license: str | None = None[source]#

(From OpenAlex): The location’s publishing license. This can be a Creative Commons license such as cc0 or cc-by, a publisher-specific license, or null which means we are not able to determine a license for this location.

field pdf_url: HttpUrl | None = None[source]#

(From OpenAlex): A URL where you can find this location as a PDF.

field version: DriverVersion | None = None[source]#

The version (according to the DRIVER versioning scheme) of this location.

pydantic model libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement[source]#

An enhancement which describes locations where this reference can be found.

This maps closely (almost exactly) to OpenAlex’s locations.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.enhancements.Location"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Location</b></td></tr><tr><td>is_oa</td><td port="is_oa">bool | None</td></tr><tr><td>version</td><td port="version">DriverVersion | None</td></tr><tr><td>landing_page_url</td><td port="landing_page_url">HttpUrl | None</td></tr><tr><td>pdf_url</td><td port="pdf_url">HttpUrl | None</td></tr><tr><td>license</td><td port="license">str | None</td></tr><tr><td>extra</td><td port="extra">dict | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.Location&#xA;&#xA;A location where a reference can be found.&#xA;&#xA;This maps almost completely \
to the OpenAlex&#xA;[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LocationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.LOCATION]</td></tr><tr><td>locations</td><td port="locations">list[Location]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement&#xA;&#xA;An enhancement which describes locations where this reference \
can be found.&#xA;&#xA;This maps closely (almost exactly) to OpenAlex's locations.&#xA;"];
   "libs.sdk.src.destiny_sdk.enhancements.LocationEnhancement":locations:e -> "libs.sdk.src.destiny_sdk.enhancements.Location":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "LocationEnhancement",
   "description": "An enhancement which describes locations where this reference can be found.\n\nThis maps closely (almost exactly) to OpenAlex's locations.",
   "type": "object",
   "properties": {
      "enhancement_type": {
         "const": "location",
         "default": "location",
         "title": "Enhancement Type",
         "type": "string"
      },
      "locations": {
         "description": "A list of locations where this reference can be found.",
         "items": {
            "$ref": "#/$defs/Location"
         },
         "title": "Locations",
         "type": "array"
      }
   },
   "$defs": {
      "DriverVersion": {
         "description": "The version based on the DRIVER guidelines versioning scheme.\n\n(Borrowed from OpenAlex)\n\nAllowed values:\n- `publishedVersion`: The document's version of record. This is the most\nauthoritative version.\n- `acceptedVersion`: The document after having completed peer review and being\nofficially accepted for publication. It will lack publisher formatting, but the\ncontent should be interchangeable with the that of the publishedVersion.\n- `submittedVersion`: the document as submitted to the publisher by the authors, but\nbefore peer-review. Its content may differ significantly from that of the accepted\narticle.",
         "enum": [
            "publishedVersion",
            "acceptedVersion",
            "submittedVersion",
            "other"
         ],
         "title": "DriverVersion",
         "type": "string"
      },
      "Location": {
         "description": "A location where a reference can be found.\n\nThis maps almost completely to the OpenAlex\n[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)",
         "properties": {
            "is_oa": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): True if an Open Access (OA) version of this work is available\nat this location. May be left as null if this is unknown (and thus)\ntreated effectively as `false`.\n",
               "title": "Is Oa"
            },
            "version": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DriverVersion"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nThe version (according to the DRIVER versioning scheme) of this location.\n"
            },
            "landing_page_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "(From OpenAlex): The landing page URL for this location.",
               "title": "Landing Page Url"
            },
            "pdf_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): A URL where you can find this location as a PDF.\n",
               "title": "Pdf Url"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): The location's publishing license. This can be a Creative\nCommons license such as cc0 or cc-by, a publisher-specific license, or null\nwhich means we are not able to determine a license for this location.\n",
               "title": "License"
            },
            "extra": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Any extra metadata about this location",
               "title": "Extra"
            }
         },
         "title": "Location",
         "type": "object"
      }
   },
   "required": [
      "locations"
   ]
}

Fields:
field enhancement_type: Literal[EnhancementType.LOCATION] = EnhancementType.LOCATION[source]#
field locations: list[Location] [Required][source]#

A list of locations where this reference can be found.

pydantic model libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation[source]#

An annotation which represents the score for a label.

This is similar to a BooleanAnnotation, but lacks a boolean determination as to the application of the label.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ScoreAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.SCORE]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>score</td><td port="score">float</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.enhancements.ScoreAnnotation&#xA;&#xA;An annotation which represents the score for a label.&#xA;&#xA;This \
is similar to a BooleanAnnotation, but lacks a boolean determination&#xA;as to the application of the label.&#xA;"];
}

Show JSON schema
{
   "title": "ScoreAnnotation",
   "description": "An annotation which represents the score for a label.\n\nThis is similar to a BooleanAnnotation, but lacks a boolean determination\nas to the application of the label.",
   "type": "object",
   "properties": {
      "annotation_type": {
         "const": "score",
         "default": "score",
         "title": "Annotation Type",
         "type": "string"
      },
      "scheme": {
         "description": "An identifier for the scheme of annotation",
         "examples": [
            "openalex:topic",
            "pubmed:mesh"
         ],
         "title": "Scheme",
         "type": "string"
      },
      "label": {
         "description": "A high level label for this annotation like the name of the topic",
         "title": "Label",
         "type": "string"
      },
      "score": {
         "description": "Score for this annotation",
         "title": "Score",
         "type": "number"
      },
      "data": {
         "additionalProperties": true,
         "description": "An object representation of the annotation including any confidence scores or descriptions.",
         "title": "Data",
         "type": "object"
      }
   },
   "required": [
      "scheme",
      "label",
      "score"
   ]
}

Fields:
field annotation_type: Literal[AnnotationType.SCORE] = AnnotationType.SCORE[source]#
field data: dict [Optional][source]#

An object representation of the annotation including any confidence scores or descriptions.

field label: str [Required][source]#

A high level label for this annotation like the name of the topic

field scheme: str [Required][source]#

An identifier for the scheme of annotation

field score: float [Required][source]#

Score for this annotation

Identifiers#

Identifier classes for the Destiny SDK.

pydantic model libs.sdk.src.destiny_sdk.identifiers.DOIIdentifier[source]#

An external identifier representing a DOI.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.identifiers.DOIIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DOIIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.DOI]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.identifiers.DOIIdentifier&#xA;&#xA;An external identifier representing a DOI.&#xA;"];
}

Show JSON schema
{
   "title": "DOIIdentifier",
   "description": "An external identifier representing a DOI.",
   "type": "object",
   "properties": {
      "identifier": {
         "description": "The DOI of the reference.",
         "pattern": "^10\\.\\d{4,9}/[-._;()/:a-zA-Z0-9%<>\\[\\]+&]+$",
         "title": "Identifier",
         "type": "string"
      },
      "identifier_type": {
         "const": "doi",
         "default": "doi",
         "description": "The type of identifier used.",
         "title": "Identifier Type",
         "type": "string"
      }
   },
   "required": [
      "identifier"
   ]
}

Fields:
Validators:
field identifier: str [Required][source]#

The DOI of the reference.

Constraints:
  • pattern = ^10.d{4,9}/[-._;()/:a-zA-Z0-9%<>[]+&]+$

Validated by:
field identifier_type: Literal[ExternalIdentifierType.DOI] = ExternalIdentifierType.DOI[source]#

The type of identifier used.

validator remove_doi_url  »  identifier[source]#

Remove the URL part of the DOI if it exists.

libs.sdk.src.destiny_sdk.identifiers.ExternalIdentifier[source]#

Union type for all external identifiers.

alias of Annotated[DOIIdentifier | PubMedIdentifier | OpenAlexIdentifier | OtherIdentifier, FieldInfo(annotation=NoneType, required=True, discriminator=’identifier_type’)]

class libs.sdk.src.destiny_sdk.identifiers.ExternalIdentifierType(*values)[source]#

The type of identifier used to identify a reference.

This is used to identify the type of identifier used in the ExternalIdentifier class. Allowed values: - doi: A DOI (Digital Object Identifier) which is a unique identifier for a document. - pmid: A PubMed ID which is a unique identifier for a document in PubMed. - openalex: An OpenAlex ID which is a unique identifier for a document in OpenAlex. - other: Any other identifier not defined. This should be used sparingly.

DOI = 'doi'[source]#
OPEN_ALEX = 'open_alex'[source]#
OTHER = 'other'[source]#
PM_ID = 'pm_id'[source]#
pydantic model libs.sdk.src.destiny_sdk.identifiers.LinkedExternalIdentifier[source]#

An external identifier which identifies a reference.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.identifiers.DOIIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DOIIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.DOI]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.identifiers.DOIIdentifier&#xA;&#xA;An external identifier representing a DOI.&#xA;"];
   "libs.sdk.src.destiny_sdk.identifiers.LinkedExternalIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LinkedExternalIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">DOIIdentifier | PubMedIdentifier | OpenAlexIdentifier | OtherIdentifier</td></tr><tr><td>reference_id</td><td port="reference_id">UUID</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.identifiers.LinkedExternalIdentifier&#xA;&#xA;An external identifier which identifies a reference.&#xA;"];
   "libs.sdk.src.destiny_sdk.identifiers.LinkedExternalIdentifier":identifier:e -> "libs.sdk.src.destiny_sdk.identifiers.DOIIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.identifiers.OpenAlexIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>OpenAlexIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.OPEN_ALEX]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.identifiers.OpenAlexIdentifier&#xA;&#xA;An external identifier representing an OpenAlex ID.&#xA;"];
   "libs.sdk.src.destiny_sdk.identifiers.LinkedExternalIdentifier":identifier:e -> "libs.sdk.src.destiny_sdk.identifiers.OpenAlexIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.identifiers.OtherIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>OtherIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.OTHER]</td></tr><tr><td>other_identifier_name</td><td port="other_identifier_name">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.identifiers.OtherIdentifier&#xA;&#xA;An external identifier not otherwise defined by the repository.&#xA;"];
   "libs.sdk.src.destiny_sdk.identifiers.LinkedExternalIdentifier":identifier:e -> "libs.sdk.src.destiny_sdk.identifiers.OtherIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.identifiers.PubMedIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>PubMedIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">int</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.PM_ID]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.identifiers.PubMedIdentifier&#xA;&#xA;An external identifier representing a PubMed ID.&#xA;"];
   "libs.sdk.src.destiny_sdk.identifiers.LinkedExternalIdentifier":identifier:e -> "libs.sdk.src.destiny_sdk.identifiers.PubMedIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "LinkedExternalIdentifier",
   "description": "An external identifier which identifies a reference.",
   "type": "object",
   "properties": {
      "identifier": {
         "description": "The identifier of the reference.",
         "discriminator": {
            "mapping": {
               "doi": "#/$defs/DOIIdentifier",
               "open_alex": "#/$defs/OpenAlexIdentifier",
               "other": "#/$defs/OtherIdentifier",
               "pm_id": "#/$defs/PubMedIdentifier"
            },
            "propertyName": "identifier_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/DOIIdentifier"
            },
            {
               "$ref": "#/$defs/PubMedIdentifier"
            },
            {
               "$ref": "#/$defs/OpenAlexIdentifier"
            },
            {
               "$ref": "#/$defs/OtherIdentifier"
            }
         ],
         "title": "Identifier"
      },
      "reference_id": {
         "description": "The ID of the reference this identifier identifies.",
         "format": "uuid4",
         "title": "Reference Id",
         "type": "string"
      }
   },
   "$defs": {
      "DOIIdentifier": {
         "description": "An external identifier representing a DOI.",
         "properties": {
            "identifier": {
               "description": "The DOI of the reference.",
               "pattern": "^10\\.\\d{4,9}/[-._;()/:a-zA-Z0-9%<>\\[\\]+&]+$",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "doi",
               "default": "doi",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "DOIIdentifier",
         "type": "object"
      },
      "OpenAlexIdentifier": {
         "description": "An external identifier representing an OpenAlex ID.",
         "properties": {
            "identifier": {
               "description": "The OpenAlex ID of the reference.",
               "pattern": "^W\\d+$",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "open_alex",
               "default": "open_alex",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "OpenAlexIdentifier",
         "type": "object"
      },
      "OtherIdentifier": {
         "description": "An external identifier not otherwise defined by the repository.",
         "properties": {
            "identifier": {
               "description": "The identifier of the reference.",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "other",
               "default": "other",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            },
            "other_identifier_name": {
               "description": "The name of the undocumented identifier type.",
               "title": "Other Identifier Name",
               "type": "string"
            }
         },
         "required": [
            "identifier",
            "other_identifier_name"
         ],
         "title": "OtherIdentifier",
         "type": "object"
      },
      "PubMedIdentifier": {
         "description": "An external identifier representing a PubMed ID.",
         "properties": {
            "identifier": {
               "description": "The PubMed ID of the reference.",
               "title": "Identifier",
               "type": "integer"
            },
            "identifier_type": {
               "const": "pm_id",
               "default": "pm_id",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "PubMedIdentifier",
         "type": "object"
      }
   },
   "required": [
      "identifier",
      "reference_id"
   ]
}

Fields:
field identifier: Annotated[DOIIdentifier | PubMedIdentifier | OpenAlexIdentifier | OtherIdentifier, FieldInfo(annotation=NoneType, required=True, discriminator='identifier_type')] [Required][source]#

The identifier of the reference.

field reference_id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The ID of the reference this identifier identifies.

Constraints:
  • uuid_version = 4

pydantic model libs.sdk.src.destiny_sdk.identifiers.OpenAlexIdentifier[source]#

An external identifier representing an OpenAlex ID.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.identifiers.OpenAlexIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>OpenAlexIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.OPEN_ALEX]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.identifiers.OpenAlexIdentifier&#xA;&#xA;An external identifier representing an OpenAlex ID.&#xA;"];
}

Show JSON schema
{
   "title": "OpenAlexIdentifier",
   "description": "An external identifier representing an OpenAlex ID.",
   "type": "object",
   "properties": {
      "identifier": {
         "description": "The OpenAlex ID of the reference.",
         "pattern": "^W\\d+$",
         "title": "Identifier",
         "type": "string"
      },
      "identifier_type": {
         "const": "open_alex",
         "default": "open_alex",
         "description": "The type of identifier used.",
         "title": "Identifier Type",
         "type": "string"
      }
   },
   "required": [
      "identifier"
   ]
}

Fields:
field identifier: str [Required][source]#

The OpenAlex ID of the reference.

Constraints:
  • pattern = ^Wd+$

field identifier_type: Literal[ExternalIdentifierType.OPEN_ALEX] = ExternalIdentifierType.OPEN_ALEX[source]#

The type of identifier used.

pydantic model libs.sdk.src.destiny_sdk.identifiers.OtherIdentifier[source]#

An external identifier not otherwise defined by the repository.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.identifiers.OtherIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>OtherIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.OTHER]</td></tr><tr><td>other_identifier_name</td><td port="other_identifier_name">str</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.identifiers.OtherIdentifier&#xA;&#xA;An external identifier not otherwise defined by the repository.&#xA;"];
}

Show JSON schema
{
   "title": "OtherIdentifier",
   "description": "An external identifier not otherwise defined by the repository.",
   "type": "object",
   "properties": {
      "identifier": {
         "description": "The identifier of the reference.",
         "title": "Identifier",
         "type": "string"
      },
      "identifier_type": {
         "const": "other",
         "default": "other",
         "description": "The type of identifier used.",
         "title": "Identifier Type",
         "type": "string"
      },
      "other_identifier_name": {
         "description": "The name of the undocumented identifier type.",
         "title": "Other Identifier Name",
         "type": "string"
      }
   },
   "required": [
      "identifier",
      "other_identifier_name"
   ]
}

Fields:
field identifier: str [Required][source]#

The identifier of the reference.

field identifier_type: Literal[ExternalIdentifierType.OTHER] = ExternalIdentifierType.OTHER[source]#

The type of identifier used.

field other_identifier_name: str [Required][source]#

The name of the undocumented identifier type.

pydantic model libs.sdk.src.destiny_sdk.identifiers.PubMedIdentifier[source]#

An external identifier representing a PubMed ID.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "libs.sdk.src.destiny_sdk.identifiers.PubMedIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>PubMedIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">int</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.PM_ID]</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.identifiers.PubMedIdentifier&#xA;&#xA;An external identifier representing a PubMed ID.&#xA;"];
}

Show JSON schema
{
   "title": "PubMedIdentifier",
   "description": "An external identifier representing a PubMed ID.",
   "type": "object",
   "properties": {
      "identifier": {
         "description": "The PubMed ID of the reference.",
         "title": "Identifier",
         "type": "integer"
      },
      "identifier_type": {
         "const": "pm_id",
         "default": "pm_id",
         "description": "The type of identifier used.",
         "title": "Identifier Type",
         "type": "string"
      }
   },
   "required": [
      "identifier"
   ]
}

Fields:
field identifier: int [Required][source]#

The PubMed ID of the reference.

field identifier_type: Literal[ExternalIdentifierType.PM_ID] = ExternalIdentifierType.PM_ID[source]#

The type of identifier used.

libs.sdk.src.destiny_sdk.identifiers.remove_doi_url(value: str) str[source]#

Remove the URL part of the DOI if it exists.

References#

Reference classes for the Destiny SDK.

pydantic model libs.sdk.src.destiny_sdk.references.Reference[source]#

Core reference class.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "destiny_sdk.enhancements.AbstractContentEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AbstractContentEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ABSTRACT]</td></tr><tr><td>process</td><td port="process">AbstractProcessType</td></tr><tr><td>abstract</td><td port="abstract">str</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.AbstractContentEnhancement&#xA;&#xA;An enhancement which is specific to the abstract of a reference.&#xA;&#\
xA;This is separate from the `BibliographicMetadata` for two reasons:&#xA;&#xA;1. Abstracts are increasingly missing from sources \
like OpenAlex, and may be&#xA;backfilled from other sources, without the bibliographic metadata.&#xA;2. They are also subject to \
copyright limitations in ways which metadata are&#xA;not, and thus need separate visibility controls.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AnnotationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ANNOTATION]</td></tr><tr><td>annotations</td><td port="annotations">list[BooleanAnnotation | ScoreAnnotation]</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.AnnotationEnhancement&#xA;&#xA;An enhancement which is composed of a list of Annotations.&#xA;"];
   "destiny_sdk.enhancements.BooleanAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BooleanAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.BOOLEAN]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>value</td><td port="value">bool</td></tr><tr><td>score</td><td port="score">float | None</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.BooleanAnnotation&#xA;&#xA;An annotation is a way of tagging the content with a label of some kind.&#xA;&#\
xA;This class will probably be broken up in the future, but covers most of our&#xA;initial cases.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "destiny_sdk.enhancements.BooleanAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.ScoreAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ScoreAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.SCORE]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>score</td><td port="score">float</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.ScoreAnnotation&#xA;&#xA;An annotation which represents the score for a label.&#xA;&#xA;This is similar \
to a BooleanAnnotation, but lacks a boolean determination&#xA;as to the application of the label.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "destiny_sdk.enhancements.ScoreAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Authorship"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Authorship</b></td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>orcid</td><td port="orcid">str</td></tr><tr><td>position</td><td port="position">AuthorPosition</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Authorship&#xA;&#xA;Represents a single author and their association with a reference.&#xA;&#xA;This is \
a simplification of the OpenAlex [Authorship&#xA;object](https://docs.openalex.org/api-entities/works/work-object/authorship-object)&#\
xA;for our purposes.&#xA;"];
   "destiny_sdk.enhancements.BibliographicMetadataEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BibliographicMetadataEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.BIBLIOGRAPHIC]</td></tr><tr><td>authorship</td><td port="authorship">list[Authorship] | None</td></tr><tr><td>cited_by_count</td><td port="cited_by_count">int | None</td></tr><tr><td>created_date</td><td port="created_date">date | None</td></tr><tr><td>publication_date</td><td port="publication_date">date | None</td></tr><tr><td>publication_year</td><td port="publication_year">int | None</td></tr><tr><td>publisher</td><td port="publisher">str | None</td></tr><tr><td>title</td><td port="title">str | None</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.BibliographicMetadataEnhancement&#xA;&#xA;An enhancement which is made up of bibliographic metadata.&#xA;&#\
xA;Generally this will be sourced from a database such as OpenAlex or similar.&#xA;For directly contributed references, these may \
not be complete.&#xA;"];
   "destiny_sdk.enhancements.BibliographicMetadataEnhancement":authorship:e -> "destiny_sdk.enhancements.Authorship":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Enhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Enhancement</b></td></tr><tr><td>reference_id</td><td port="reference_id">UUID</td></tr><tr><td>source</td><td port="source">str</td></tr><tr><td>visibility</td><td port="visibility">Visibility</td></tr><tr><td>robot_version</td><td port="robot_version">str | None</td></tr><tr><td>derived_from</td><td port="derived_from">list[UUID] | None</td></tr><tr><td>content</td><td port="content">BibliographicMetadataEnhancement | AbstractContentEnhancement | AnnotationEnhancement | LocationEnhancement</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Enhancement&#xA;&#xA;Core enhancement class.&#xA;"];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.AbstractContentEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.AnnotationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.BibliographicMetadataEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.LocationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LocationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.LOCATION]</td></tr><tr><td>locations</td><td port="locations">list[Location]</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.LocationEnhancement&#xA;&#xA;An enhancement which describes locations where this reference can be found.&#\
xA;&#xA;This maps closely (almost exactly) to OpenAlex's locations.&#xA;"];
   "destiny_sdk.enhancements.Enhancement":content:e -> "destiny_sdk.enhancements.LocationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Location"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Location</b></td></tr><tr><td>is_oa</td><td port="is_oa">bool | None</td></tr><tr><td>version</td><td port="version">DriverVersion | None</td></tr><tr><td>landing_page_url</td><td port="landing_page_url">HttpUrl | None</td></tr><tr><td>pdf_url</td><td port="pdf_url">HttpUrl | None</td></tr><tr><td>license</td><td port="license">str | None</td></tr><tr><td>extra</td><td port="extra">dict | None</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Location&#xA;&#xA;A location where a reference can be found.&#xA;&#xA;This maps almost completely to the \
OpenAlex&#xA;[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)&#xA;"];
   "destiny_sdk.enhancements.LocationEnhancement":locations:e -> "destiny_sdk.enhancements.Location":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.identifiers.DOIIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DOIIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.DOI]</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.DOIIdentifier&#xA;&#xA;An external identifier representing a DOI.&#xA;"];
   "destiny_sdk.identifiers.OpenAlexIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>OpenAlexIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.OPEN_ALEX]</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.OpenAlexIdentifier&#xA;&#xA;An external identifier representing an OpenAlex ID.&#xA;"];
   "destiny_sdk.identifiers.OtherIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>OtherIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.OTHER]</td></tr><tr><td>other_identifier_name</td><td port="other_identifier_name">str</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.OtherIdentifier&#xA;&#xA;An external identifier not otherwise defined by the repository.&#xA;"];
   "destiny_sdk.identifiers.PubMedIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>PubMedIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">int</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.PM_ID]</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.PubMedIdentifier&#xA;&#xA;An external identifier representing a PubMed ID.&#xA;"];
   "libs.sdk.src.destiny_sdk.references.Reference"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Reference</b></td></tr><tr><td>visibility</td><td port="visibility">Visibility</td></tr><tr><td>id</td><td port="id">UUID</td></tr><tr><td>identifiers</td><td port="identifiers">list[DOIIdentifier | PubMedIdentifier | OpenAlexIdentifier | OtherIdentifier] | None</td></tr><tr><td>enhancements</td><td port="enhancements">list[Enhancement] | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.references.Reference&#xA;&#xA;Core reference class.&#xA;"];
   "libs.sdk.src.destiny_sdk.references.Reference":enhancements:e -> "destiny_sdk.enhancements.Enhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.references.Reference":identifiers:e -> "destiny_sdk.identifiers.DOIIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.references.Reference":identifiers:e -> "destiny_sdk.identifiers.OpenAlexIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.references.Reference":identifiers:e -> "destiny_sdk.identifiers.OtherIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.references.Reference":identifiers:e -> "destiny_sdk.identifiers.PubMedIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "Reference",
   "description": "Core reference class.",
   "type": "object",
   "properties": {
      "visibility": {
         "$ref": "#/$defs/Visibility",
         "default": "public",
         "description": "The level of visibility of the reference"
      },
      "id": {
         "description": "The ID of the reference",
         "format": "uuid4",
         "title": "Id",
         "type": "string"
      },
      "identifiers": {
         "anyOf": [
            {
               "items": {
                  "discriminator": {
                     "mapping": {
                        "doi": "#/$defs/DOIIdentifier",
                        "open_alex": "#/$defs/OpenAlexIdentifier",
                        "other": "#/$defs/OtherIdentifier",
                        "pm_id": "#/$defs/PubMedIdentifier"
                     },
                     "propertyName": "identifier_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/DOIIdentifier"
                     },
                     {
                        "$ref": "#/$defs/PubMedIdentifier"
                     },
                     {
                        "$ref": "#/$defs/OpenAlexIdentifier"
                     },
                     {
                        "$ref": "#/$defs/OtherIdentifier"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of `ExternalIdentifiers` for the Reference",
         "title": "Identifiers"
      },
      "enhancements": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Enhancement"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of enhancements for the reference",
         "title": "Enhancements"
      }
   },
   "$defs": {
      "AbstractContentEnhancement": {
         "description": "An enhancement which is specific to the abstract of a reference.\n\nThis is separate from the `BibliographicMetadata` for two reasons:\n\n1. Abstracts are increasingly missing from sources like OpenAlex, and may be\nbackfilled from other sources, without the bibliographic metadata.\n2. They are also subject to copyright limitations in ways which metadata are\nnot, and thus need separate visibility controls.",
         "properties": {
            "enhancement_type": {
               "const": "abstract",
               "default": "abstract",
               "title": "Enhancement Type",
               "type": "string"
            },
            "process": {
               "$ref": "#/$defs/AbstractProcessType",
               "description": "The process used to acquire the abstract."
            },
            "abstract": {
               "description": "The abstract of the reference.",
               "title": "Abstract",
               "type": "string"
            }
         },
         "required": [
            "process",
            "abstract"
         ],
         "title": "AbstractContentEnhancement",
         "type": "object"
      },
      "AbstractProcessType": {
         "description": "The process used to acquyire the abstract.\n\n**Allowed values**:\n- `uninverted`\n- `closed_api`\n- `other`",
         "enum": [
            "uninverted",
            "closed_api",
            "other"
         ],
         "title": "AbstractProcessType",
         "type": "string"
      },
      "AnnotationEnhancement": {
         "description": "An enhancement which is composed of a list of Annotations.",
         "properties": {
            "enhancement_type": {
               "const": "annotation",
               "default": "annotation",
               "title": "Enhancement Type",
               "type": "string"
            },
            "annotations": {
               "items": {
                  "discriminator": {
                     "mapping": {
                        "boolean": "#/$defs/BooleanAnnotation",
                        "score": "#/$defs/ScoreAnnotation"
                     },
                     "propertyName": "annotation_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/BooleanAnnotation"
                     },
                     {
                        "$ref": "#/$defs/ScoreAnnotation"
                     }
                  ]
               },
               "title": "Annotations",
               "type": "array"
            }
         },
         "required": [
            "annotations"
         ],
         "title": "AnnotationEnhancement",
         "type": "object"
      },
      "AuthorPosition": {
         "description": "The position of an author in a list of authorships.\n\nMaps to the data from OpenAlex.\n\n**Allowed values**:\n- `first`: The first author.\n- `middle`: Any middle author\n- `last`: The last author",
         "enum": [
            "first",
            "middle",
            "last"
         ],
         "title": "AuthorPosition",
         "type": "string"
      },
      "Authorship": {
         "description": "Represents a single author and their association with a reference.\n\nThis is a simplification of the OpenAlex [Authorship\nobject](https://docs.openalex.org/api-entities/works/work-object/authorship-object)\nfor our purposes.",
         "properties": {
            "display_name": {
               "description": "The display name of the author.",
               "title": "Display Name",
               "type": "string"
            },
            "orcid": {
               "description": "The ORCid of the author.",
               "title": "Orcid",
               "type": "string"
            },
            "position": {
               "$ref": "#/$defs/AuthorPosition",
               "description": "The position of the author within the list of authors."
            }
         },
         "required": [
            "display_name",
            "orcid",
            "position"
         ],
         "title": "Authorship",
         "type": "object"
      },
      "BibliographicMetadataEnhancement": {
         "description": "An enhancement which is made up of bibliographic metadata.\n\nGenerally this will be sourced from a database such as OpenAlex or similar.\nFor directly contributed references, these may not be complete.",
         "properties": {
            "enhancement_type": {
               "const": "bibliographic",
               "default": "bibliographic",
               "title": "Enhancement Type",
               "type": "string"
            },
            "authorship": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Authorship"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `Authorships` belonging to this reference.",
               "title": "Authorship"
            },
            "cited_by_count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex) The number of citations to this work. These are the times that\nother works have cited this work\n",
               "title": "Cited By Count"
            },
            "created_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ISO8601 date this metadata record was created",
               "title": "Created Date"
            },
            "publication_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The date which the version of record was published.",
               "title": "Publication Date"
            },
            "publication_year": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The year in which the version of record was published.",
               "title": "Publication Year"
            },
            "publisher": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the entity which published the version of record.",
               "title": "Publisher"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The title of the reference.",
               "title": "Title"
            }
         },
         "title": "BibliographicMetadataEnhancement",
         "type": "object"
      },
      "BooleanAnnotation": {
         "description": "An annotation is a way of tagging the content with a label of some kind.\n\nThis class will probably be broken up in the future, but covers most of our\ninitial cases.",
         "properties": {
            "annotation_type": {
               "const": "boolean",
               "default": "boolean",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of the annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "value": {
               "description": "Boolean flag for this annotation",
               "title": "Value",
               "type": "boolean"
            },
            "score": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A confidence score for this annotation",
               "title": "Score"
            },
            "data": {
               "additionalProperties": true,
               "description": "\nAn object representation of the annotation including any confidence scores or\ndescriptions.\n",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "value"
         ],
         "title": "BooleanAnnotation",
         "type": "object"
      },
      "DOIIdentifier": {
         "description": "An external identifier representing a DOI.",
         "properties": {
            "identifier": {
               "description": "The DOI of the reference.",
               "pattern": "^10\\.\\d{4,9}/[-._;()/:a-zA-Z0-9%<>\\[\\]+&]+$",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "doi",
               "default": "doi",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "DOIIdentifier",
         "type": "object"
      },
      "DriverVersion": {
         "description": "The version based on the DRIVER guidelines versioning scheme.\n\n(Borrowed from OpenAlex)\n\nAllowed values:\n- `publishedVersion`: The document's version of record. This is the most\nauthoritative version.\n- `acceptedVersion`: The document after having completed peer review and being\nofficially accepted for publication. It will lack publisher formatting, but the\ncontent should be interchangeable with the that of the publishedVersion.\n- `submittedVersion`: the document as submitted to the publisher by the authors, but\nbefore peer-review. Its content may differ significantly from that of the accepted\narticle.",
         "enum": [
            "publishedVersion",
            "acceptedVersion",
            "submittedVersion",
            "other"
         ],
         "title": "DriverVersion",
         "type": "string"
      },
      "Enhancement": {
         "description": "Core enhancement class.",
         "properties": {
            "reference_id": {
               "description": "The ID of the reference this enhancement is associated with.",
               "format": "uuid",
               "title": "Reference Id",
               "type": "string"
            },
            "source": {
               "description": "The enhancement source for tracking provenance.",
               "title": "Source",
               "type": "string"
            },
            "visibility": {
               "$ref": "#/$defs/Visibility",
               "description": "The level of visibility of the enhancement"
            },
            "robot_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The version of the robot that generated the content.",
               "title": "Robot Version"
            },
            "derived_from": {
               "anyOf": [
                  {
                     "items": {
                        "format": "uuid",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of enhancement IDs that this enhancement was derived from.",
               "title": "Derived From"
            },
            "content": {
               "description": "The content of the enhancement.",
               "discriminator": {
                  "mapping": {
                     "abstract": "#/$defs/AbstractContentEnhancement",
                     "annotation": "#/$defs/AnnotationEnhancement",
                     "bibliographic": "#/$defs/BibliographicMetadataEnhancement",
                     "location": "#/$defs/LocationEnhancement"
                  },
                  "propertyName": "enhancement_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/BibliographicMetadataEnhancement"
                  },
                  {
                     "$ref": "#/$defs/AbstractContentEnhancement"
                  },
                  {
                     "$ref": "#/$defs/AnnotationEnhancement"
                  },
                  {
                     "$ref": "#/$defs/LocationEnhancement"
                  }
               ],
               "title": "Content"
            }
         },
         "required": [
            "reference_id",
            "source",
            "visibility",
            "content"
         ],
         "title": "Enhancement",
         "type": "object"
      },
      "Location": {
         "description": "A location where a reference can be found.\n\nThis maps almost completely to the OpenAlex\n[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)",
         "properties": {
            "is_oa": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): True if an Open Access (OA) version of this work is available\nat this location. May be left as null if this is unknown (and thus)\ntreated effectively as `false`.\n",
               "title": "Is Oa"
            },
            "version": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DriverVersion"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nThe version (according to the DRIVER versioning scheme) of this location.\n"
            },
            "landing_page_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "(From OpenAlex): The landing page URL for this location.",
               "title": "Landing Page Url"
            },
            "pdf_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): A URL where you can find this location as a PDF.\n",
               "title": "Pdf Url"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): The location's publishing license. This can be a Creative\nCommons license such as cc0 or cc-by, a publisher-specific license, or null\nwhich means we are not able to determine a license for this location.\n",
               "title": "License"
            },
            "extra": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Any extra metadata about this location",
               "title": "Extra"
            }
         },
         "title": "Location",
         "type": "object"
      },
      "LocationEnhancement": {
         "description": "An enhancement which describes locations where this reference can be found.\n\nThis maps closely (almost exactly) to OpenAlex's locations.",
         "properties": {
            "enhancement_type": {
               "const": "location",
               "default": "location",
               "title": "Enhancement Type",
               "type": "string"
            },
            "locations": {
               "description": "A list of locations where this reference can be found.",
               "items": {
                  "$ref": "#/$defs/Location"
               },
               "title": "Locations",
               "type": "array"
            }
         },
         "required": [
            "locations"
         ],
         "title": "LocationEnhancement",
         "type": "object"
      },
      "OpenAlexIdentifier": {
         "description": "An external identifier representing an OpenAlex ID.",
         "properties": {
            "identifier": {
               "description": "The OpenAlex ID of the reference.",
               "pattern": "^W\\d+$",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "open_alex",
               "default": "open_alex",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "OpenAlexIdentifier",
         "type": "object"
      },
      "OtherIdentifier": {
         "description": "An external identifier not otherwise defined by the repository.",
         "properties": {
            "identifier": {
               "description": "The identifier of the reference.",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "other",
               "default": "other",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            },
            "other_identifier_name": {
               "description": "The name of the undocumented identifier type.",
               "title": "Other Identifier Name",
               "type": "string"
            }
         },
         "required": [
            "identifier",
            "other_identifier_name"
         ],
         "title": "OtherIdentifier",
         "type": "object"
      },
      "PubMedIdentifier": {
         "description": "An external identifier representing a PubMed ID.",
         "properties": {
            "identifier": {
               "description": "The PubMed ID of the reference.",
               "title": "Identifier",
               "type": "integer"
            },
            "identifier_type": {
               "const": "pm_id",
               "default": "pm_id",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "PubMedIdentifier",
         "type": "object"
      },
      "ScoreAnnotation": {
         "description": "An annotation which represents the score for a label.\n\nThis is similar to a BooleanAnnotation, but lacks a boolean determination\nas to the application of the label.",
         "properties": {
            "annotation_type": {
               "const": "score",
               "default": "score",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "score": {
               "description": "Score for this annotation",
               "title": "Score",
               "type": "number"
            },
            "data": {
               "additionalProperties": true,
               "description": "An object representation of the annotation including any confidence scores or descriptions.",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "score"
         ],
         "title": "ScoreAnnotation",
         "type": "object"
      },
      "Visibility": {
         "description": "The visibility of a data element in the repository.\n\nThis is used to manage whether information should be publicly available or\nrestricted (generally due to copyright constraints from publishers).\n\nTODO: Implement data governance layer to manage this.\n\n**Allowed values**:\n\n- `public`: Visible to the general public without authentication.\n- `restricted`: Requires authentication to be visible.\n- `hidden`: Is not visible, but may be passed to data mining processes.",
         "enum": [
            "public",
            "restricted",
            "hidden"
         ],
         "title": "Visibility",
         "type": "string"
      }
   },
   "required": [
      "id"
   ]
}

Fields:
field enhancements: list[Enhancement] | None = None[source]#

A list of enhancements for the reference

field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#

The ID of the reference

Constraints:
  • uuid_version = 4

field identifiers: list[Annotated[DOIIdentifier | PubMedIdentifier | OpenAlexIdentifier | OtherIdentifier, FieldInfo(annotation=NoneType, required=True, discriminator='identifier_type')]] | None = None[source]#

A list of ExternalIdentifiers for the Reference

field visibility: Visibility = Visibility.PUBLIC[source]#

The level of visibility of the reference

classmethod from_jsonl(jsonl: str) Self[source]#

Create an object from a JSONL string.

Parameters:

jsonl (str) – The JSONL string to parse.

Returns:

The created object.

Return type:

Self

to_jsonl() str[source]#

Convert the model to a JSONL string.

Returns:

The JSONL string representation of the model.

Return type:

str

pydantic model libs.sdk.src.destiny_sdk.references.ReferenceFileInput[source]#

Enhancement model used to marshall a file input.

Show Entity Relationship Diagram
digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "destiny_sdk.enhancements.AbstractContentEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AbstractContentEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ABSTRACT]</td></tr><tr><td>process</td><td port="process">AbstractProcessType</td></tr><tr><td>abstract</td><td port="abstract">str</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.AbstractContentEnhancement&#xA;&#xA;An enhancement which is specific to the abstract of a reference.&#xA;&#\
xA;This is separate from the `BibliographicMetadata` for two reasons:&#xA;&#xA;1. Abstracts are increasingly missing from sources \
like OpenAlex, and may be&#xA;backfilled from other sources, without the bibliographic metadata.&#xA;2. They are also subject to \
copyright limitations in ways which metadata are&#xA;not, and thus need separate visibility controls.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AnnotationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.ANNOTATION]</td></tr><tr><td>annotations</td><td port="annotations">list[BooleanAnnotation | ScoreAnnotation]</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.AnnotationEnhancement&#xA;&#xA;An enhancement which is composed of a list of Annotations.&#xA;"];
   "destiny_sdk.enhancements.BooleanAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BooleanAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.BOOLEAN]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>value</td><td port="value">bool</td></tr><tr><td>score</td><td port="score">float | None</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.BooleanAnnotation&#xA;&#xA;An annotation is a way of tagging the content with a label of some kind.&#xA;&#\
xA;This class will probably be broken up in the future, but covers most of our&#xA;initial cases.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "destiny_sdk.enhancements.BooleanAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.ScoreAnnotation"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ScoreAnnotation</b></td></tr><tr><td>annotation_type</td><td port="annotation_type">Literal[AnnotationType.SCORE]</td></tr><tr><td>scheme</td><td port="scheme">str</td></tr><tr><td>label</td><td port="label">str</td></tr><tr><td>score</td><td port="score">float</td></tr><tr><td>data</td><td port="data">dict</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.ScoreAnnotation&#xA;&#xA;An annotation which represents the score for a label.&#xA;&#xA;This is similar \
to a BooleanAnnotation, but lacks a boolean determination&#xA;as to the application of the label.&#xA;"];
   "destiny_sdk.enhancements.AnnotationEnhancement":annotations:e -> "destiny_sdk.enhancements.ScoreAnnotation":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Authorship"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Authorship</b></td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>orcid</td><td port="orcid">str</td></tr><tr><td>position</td><td port="position">AuthorPosition</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Authorship&#xA;&#xA;Represents a single author and their association with a reference.&#xA;&#xA;This is \
a simplification of the OpenAlex [Authorship&#xA;object](https://docs.openalex.org/api-entities/works/work-object/authorship-object)&#\
xA;for our purposes.&#xA;"];
   "destiny_sdk.enhancements.BibliographicMetadataEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>BibliographicMetadataEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.BIBLIOGRAPHIC]</td></tr><tr><td>authorship</td><td port="authorship">list[Authorship] | None</td></tr><tr><td>cited_by_count</td><td port="cited_by_count">int | None</td></tr><tr><td>created_date</td><td port="created_date">date | None</td></tr><tr><td>publication_date</td><td port="publication_date">date | None</td></tr><tr><td>publication_year</td><td port="publication_year">int | None</td></tr><tr><td>publisher</td><td port="publisher">str | None</td></tr><tr><td>title</td><td port="title">str | None</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.BibliographicMetadataEnhancement&#xA;&#xA;An enhancement which is made up of bibliographic metadata.&#xA;&#\
xA;Generally this will be sourced from a database such as OpenAlex or similar.&#xA;For directly contributed references, these may \
not be complete.&#xA;"];
   "destiny_sdk.enhancements.BibliographicMetadataEnhancement":authorship:e -> "destiny_sdk.enhancements.Authorship":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.EnhancementFileInput"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>EnhancementFileInput</b></td></tr><tr><td>source</td><td port="source">str</td></tr><tr><td>visibility</td><td port="visibility">Visibility</td></tr><tr><td>enhancement_type</td><td port="enhancement_type">EnhancementType</td></tr><tr><td>robot_version</td><td port="robot_version">str | None</td></tr><tr><td>content</td><td port="content">BibliographicMetadataEnhancement | AbstractContentEnhancement | AnnotationEnhancement | LocationEnhancement</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.EnhancementFileInput&#xA;&#xA;Enhancement model used to marshall a file input to new references.&#xA;"];
   "destiny_sdk.enhancements.EnhancementFileInput":content:e -> "destiny_sdk.enhancements.AbstractContentEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.EnhancementFileInput":content:e -> "destiny_sdk.enhancements.AnnotationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.EnhancementFileInput":content:e -> "destiny_sdk.enhancements.BibliographicMetadataEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.LocationEnhancement"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LocationEnhancement</b></td></tr><tr><td>enhancement_type</td><td port="enhancement_type">Literal[EnhancementType.LOCATION]</td></tr><tr><td>locations</td><td port="locations">list[Location]</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.LocationEnhancement&#xA;&#xA;An enhancement which describes locations where this reference can be found.&#\
xA;&#xA;This maps closely (almost exactly) to OpenAlex's locations.&#xA;"];
   "destiny_sdk.enhancements.EnhancementFileInput":content:e -> "destiny_sdk.enhancements.LocationEnhancement":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "destiny_sdk.enhancements.Location"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>Location</b></td></tr><tr><td>is_oa</td><td port="is_oa">bool | None</td></tr><tr><td>version</td><td port="version">DriverVersion | None</td></tr><tr><td>landing_page_url</td><td port="landing_page_url">HttpUrl | None</td></tr><tr><td>pdf_url</td><td port="pdf_url">HttpUrl | None</td></tr><tr><td>license</td><td port="license">str | None</td></tr><tr><td>extra</td><td port="extra">dict | None</td></tr></table>>,
      tooltip="destiny_sdk.enhancements.Location&#xA;&#xA;A location where a reference can be found.&#xA;&#xA;This maps almost completely to the \
OpenAlex&#xA;[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)&#xA;"];
   "destiny_sdk.enhancements.LocationEnhancement":locations:e -> "destiny_sdk.enhancements.Location":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "destiny_sdk.identifiers.DOIIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DOIIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.DOI]</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.DOIIdentifier&#xA;&#xA;An external identifier representing a DOI.&#xA;"];
   "destiny_sdk.identifiers.OpenAlexIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>OpenAlexIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.OPEN_ALEX]</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.OpenAlexIdentifier&#xA;&#xA;An external identifier representing an OpenAlex ID.&#xA;"];
   "destiny_sdk.identifiers.OtherIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>OtherIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">str</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.OTHER]</td></tr><tr><td>other_identifier_name</td><td port="other_identifier_name">str</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.OtherIdentifier&#xA;&#xA;An external identifier not otherwise defined by the repository.&#xA;"];
   "destiny_sdk.identifiers.PubMedIdentifier"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>PubMedIdentifier</b></td></tr><tr><td>identifier</td><td port="identifier">int</td></tr><tr><td>identifier_type</td><td port="identifier_type">Literal[ExternalIdentifierType.PM_ID]</td></tr></table>>,
      tooltip="destiny_sdk.identifiers.PubMedIdentifier&#xA;&#xA;An external identifier representing a PubMed ID.&#xA;"];
   "libs.sdk.src.destiny_sdk.references.ReferenceFileInput"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>ReferenceFileInput</b></td></tr><tr><td>visibility</td><td port="visibility">Visibility</td></tr><tr><td>identifiers</td><td port="identifiers">list[DOIIdentifier | PubMedIdentifier | OpenAlexIdentifier | OtherIdentifier] | None</td></tr><tr><td>enhancements</td><td port="enhancements">list[EnhancementFileInput] | None</td></tr></table>>,
      tooltip="libs.sdk.src.destiny_sdk.references.ReferenceFileInput&#xA;&#xA;Enhancement model used to marshall a file input.&#xA;"];
   "libs.sdk.src.destiny_sdk.references.ReferenceFileInput":enhancements:e -> "destiny_sdk.enhancements.EnhancementFileInput":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.references.ReferenceFileInput":identifiers:e -> "destiny_sdk.identifiers.DOIIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.references.ReferenceFileInput":identifiers:e -> "destiny_sdk.identifiers.OpenAlexIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.references.ReferenceFileInput":identifiers:e -> "destiny_sdk.identifiers.OtherIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "libs.sdk.src.destiny_sdk.references.ReferenceFileInput":identifiers:e -> "destiny_sdk.identifiers.PubMedIdentifier":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
}

Show JSON schema
{
   "title": "ReferenceFileInput",
   "description": "Enhancement model used to marshall a file input.",
   "type": "object",
   "properties": {
      "visibility": {
         "$ref": "#/$defs/Visibility",
         "default": "public",
         "description": "The level of visibility of the reference"
      },
      "identifiers": {
         "anyOf": [
            {
               "items": {
                  "discriminator": {
                     "mapping": {
                        "doi": "#/$defs/DOIIdentifier",
                        "open_alex": "#/$defs/OpenAlexIdentifier",
                        "other": "#/$defs/OtherIdentifier",
                        "pm_id": "#/$defs/PubMedIdentifier"
                     },
                     "propertyName": "identifier_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/DOIIdentifier"
                     },
                     {
                        "$ref": "#/$defs/PubMedIdentifier"
                     },
                     {
                        "$ref": "#/$defs/OpenAlexIdentifier"
                     },
                     {
                        "$ref": "#/$defs/OtherIdentifier"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of `ExternalIdentifiers` for the Reference",
         "title": "Identifiers"
      },
      "enhancements": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/EnhancementFileInput"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of enhancements for the reference",
         "title": "Enhancements"
      }
   },
   "$defs": {
      "AbstractContentEnhancement": {
         "description": "An enhancement which is specific to the abstract of a reference.\n\nThis is separate from the `BibliographicMetadata` for two reasons:\n\n1. Abstracts are increasingly missing from sources like OpenAlex, and may be\nbackfilled from other sources, without the bibliographic metadata.\n2. They are also subject to copyright limitations in ways which metadata are\nnot, and thus need separate visibility controls.",
         "properties": {
            "enhancement_type": {
               "const": "abstract",
               "default": "abstract",
               "title": "Enhancement Type",
               "type": "string"
            },
            "process": {
               "$ref": "#/$defs/AbstractProcessType",
               "description": "The process used to acquire the abstract."
            },
            "abstract": {
               "description": "The abstract of the reference.",
               "title": "Abstract",
               "type": "string"
            }
         },
         "required": [
            "process",
            "abstract"
         ],
         "title": "AbstractContentEnhancement",
         "type": "object"
      },
      "AbstractProcessType": {
         "description": "The process used to acquyire the abstract.\n\n**Allowed values**:\n- `uninverted`\n- `closed_api`\n- `other`",
         "enum": [
            "uninverted",
            "closed_api",
            "other"
         ],
         "title": "AbstractProcessType",
         "type": "string"
      },
      "AnnotationEnhancement": {
         "description": "An enhancement which is composed of a list of Annotations.",
         "properties": {
            "enhancement_type": {
               "const": "annotation",
               "default": "annotation",
               "title": "Enhancement Type",
               "type": "string"
            },
            "annotations": {
               "items": {
                  "discriminator": {
                     "mapping": {
                        "boolean": "#/$defs/BooleanAnnotation",
                        "score": "#/$defs/ScoreAnnotation"
                     },
                     "propertyName": "annotation_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/BooleanAnnotation"
                     },
                     {
                        "$ref": "#/$defs/ScoreAnnotation"
                     }
                  ]
               },
               "title": "Annotations",
               "type": "array"
            }
         },
         "required": [
            "annotations"
         ],
         "title": "AnnotationEnhancement",
         "type": "object"
      },
      "AuthorPosition": {
         "description": "The position of an author in a list of authorships.\n\nMaps to the data from OpenAlex.\n\n**Allowed values**:\n- `first`: The first author.\n- `middle`: Any middle author\n- `last`: The last author",
         "enum": [
            "first",
            "middle",
            "last"
         ],
         "title": "AuthorPosition",
         "type": "string"
      },
      "Authorship": {
         "description": "Represents a single author and their association with a reference.\n\nThis is a simplification of the OpenAlex [Authorship\nobject](https://docs.openalex.org/api-entities/works/work-object/authorship-object)\nfor our purposes.",
         "properties": {
            "display_name": {
               "description": "The display name of the author.",
               "title": "Display Name",
               "type": "string"
            },
            "orcid": {
               "description": "The ORCid of the author.",
               "title": "Orcid",
               "type": "string"
            },
            "position": {
               "$ref": "#/$defs/AuthorPosition",
               "description": "The position of the author within the list of authors."
            }
         },
         "required": [
            "display_name",
            "orcid",
            "position"
         ],
         "title": "Authorship",
         "type": "object"
      },
      "BibliographicMetadataEnhancement": {
         "description": "An enhancement which is made up of bibliographic metadata.\n\nGenerally this will be sourced from a database such as OpenAlex or similar.\nFor directly contributed references, these may not be complete.",
         "properties": {
            "enhancement_type": {
               "const": "bibliographic",
               "default": "bibliographic",
               "title": "Enhancement Type",
               "type": "string"
            },
            "authorship": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Authorship"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `Authorships` belonging to this reference.",
               "title": "Authorship"
            },
            "cited_by_count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex) The number of citations to this work. These are the times that\nother works have cited this work\n",
               "title": "Cited By Count"
            },
            "created_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ISO8601 date this metadata record was created",
               "title": "Created Date"
            },
            "publication_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The date which the version of record was published.",
               "title": "Publication Date"
            },
            "publication_year": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The year in which the version of record was published.",
               "title": "Publication Year"
            },
            "publisher": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the entity which published the version of record.",
               "title": "Publisher"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The title of the reference.",
               "title": "Title"
            }
         },
         "title": "BibliographicMetadataEnhancement",
         "type": "object"
      },
      "BooleanAnnotation": {
         "description": "An annotation is a way of tagging the content with a label of some kind.\n\nThis class will probably be broken up in the future, but covers most of our\ninitial cases.",
         "properties": {
            "annotation_type": {
               "const": "boolean",
               "default": "boolean",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of the annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "value": {
               "description": "Boolean flag for this annotation",
               "title": "Value",
               "type": "boolean"
            },
            "score": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A confidence score for this annotation",
               "title": "Score"
            },
            "data": {
               "additionalProperties": true,
               "description": "\nAn object representation of the annotation including any confidence scores or\ndescriptions.\n",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "value"
         ],
         "title": "BooleanAnnotation",
         "type": "object"
      },
      "DOIIdentifier": {
         "description": "An external identifier representing a DOI.",
         "properties": {
            "identifier": {
               "description": "The DOI of the reference.",
               "pattern": "^10\\.\\d{4,9}/[-._;()/:a-zA-Z0-9%<>\\[\\]+&]+$",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "doi",
               "default": "doi",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "DOIIdentifier",
         "type": "object"
      },
      "DriverVersion": {
         "description": "The version based on the DRIVER guidelines versioning scheme.\n\n(Borrowed from OpenAlex)\n\nAllowed values:\n- `publishedVersion`: The document's version of record. This is the most\nauthoritative version.\n- `acceptedVersion`: The document after having completed peer review and being\nofficially accepted for publication. It will lack publisher formatting, but the\ncontent should be interchangeable with the that of the publishedVersion.\n- `submittedVersion`: the document as submitted to the publisher by the authors, but\nbefore peer-review. Its content may differ significantly from that of the accepted\narticle.",
         "enum": [
            "publishedVersion",
            "acceptedVersion",
            "submittedVersion",
            "other"
         ],
         "title": "DriverVersion",
         "type": "string"
      },
      "EnhancementFileInput": {
         "description": "Enhancement model used to marshall a file input to new references.",
         "properties": {
            "source": {
               "description": "The enhancement source for tracking provenance.",
               "title": "Source",
               "type": "string"
            },
            "visibility": {
               "$ref": "#/$defs/Visibility",
               "description": "The level of visibility of the enhancement"
            },
            "enhancement_type": {
               "$ref": "#/$defs/EnhancementType",
               "description": "The type of enhancement."
            },
            "processor_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The version of the robot that generated the content.",
               "title": "Processor Version"
            },
            "content": {
               "description": "The content of the enhancement.",
               "discriminator": {
                  "mapping": {
                     "abstract": "#/$defs/AbstractContentEnhancement",
                     "annotation": "#/$defs/AnnotationEnhancement",
                     "bibliographic": "#/$defs/BibliographicMetadataEnhancement",
                     "location": "#/$defs/LocationEnhancement"
                  },
                  "propertyName": "enhancement_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/BibliographicMetadataEnhancement"
                  },
                  {
                     "$ref": "#/$defs/AbstractContentEnhancement"
                  },
                  {
                     "$ref": "#/$defs/AnnotationEnhancement"
                  },
                  {
                     "$ref": "#/$defs/LocationEnhancement"
                  }
               ],
               "title": "Content"
            }
         },
         "required": [
            "source",
            "visibility",
            "enhancement_type",
            "content"
         ],
         "title": "EnhancementFileInput",
         "type": "object"
      },
      "EnhancementType": {
         "description": "The type of enhancement.\n\nThis is used to identify the type of enhancement in the `Enhancement` class.\n\n**Allowed values**:\n- `bibliographic`: Bibliographic metadata.\n- `abstract`: The abstract of a reference.\n- `annotation`: A free-form enhancement for tagging with labels.\n- `locations`: Locations where the reference can be found.\n- `full_text`: The full text of the reference. (To be implemeted)",
         "enum": [
            "bibliographic",
            "abstract",
            "annotation",
            "location",
            "full_text"
         ],
         "title": "EnhancementType",
         "type": "string"
      },
      "Location": {
         "description": "A location where a reference can be found.\n\nThis maps almost completely to the OpenAlex\n[Location object](https://docs.openalex.org/api-entities/works/work-object/location-object)",
         "properties": {
            "is_oa": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): True if an Open Access (OA) version of this work is available\nat this location. May be left as null if this is unknown (and thus)\ntreated effectively as `false`.\n",
               "title": "Is Oa"
            },
            "version": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DriverVersion"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nThe version (according to the DRIVER versioning scheme) of this location.\n"
            },
            "landing_page_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "(From OpenAlex): The landing page URL for this location.",
               "title": "Landing Page Url"
            },
            "pdf_url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): A URL where you can find this location as a PDF.\n",
               "title": "Pdf Url"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n(From OpenAlex): The location's publishing license. This can be a Creative\nCommons license such as cc0 or cc-by, a publisher-specific license, or null\nwhich means we are not able to determine a license for this location.\n",
               "title": "License"
            },
            "extra": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Any extra metadata about this location",
               "title": "Extra"
            }
         },
         "title": "Location",
         "type": "object"
      },
      "LocationEnhancement": {
         "description": "An enhancement which describes locations where this reference can be found.\n\nThis maps closely (almost exactly) to OpenAlex's locations.",
         "properties": {
            "enhancement_type": {
               "const": "location",
               "default": "location",
               "title": "Enhancement Type",
               "type": "string"
            },
            "locations": {
               "description": "A list of locations where this reference can be found.",
               "items": {
                  "$ref": "#/$defs/Location"
               },
               "title": "Locations",
               "type": "array"
            }
         },
         "required": [
            "locations"
         ],
         "title": "LocationEnhancement",
         "type": "object"
      },
      "OpenAlexIdentifier": {
         "description": "An external identifier representing an OpenAlex ID.",
         "properties": {
            "identifier": {
               "description": "The OpenAlex ID of the reference.",
               "pattern": "^W\\d+$",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "open_alex",
               "default": "open_alex",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "OpenAlexIdentifier",
         "type": "object"
      },
      "OtherIdentifier": {
         "description": "An external identifier not otherwise defined by the repository.",
         "properties": {
            "identifier": {
               "description": "The identifier of the reference.",
               "title": "Identifier",
               "type": "string"
            },
            "identifier_type": {
               "const": "other",
               "default": "other",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            },
            "other_identifier_name": {
               "description": "The name of the undocumented identifier type.",
               "title": "Other Identifier Name",
               "type": "string"
            }
         },
         "required": [
            "identifier",
            "other_identifier_name"
         ],
         "title": "OtherIdentifier",
         "type": "object"
      },
      "PubMedIdentifier": {
         "description": "An external identifier representing a PubMed ID.",
         "properties": {
            "identifier": {
               "description": "The PubMed ID of the reference.",
               "title": "Identifier",
               "type": "integer"
            },
            "identifier_type": {
               "const": "pm_id",
               "default": "pm_id",
               "description": "The type of identifier used.",
               "title": "Identifier Type",
               "type": "string"
            }
         },
         "required": [
            "identifier"
         ],
         "title": "PubMedIdentifier",
         "type": "object"
      },
      "ScoreAnnotation": {
         "description": "An annotation which represents the score for a label.\n\nThis is similar to a BooleanAnnotation, but lacks a boolean determination\nas to the application of the label.",
         "properties": {
            "annotation_type": {
               "const": "score",
               "default": "score",
               "title": "Annotation Type",
               "type": "string"
            },
            "scheme": {
               "description": "An identifier for the scheme of annotation",
               "examples": [
                  "openalex:topic",
                  "pubmed:mesh"
               ],
               "title": "Scheme",
               "type": "string"
            },
            "label": {
               "description": "A high level label for this annotation like the name of the topic",
               "title": "Label",
               "type": "string"
            },
            "score": {
               "description": "Score for this annotation",
               "title": "Score",
               "type": "number"
            },
            "data": {
               "additionalProperties": true,
               "description": "An object representation of the annotation including any confidence scores or descriptions.",
               "title": "Data",
               "type": "object"
            }
         },
         "required": [
            "scheme",
            "label",
            "score"
         ],
         "title": "ScoreAnnotation",
         "type": "object"
      },
      "Visibility": {
         "description": "The visibility of a data element in the repository.\n\nThis is used to manage whether information should be publicly available or\nrestricted (generally due to copyright constraints from publishers).\n\nTODO: Implement data governance layer to manage this.\n\n**Allowed values**:\n\n- `public`: Visible to the general public without authentication.\n- `restricted`: Requires authentication to be visible.\n- `hidden`: Is not visible, but may be passed to data mining processes.",
         "enum": [
            "public",
            "restricted",
            "hidden"
         ],
         "title": "Visibility",
         "type": "string"
      }
   }
}

Fields:
field enhancements: list[EnhancementFileInput] | None = None[source]#

A list of enhancements for the reference

field identifiers: list[Annotated[DOIIdentifier | PubMedIdentifier | OpenAlexIdentifier | OtherIdentifier, FieldInfo(annotation=NoneType, required=True, discriminator='identifier_type')]] | None = None[source]#

A list of ExternalIdentifiers for the Reference

field visibility: Visibility = Visibility.PUBLIC[source]#

The level of visibility of the reference

classmethod from_jsonl(jsonl: str) Self[source]#

Create an object from a JSONL string.

Parameters:

jsonl (str) – The JSONL string to parse.

Returns:

The created object.

Return type:

Self

to_jsonl() str[source]#

Convert the model to a JSONL string.

Returns:

The JSONL string representation of the model.

Return type:

str