Content profile resources are difficult to inspect because they contain metadata that is only discoverable after the client downloads the content. The Metadata pattern solves this by linking a Content resource to a Metadata resource describing the content. A client can examine the metadata and then decide to download all the content.
If the Content resource changes, the metadata may change as well to reflect new metadata values. If the client deletes a Content resource, it also deletes the related Metadata resource.
Metadata’s Info profile means the client cannot edit or delete the metadata directly. An API may wish to add user-editable resources like descriptions, tags or other information and link it to the Content resource. These additional resource relationships are outside the scope of this pattern.
The Metadata resource presents the Info profile and contains relevant details about the Content resource, depending on the type of content. Images can have metadata about the dimensions, resolution and colour model. Documents may contain metadata about the page count and author.
Metadata should be used in other API contexts like search results or directory listings as they provide useful information for the client to select a Content resource. The
content link gives the client navigability to the actual Content data should they choose to consume it.
Protocol for Web Description Resources: POWDER
- “describedby”: Appendix D
The “describes” Link Relation Type: RFC 6892
© 2019-2023 Matt Bishop
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.