{
"id": "pub.chive.annotation.entityLink",
"defs": {
"main": {
"key": "tid",
"type": "record",
"record": {
"type": "object",
"required": [
"eprintUri",
"target",
"linkedEntity",
"createdAt"
],
"properties": {
"target": {
"ref": "#textSpanTarget",
"type": "ref",
"description": "Text span being linked to an entity"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"eprintUri": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of the eprint containing the linked text"
},
"confidence": {
"type": "integer",
"maximum": 1000,
"minimum": 0,
"description": "Confidence score for the link (scaled by 1000 for 0.0-1.0 range)"
},
"linkedEntity": {
"refs": [
"#graphNodeLink",
"#externalIdLink",
"#authorLink",
"#eprintLink"
],
"type": "union",
"description": "The entity being linked to"
},
"schemaRevision": {
"type": "integer",
"minimum": 1,
"description": "Schema revision this record was created with. Absent means revision 1."
}
}
},
"description": "Link from a text span in an eprint to a knowledge graph entity"
},
"authorLink": {
"type": "object",
"required": [
"type",
"did",
"displayName"
],
"properties": {
"did": {
"type": "string",
"format": "did",
"description": "Author's DID"
},
"type": {
"type": "string",
"const": "author"
},
"orcid": {
"type": "string",
"description": "Author's ORCID (if available)"
},
"handle": {
"type": "string",
"format": "handle",
"description": "Author's handle"
},
"displayName": {
"type": "string",
"description": "Author's display name"
}
},
"description": "Link to an ATProto author"
},
"eprintLink": {
"type": "object",
"required": [
"type",
"uri",
"title"
],
"properties": {
"doi": {
"type": "string",
"description": "DOI if available"
},
"uri": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of the eprint"
},
"type": {
"type": "string",
"const": "eprint"
},
"title": {
"type": "string",
"description": "Eprint title"
}
},
"description": "Link to another eprint/preprint"
},
"boundingRect": {
"type": "object",
"required": [
"x1",
"y1",
"x2",
"y2",
"width",
"height",
"pageNumber"
],
"properties": {
"x1": {
"type": "string",
"description": "Left edge coordinate (as string to preserve float precision)"
},
"x2": {
"type": "string",
"description": "Right edge coordinate (as string to preserve float precision)"
},
"y1": {
"type": "string",
"description": "Top edge coordinate (as string to preserve float precision)"
},
"y2": {
"type": "string",
"description": "Bottom edge coordinate (as string to preserve float precision)"
},
"width": {
"type": "string",
"description": "Page width reference (as string to preserve float precision)"
},
"height": {
"type": "string",
"description": "Page height reference (as string to preserve float precision)"
},
"pageNumber": {
"type": "integer",
"minimum": 1,
"description": "1-indexed page number for the bounding rectangle"
}
},
"description": "Bounding rectangle coordinates for highlight positioning. All values stored as strings to preserve floating-point precision since ATProto only supports integer type."
},
"graphNodeLink": {
"type": "object",
"required": [
"type",
"uri",
"label",
"kind"
],
"properties": {
"id": {
"type": "string",
"description": "Node UUID identifier"
},
"uri": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of the graph node"
},
"kind": {
"type": "string",
"description": "Node kind: 'type' for classifications, 'object' for instances",
"knownValues": [
"type",
"object"
]
},
"slug": {
"type": "string",
"description": "Human-readable slug (e.g., 'computer-science')"
},
"type": {
"type": "string",
"const": "graphNode"
},
"label": {
"type": "string",
"description": "Display label for the node"
},
"subkind": {
"type": "string",
"description": "Subkind slug (e.g., 'field', 'facet', 'institution', 'contribution-type')"
},
"subkindUri": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of the subkind type node"
}
},
"description": "Link to a knowledge graph node (type or object, with optional subkind)"
},
"externalIdLink": {
"type": "object",
"required": [
"type",
"system",
"identifier",
"label"
],
"properties": {
"uri": {
"type": "string",
"format": "uri",
"description": "Full URI for the external entity"
},
"type": {
"type": "string",
"const": "externalId"
},
"label": {
"type": "string",
"description": "Display label for the entity"
},
"system": {
"type": "string",
"description": "External identifier system",
"knownValues": [
"wikidata",
"ror",
"orcid",
"isni",
"viaf",
"lcsh",
"fast",
"credit",
"spdx",
"fundref",
"mesh",
"aat",
"gnd",
"anzsrc",
"arxiv",
"doi",
"pmid",
"pmcid"
]
},
"identifier": {
"type": "string",
"description": "Identifier value (e.g., Q42 for Wikidata)"
}
},
"description": "Link to an external identifier (Wikidata, ROR, ORCID, etc.)"
},
"textSpanTarget": {
"type": "object",
"required": [
"source",
"selector"
],
"properties": {
"source": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of the source document"
},
"selector": {
"ref": "#textQuoteSelector",
"type": "ref",
"description": "Primary selector for resilient text matching"
},
"refinedBy": {
"ref": "#textPositionSelector",
"type": "ref",
"description": "Optional position selector for precise targeting"
}
},
"description": "W3C Web Annotation target for text spans"
},
"textQuoteSelector": {
"type": "object",
"required": [
"type",
"exact"
],
"properties": {
"type": {
"type": "string",
"const": "TextQuoteSelector"
},
"exact": {
"type": "string",
"description": "The exact text to match"
},
"prefix": {
"type": "string",
"maxLength": 32,
"description": "Text immediately before the match"
},
"suffix": {
"type": "string",
"maxLength": 32,
"description": "Text immediately after the match"
}
},
"description": "W3C TextQuoteSelector for resilient text matching"
},
"textPositionSelector": {
"type": "object",
"required": [
"type",
"start",
"end",
"pageNumber"
],
"properties": {
"end": {
"type": "integer",
"minimum": 0,
"description": "End character offset"
},
"type": {
"type": "string",
"const": "TextPositionSelector"
},
"start": {
"type": "integer",
"minimum": 0,
"description": "Start character offset"
},
"pageNumber": {
"type": "integer",
"minimum": 0,
"description": "0-indexed page number in the document"
},
"boundingRect": {
"ref": "#boundingRect",
"type": "ref",
"description": "Bounding rectangle for visual positioning"
}
},
"description": "W3C TextPositionSelector for character-based targeting"
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1,
"revision": 1
}