rest/property
The Problem
HTML has long used the meta tag for metadata to describe the contents of a document. While this works well for "intrinsic" metadata related to authoring, there's no equivalent function for "extrinsic" metadata provided by the server or external sources.
To address this need, [WebDAV] defined a new set of "PROP" methods to create, search, and retrieve properties. Unfortunately, in addition to defining a whole new protocol this violates the [rest]ful notion of each resource having a URL for manipulating it. This raises the question, "What is the RESTful way to use HTML and HTTP to provide useful properties."
Proposal
relProperty
Our proposal, currentlly called "relProperty", is motivated by the following principles:
- Every property must have at least one well-defined URL which can be retrieved and updated.
- There must be an easy way to discover all the properties associated with a given document.
- It must be simple to implement on existing web servers without requiring non-trivial modifications
- It should respect and build on existing microformat principles and practices
- It should be consistent with URL rest/opacity (properly understood)
<link>
Together, this implies that that the optimal way to associate a property with a document is via the HTML [ link] tag (or the equivalent HTTP "Link:"). This provides the requisite mechanism for telling the client how to construct an appropriate URL for getting or setting each property, as in:
<link rel="property" href=".;prop1">
;property
It is conventional, but not mandatory, to use a semicolon (";") as the first character of each property. This follows the convention used in, e.g. ColdFusion, and eases human-readability.
Examples
- TBD
Open Issues
- Is that the right href syntax for a relative property?
- Can properties be chained together? If so, are they retrieved in parallel, or would those be subproperties?
- Would we need to worry about semicolon exploits?
- Are there other conventions we should follow/avoid?
- Should the "Link:" tag itself be declared in HTTP "OPTIONS"?