property vs. rel :
Both attributes indicate the predicate of a triple, for example. rel="http://purl.org/dc/terms/creator , which is a predicate ... has as a creator: ...
The difference is where they get their object from. A bit simplified rules for property are: Object taken ...
- from a valid
content attribute or, if this is not in the tag, - (if the tag :) does not have the
datatype attr attribute) from a valid resource attribute or, if it is not in the tag, - (if the tag :) does not have the
datatype attr attribute) from the actual href attribute, or if it is not in the tag, - (if
datatype attr is not present in the tag) from a valid src attribute, or if it is not in the tag, - from the internal content of the element triggered by the tag.
A bit simplified, rel differs in two aspects:
- It takes its object only from the
resource or href or src attribute. - It takes its object not only from the attribute of the same tag, but can also accept it from descendant tags. The whole mechanism is called "chaining": "This is the main difference between @property and @rel: the latter calls the chain, while the former usually does not." 1 Usually, but
property can cause a chain if used with typeof (cf. 2 ).
about vs resource :
about is an attribute pointing to the subject of a triple. The rules for resource more complex: it can point to an object or object, and the chain also plays here.
IMHO, the chain is the most complex and confusing part of RDFa (and does not give you more than syntactic sugar). I would avoid the chain. This can be avoided by avoiding the rel , rev , resource and typeof attributes, which at the same time leads to some simplification. Thus, I use only the following attributes:
about for an objectproperty for predicatecontent or href or src (or the internal content of the element) for the object, following the rules abovelang for a language tag for object literals, for example. lang="en"datatype for data type tag for object literalsprefix (but only once per document) so that I can shorten URLs by prefix, for example. property="dc:creator"vocab (rarely and not more than once in a document), so that I can implicitly shorten URLs, for example. property="creator" .
(And I use the <base href="..."> to indicate the base value of the document URL.)
This is a strict, safe, easy to use and easy to use subset of RDFa and allows you to express any trio you want.
source share