entityIdtextrequiredThe entity it is linked to
Becomes the column entity_id of entity_link.
Written at commons/data/models/proof/mod.ts:119
A record of one source linked to an entity that other sources also hold, with the rule that found it and the score, so that who is the same person or thing is a fact with a reason and not a guess
Model proof. Written in commons/data/models/proof/mod.ts:115. Identified by entityLinkId.
entityIdtextrequiredThe entity it is linked to
Becomes the column entity_id of entity_link.
Written at commons/data/models/proof/mod.ts:119
entityLinkIdidentifierrequiredWhat identifies the link: the source and the key of its record
Becomes the column entity_link_id of entity_link.
Written at commons/data/models/proof/mod.ts:118
rulecode of linkRulerequiredHow it was found
Becomes the column rule of entity_link.
Written at commons/data/models/proof/mod.ts:122
scoretextrequiredHow sure, as a number from 0 to 1
Becomes the column score of entity_link.
Written at commons/data/models/proof/mod.ts:123
sourcetextrequiredsourceKeytextrequiredThe key of the record in the source
Becomes the column source_key of entity_link.
Written at commons/data/models/proof/mod.ts:121
Projects to the table entity_link with the primary key entity_link_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
entity_id | text | false | attribute | entityLink.entityId |
entity_link_id | text | false | attribute | entityLink.entityLinkId |
rule | text | false | attribute | entityLink.rule |
score | text | false | attribute | entityLink.score |
source | text | false | attribute | entityLink.source |
source_key | text | false | attribute | entityLink.sourceKey |
CREATE TABLE IF NOT EXISTS "entity_link" (
"entity_link_id" VARCHAR NOT NULL PRIMARY KEY,
"entity_id" VARCHAR NOT NULL,
"source" VARCHAR NOT NULL,
"source_key" VARCHAR NOT NULL,
"rule" VARCHAR NOT NULL,
"score" VARCHAR NOT NULL,
CONSTRAINT "entity_link_source_source_key_uq" UNIQUE ("source", "source_key"),
CONSTRAINT "entity_link_rule_ck" CHECK ("rule" IN ('exact', 'normalized', 'similar', 'confirmed'))
);CREATE TABLE IF NOT EXISTS "entity_link" (
"entity_link_id" TEXT NOT NULL PRIMARY KEY,
"entity_id" TEXT NOT NULL,
"source" TEXT NOT NULL,
"source_key" TEXT NOT NULL,
"rule" TEXT NOT NULL,
"score" TEXT NOT NULL,
CONSTRAINT "entity_link_source_source_key_uq" UNIQUE ("source", "source_key"),
CONSTRAINT "entity_link_rule_ck" CHECK ("rule" IN ('exact', 'normalized', 'similar', 'confirmed'))
);CREATE TABLE IF NOT EXISTS "entity_link" (
"entity_link_id" TEXT NOT NULL PRIMARY KEY,
"entity_id" TEXT NOT NULL,
"source" TEXT NOT NULL,
"source_key" TEXT NOT NULL,
"rule" TEXT NOT NULL,
"score" TEXT NOT NULL,
CONSTRAINT "entity_link_source_source_key_uq" UNIQUE ("source", "source_key"),
CONSTRAINT "entity_link_rule_ck" CHECK ("rule" IN ('exact', 'normalized', 'similar', 'confirmed'))
);Read and written from TypeScript with the types the model gives: import { entityLink } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/proof.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { entityLink } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(entityLink).select((s) => ({ entityLinkId: s.entityLink.entityLinkId, entityId: s.entityLink.entityId })).run(runner);