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
andidentifier
(andother_identifier_name
where relevant) already present in the database.Enhancement collisions are detected on an entry with matching
enhancement_type
andsource
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.
- pydantic model libs.sdk.src.destiny_sdk.imports.ImportBatchIn[source]#
Input for creating an import batch.
Show Entity Relationship Diagram
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
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.
- 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
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
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_version: str [Required][source]#
The version of the processor that is importing the data.
- pydantic model libs.sdk.src.destiny_sdk.imports.ImportRecordRead[source]#
Core import record class.
Show Entity Relationship Diagram
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_version: str [Required][source]#
The version of the processor that is importing the data.
- 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.
- pydantic model libs.sdk.src.destiny_sdk.imports.ImportResultRead[source]#
Core import result class.
Show Entity Relationship Diagram
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.
- 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.
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.
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
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" ] }
- pydantic model libs.sdk.src.destiny_sdk.robots.BatchEnhancementRequestRead[source]#
Core batch enhancement request class.
Show Entity Relationship Diagram
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" ] }
- 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 usingGET /references/enhancement/batch/<batch_request_id>
.
- 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 usingGET /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 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.
- 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
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 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 usingGET /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 usingGET /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
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" ] }
- 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.
- 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
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" } } }
- 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.
- pydantic model libs.sdk.src.destiny_sdk.robots.EnhancementRequestIn[source]#
The model for requesting an enhancement on specific reference.
Show Entity Relationship Diagram
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
- pydantic model libs.sdk.src.destiny_sdk.robots.EnhancementRequestRead[source]#
Core enhancement request class.
Show Entity Relationship Diagram
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 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
- 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.
- 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
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" ] }
- 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
- 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
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.
- pydantic model libs.sdk.src.destiny_sdk.robots.Robot[source]#
Then model for a registered robot.
Show Entity Relationship Diagram
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.
- 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
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" ] }
- field id: Annotated[UUID, UuidVersion(uuid_version=4)] [Required][source]#
The ID of the robot automation.
- 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
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:
- pydantic model libs.sdk.src.destiny_sdk.robots.RobotError[source]#
A record of something going wrong with the robot.
Show Entity Relationship Diagram
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:
- pydantic model libs.sdk.src.destiny_sdk.robots.RobotIn[source]#
The model for registering a new robot.
Show Entity Relationship Diagram
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:
- pydantic model libs.sdk.src.destiny_sdk.robots.RobotRequest[source]#
An enhancement request from the repo to a robot.
Show Entity Relationship Diagram
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" ] }
- 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
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:
validate_error_or_enhancement_set
»all fields
- 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:
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
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 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
- 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
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]#
- 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.
- 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
- 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
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 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
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 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.
- 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
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 data: dict [Optional][source]#
An object representation of the annotation including any confidence scores or descriptions.
- 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.
- pydantic model libs.sdk.src.destiny_sdk.enhancements.Enhancement[source]#
Core enhancement class.
Show Entity Relationship Diagram
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 visibility: Visibility [Required][source]#
The level of visibility of the enhancement
- 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
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" ] }
- 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 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)
- 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
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 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
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:
- 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
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 data: dict [Optional][source]#
An object representation of the annotation including any confidence scores or descriptions.
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
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.
- pydantic model libs.sdk.src.destiny_sdk.identifiers.LinkedExternalIdentifier[source]#
An external identifier which identifies a reference.
Show Entity Relationship Diagram
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.
- pydantic model libs.sdk.src.destiny_sdk.identifiers.OpenAlexIdentifier[source]#
An external identifier representing an OpenAlex ID.
Show Entity Relationship Diagram
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:
- pydantic model libs.sdk.src.destiny_sdk.identifiers.OtherIdentifier[source]#
An external identifier not otherwise defined by the repository.
Show Entity Relationship Diagram
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:
- pydantic model libs.sdk.src.destiny_sdk.identifiers.PubMedIdentifier[source]#
An external identifier representing a PubMed ID.
Show Entity Relationship Diagram
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:
References#
Reference classes for the Destiny SDK.
- pydantic model libs.sdk.src.destiny_sdk.references.Reference[source]#
Core reference class.
Show Entity Relationship Diagram
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" ] }
- 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
- pydantic model libs.sdk.src.destiny_sdk.references.ReferenceFileInput[source]#
Enhancement model used to marshall a file input.
Show Entity Relationship Diagram
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" } } }
- 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