Every record of a text database is identified by
doc_id = "<source>:<source_id>": the prefix keeps identifiers unique
across sources and tells where a record comes from without a join.
make_doc_id()builds identifiers and refuses missing or empty parts;split_doc_id()splits them back into source and identifier.
Details
Identifiers are forever: once a record has an identifier, it keeps it,
even when a better identifier is found later or the record turns out to
duplicate another one (link duplicates with a duplicate_of column
instead of merging identifiers). source_id must be derived from
something stable in the source: a file token, a DOI, or a hash of the
normalised URL (hash_id()), never the order of collection. When the
source gives no identifier at all, keep the decision that two records are
the same as data (who decided, when, why) rather than overwriting one of
them: Lemercier and Zalc (2019, ch. 3) advise to change identifiers when
two individuals turn out to be one, which a database read by other
projects cannot do without breaking their joins.
See also
Other identifiers:
hash_id(),
make_slug(),
pad_id()