Get latest version, with special handling for semantics of "latest" regarding new collection types.
Datasets and dataset collections always start out as draft so unlike other entities
there is a concept of a stable version which is the "real" latest, but which might not always exist.
For datasets/dataset collections the latest version refers to a DRAFT, so latest stable version is versionNumber
- 1
under the condition that the versionNumber
is greater or equal to 2.
When versionNumber
= 1 and isLatestVersion
is TRUE, this means there is not yet a stable version.
When using stable version semantics, if a stable version does not exist an error will be thrown.
Usage
latest_version(id, version_semantics = c("abs", "stable"))