Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>property</code> vs. <code>rel</code>:</p> <p>Both attributes indicate a <em>predicate</em> of a triple, e.g. <code>rel="http://purl.org/dc/terms/creator</code>, which is the predicate <code>... has as a creator: ...</code>.</p> <p>The difference is, from where they take their <em>object</em>. Slightly simplified, the rules for <code>property</code> are: The object is taken ...</p> <ul> <li>from a valid <code>content</code> attribute or, if this is not present in the tag,</li> <li>(if no <code>datatype</code> attr is present in the tag:) from a valid <code>resource</code> attribute or, if this is not present in the tag,</li> <li>(if no <code>datatype</code> attr is present in the tag:) from a valid <code>href</code> attribute or, if this is not present in the tag,</li> <li>(if no <code>datatype</code> attr is present in the tag:) from a valid <code>src</code> attribute or, if this is not present in the tag,</li> <li>from the inner content of the element started by the tag.</li> </ul> <p>Slightly simplified, <code>rel</code> differs in two aspects:</p> <ul> <li>It takes its object only from a <code>resource</code> or a <code>href</code> or a <code>src</code> attribute.</li> <li>It takes its object not only from an attribute <em>of the same tag</em>, but may also take it from descendant tags. The whole mechanism is called "chaining": "This is the main difference between @property and @rel: the latter induces chaining, whereas the former, usually, does not." <a href="http://www.w3.org/TR/rdfa-syntax/#h3_s_chaining" rel="nofollow">1</a> Usually, but <code>property</code> can induce chaining if used with <code>typeof</code> (cf. <a href="http://www.w3.org/TR/rdfa-core/#chaining-with-property-and-typeof" rel="nofollow">2</a>).</li> </ul> <p><code>about</code> vs <code>resource</code>:</p> <p><code>about</code> is the attribute to indicate the <em>subject</em> of a triple. The rules for <code>resource</code> are more complicated: It may indicate a subject or an object, and chaining plays a role here, too.</p> <p>IMHO, chaining is the most complicated and confusing part of RDFa (and does not give you more than syntactic sugar). I would avoid chaining. This is possible by avoiding the attributes <code>rel</code>, <code>rev</code>, <code>resource</code> and <code>typeof</code>, which brings some further simplification at the same time. Thus, I use only the following attributes:</p> <ul> <li><code>about</code> for the <em>subject</em></li> <li><code>property</code> for the <em>predicate</em></li> <li><code>content</code> or <code>href</code> or <code>src</code> (or the inner content of the element) for the <em>object</em>, following the rules outlined above</li> <li><code>lang</code> for a language tag for object literals, e.g. <code>lang="en"</code></li> <li><code>datatype</code> for a datatype tag for object literals</li> <li><code>prefix</code> (but only once in a document), so that I can abbreviate URLs by prefixing, e.g. <code>property="dc:creator"</code></li> <li><code>vocab</code> (rarely and at the most once in a document), so that I can abbreviate URLs implicitly, e.g. <code>property="creator"</code>.</li> </ul> <p>(And I use the tag <code>&lt;base href="..."&gt;</code> to indicate the URL base value of the document.)</p> <p>This is a strict, safe, easy-to-use and easy-to-parse subset of RDFa and allows to express any triple you want.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload