Items and Versions
When working with the Model Manager API, it is beneficial to internalize the distinction between items and the items’ versions. An item — that is, a tag, model, or file — can have one or more item versions saved in different branches, repositories, or even databases. The item is uniquely identified by its ItemKey. This key is preserved by default when saving an item from one database to another database. A version of an item belongs to a specific branch, repository, and database. Each item version is uniquely identified by its ItemVersionKey.
The items and their versions are represented by different interfaces in the Model Manager API. For a model (with analogous interfaces for tags and files):
ModelItem — the model item itself. May be used, for example, to query for all versions of the model in the database, irrespective of repository and branch.
ModelItemVersion — a specific version of the model item. Can be used to read data values and other information related to the version, but cannot be used to save a new version of the model item.
BranchModelItem — a dynamic representation of the latest version of the model item on a branch. May be used, for example, to update the model item on the branch by saving a new latest version.
CommitModelItem — a representation of the latest version of the model item at the time when a specific commit was saved in a branch. The version itself may have been saved in that same commit or in a previous commit on the branch. Can be used to read data values and other information related to the version, but cannot be used to save a new version of the model item.