Query syntax for specific, latest or all artefact versions¶
The SDMX REST API supports retrievals of specific, latest or all artefact versions according to the SDMX semantic versioning & dependency management rules (cf. Section 4.3 of the SDMX Technical Notes) by means of the SDMX REST API wildcard operators.
Let’s use the version form X.Y.Z-EXT, where
- X is a non-negative number representing the MAJOR version part
- Y is a non-negative number representing the MINOR version part
- Z is a non-negative number representing the PATCH version part
- -EXT is a constrained character string representing the version EXTENSION part
Capital letters X, Y, Z and EXT are used for the queried version parts and the exactly corresponding response version parts. In case the response version parts could be different from the version parts used in the query, we will use the small characters x, y, z and ext instead. Last version parts are omitted as required.
Query for a specific version¶
XThis matches versionX. Note that this version format is deprecated.X.YThis matches versionX.Y.X.Y.ZThis matches versionX.Y.Z.X.Y.Z-EXTThis matches versionX.Y.Z-EXT.
Query for the latest stable (semantic) version¶
Without specific minimum version¶
+This matches the latest available stable semantic version of an artefact in form ofx.y.zwherex> 0. It is equivalent to querying for:+.0.0or1+.0.0X.+.0WithX> 0. This matches the latest available stable semantic version of an artefact in form ofX.y.z. It is equivalent to querying for:X.0+.0X.Y.+WithX> 0. This matches the latest available stable semantic version of an artefact in form ofX.Y.z. It is equivalent to querying for:X.Y.0+
With specific minimum version¶
X+.Y.ZWithX> 0. This matches the latest available stable semantic version of an artefact in form ofx.y.zwherex.y.z>=X.Y.Z.X.Y+.ZWithX> 0. This matches the latest available stable semantic version of an artefact in form ofX.y.zwherey.z>=Y.Z.X.Y.Z+WithX> 0. This matches the latest available stable semantic version of an artefact in form ofX.Y.zwherez>=Z.
Query for the latest possibly unstable version¶
Without specific minimum version¶
~This matches the latest available version of an artefact in form ofx,x.y,x.y.zorx.y.z-ext.~.0This matches the latest available version of an artefact in form ofx.y. It is equivalent to querying for:0~.0~.0.0This matches the latest available version of an artefact in form ofx.y.zorx.y.z-ext. It is equivalent to querying for:0~.0.0X.~This matches the latest available version of an artefact in form ofX.y. It is equivalent to querying for:X.0~X.~.0This matches the latest available version of an artefact in form ofX.y.zorX.y.z-ext. It is equivalent to querying for:X.0~.0X.Y.~This matches the latest available version of an artefact in form ofX.Y.zorX.Y.z-ext. It is equivalent to querying for:X.Y.0~
With specific minimum version¶
X~.YThis matches the latest available version of an artefact in form ofx.ywherex.y>=X.Y.X~.Y.ZThis matches the latest available version of an artefact in form ofx.y.zorx.y.z-extwherex.y.z>=X.Y.Z.X.Y~This matches the latest available version of an artefact in form ofX.ywherey>=Y.X.Y~.ZThis matches the latest available version of an artefact in form ofX.y.zorX.y.z-extwherey.z>=Y.Z.X.Y.Z~This matches the latest available version of an artefact in form ofX.Y.zorX.Y.z-extwherez>=Z.
Query for all versions¶
Without specific minimum version¶
*This matches all versions of an artefact in form ofx,x.y,x.y.zorx.y.z-ext*.0This matches all versions of an artefact in form ofx.y. It is equivalent to querying for:0*.0*.0.0This matches all versions of an artefact in form ofx.y.zorx.y.z-ext. It is equivalent to querying for:0*.0.0X.*This matches all versions of an artefact in form ofX.y. It is equivalent to querying for:X.0*X.*.0This matches all versions of an artefact in form ofX.y.zorX.y.z-ext. It is equivalent to querying for:X.0*.0X.Y.*This matches all versions of an artefact in form ofX.Y.zorX.Y.z-ext. It is equivalent to querying for:X.Y.0*
With specific minimum version¶
X*.YThis matches all versions of an artefact in form ofx.ywherex.y>=X.Y.X*.Y.ZThis matches all versions of an artefact in form ofx.y.zorx.y.z-extwherex.y.z>=X.Y.Z.X.Y*This matches all versions of an artefact in form ofX.ywherey>=Y.X.Y*.ZThis matches all versions of an artefact in form ofX.y.zorX.y.z-extwherey.z>=Y.Z.X.Y.Z*This matches all versions of an artefact in form ofX.Y.zorX.Y.z-extwherez>=Z.
OR operator¶
Any of the version query strings above can be combined with the OR operator (,). For example:
- 1~.2.0,1.2.0+
- +,1.2.1*
Unsupported syntax¶
The following version query syntax cannot be correctly interpreted and is not supported.
Using a positive number in version parts after a part that is fully wildcarded with +, ~ or *:
- +.2.3 Use +.0.0 instead.
- 1.+.3 Use 1.+.0 instead.
- ~.2 Use ~.0 instead.
- ~.2.3 Use ~.0.0 instead.
- 1.~.3 Use 1.~.0 instead.
- *.2 Use *.0 instead.
- *.2.3 Use *.0.0 instead.
- 1.*.3 Use 1.*.0 instead.
Using + (querying for stable versions always having 3 parts) with only 2 version parts:
- +.0 Use + or +.0.0 instead.
- 2.3+ Use 2.3+.0 instead.
Using two or more of the +, ~ or * wildcard operators within the same version:
- ~.0.* Use ~ or ~.0.0 instead.
- 3.2*.1+ Use 3.2*.1, 3.2.1+ or 3.2*.1,3.2.1+ instead.
- 3.2+.1+ Use 3.2+.1 instead.