HTML and CSS Reference
In-Depth Information
rel , rev
Relationship with another resource
href , resource
The partner resource
property
A property for the content of an element
content
Element content override when using the property attribute (optional)
datatype
The datatype of text specified for use with the property attribute (optional)
typeof
The RDF type(s) of the subject (optional)
RDFa makes it possible to arbitrarily mix multiple independently developed vocabularies. It can be parsed
without analyzing the specific vocabularies being applied. This is one of the most advanced technologies to provide
different types of machine-readable structured data in the markup.
Since the “a” in RDFa stands for attributes whose styles are provided most commonly in Cascading Style Sheets, it
is straightforward to use CSS selectors to style the code [141]. For example, if the name of the creator and the topic title
of the previous example appear throughout the site, all instances can be styled using universal selectors (Listing 7-65).
Listing 7-65. Styling RDFa
* [property="dc:creator"] {
color: #2a56d3;
font-style:italic;
}
* [property="dc:title"] {
font-size: 2em;
font-family: Georgia, serif;
}
The latest news on RDFa can be tracked on the web site of the RDFa Working Group of W3C [142].
As an example, let's describe a person with RDFa notation using the FOAF vocabulary! First we need to declare
the FOAF namespace (either in the document head or on the body element). The about attribute of RDFa can be used
to express the subject, while the RDFa attribute property sets the predicate (Listing 7-66).
Listing 7-66. An RDFa Annotation Using FOAF
<body xmlns:foaf=" http://xlmns.com/foaf/0.1/ ">
<p about="#smith" property="foaf:name" > John Smith </p>
</body>
The content of the p element is both a human- and machine-readable text that will be rendered on the web page.
 
Search WWH ::




Custom Search