Skip to content

Record ID

GKGRECORDID identifies a row. format_record_id combines a supplied UTC batch timestamp with a positive sequence number and an optional translation marker.

Requirements

Core package and caller-supplied metadata. No article retrieval or NLP model is required.

Example

from gdelt_regkg.fields.metadata import format_record_id

print(format_record_id("20250101120000", 1))
print(format_record_id("20250101120000", 2, translated=True))
20250101120000-1
20250101120000-T2

Behavior

The timestamp uses YYYYMMDDHHMMSS. Sequence numbers must be positive integers. The timestamp must be known. translated=True inserts T before the sequence number.

Set batch_time= and sequence= on RecordMetadata, then pass the metadata to generate_gkg(text, metadata, resources). Translation metadata adds the T marker automatically. The batch timestamp also fills V2.1DATE.

Limitations

Assign sequence numbers so IDs are unique within your dataset. These are locally generated IDs. Article text cannot recover the IDs assigned by GDELT.

Batch date · Translation information · GKG 2.1 format

GKG field reference