IDs, Names, and Slugs
Items retrieved in an excavation are traditionally assigned unique names or, in the case of small finds, tags. The structure of the names/tags is typically agreed upon prior to the beginning of an archaeological project and remains constant throughout the project. For example, in the Jezreel Expedition, a specific ceramic object may be assigned the following name/tag: 16/S/56.AR.5.1 (Season 2016, Area S, Locus 56, Basket 5, Artifact 1).
Other entities, such as features, or related media, have less structured "names" that are used as identifiers.
To handle these varied naming conventions in a uniform fashion, the software utilizes two kinds of unique identifiers for each record: (1) Names/slugs are used to identify items in the frontend and allow for retrieval of specific records from the database. (2) Surrogate autoincrement IDs are used by the database as uniform identifiers for the definition of relationships between tables.
Conversions between names and slugs in the frontend (avoiding reserved characters, white spaces, etc.) and vice-versa are required as part of each module's configuration files.
For example, the above-mentioned ceramic tag will have the corresponding
- name: 6/S/56.AR.5.1
- slug: 16.S.56.AR.5.1
- ID: autogenerated unsigned int
TIP
This "double" ID approach allows for human readable identifiers without the need to load both the "ID" and "Mame" to the frontend. The consistency between the "ID" and "Name" is maintained in the backend on create and update operations.