The documentation for canonical states that it is "is a special kind of Business Identifier" but then goes on to say "The canonical URL serves as a stable logical identifier for the resource". I understand the difference between the two types of identifiers, but it's unclear to me which I am suppose to use for canonicals.
Asked
Active
Viewed 179 times
1 Answers
1
The canonical identifier is the stable URI assigned by the source of truth which is the sole mechanism of referencing the resource via the canonical data type - which is the primary mechanism of referencing canonical resources. It is a 'logical' identifier in that there is no requirement for it to resolve (though it's nice if it does). It is a 'business' identifier in that it can be shared by different instances on different servers and always refers to the same business object and isn't expected to have any correlation to the resource identifier of the instance on any given server.

Lloyd McKenzie
- 6,345
- 1
- 13
- 10
-
Thanks Lloyd. That does clarify why it's a business resource. However, I am still confused about 'logical' identifiers not being required to resolve. In the documentation for Logical Id, it states "The location of a resource instance is an absolute URI constructed from the server base address at which the instance is found, the resource type and the Logical ID". That seems to imply that it should resolve. What is the use case for a reference that doesn't resolve? How would I go about finding the thing being referred to if it doesn't resolve? – Jason S. Nov 01 '21 at 03:53
-
Typically, you'd first search within your own data repository. If you don't find it there, you'd search it in the registry(ies) of your choice. Trying to resolve the canonical URL is generally a last resort. Resolving unknown URLs can pose a security risk and it's also not necessarily going to be 'close' from a performance perspective. In any case, once you've grabbed it, you should cache it. Finally, be aware that there can be multiple instances with the same canonical on the same server, in which case you'll need to differentiate by version. – Lloyd McKenzie Nov 01 '21 at 14:07