190 likes | 199 Views
Learn about RDFa and how it allows for embedding RDF expressions in existing markup languages like XHTML, enabling extraction of fine-grained structured details from web pages.
E N D
An Introduction to RDFa QingXia Liu
Contents • What is RDFa? • Why RDFa? • Versions of RDFa • An Example
What is RDFa? • Resource Description Framework in attributes • First proposed by Mark Birbeck in 2004 • A W3C Recommendation
What is RDFa? • The gap between what programs and humans understand: What browsers see what humans see
What is RDFa? • Aim: to allow a single RDF graph to be carried in various types of document markup.
What is RDFa? • Essence: it provides a set of markup attributes to augment the visual information on the Web with machine-readable hints. • These attributes are: about, src, rel, rev, href, resource, property, content, datatype, typeof…
What is RDFa? HTML : <body> ... <div > <h2 >The trouble with Bob</h2> <p>Date: <span >2011-09-10</span></p> <h3 >Alice</h3> ... </div> ... <div> <h2 >Jo's Barbecue</h2> <p>Date: <span >2011-09-14</span></p> <h3 >Eve</h3> ... </div> ... </body> HTML + RDFa 1.1: <body vocab="http://purl.org/dc/terms/"> ... <div resource="/alice/posts/trouble_with_bob"> <h2 property="title">The trouble with Bob</h2> <p>Date: <span property="created">2011-09-10</span></p> <h3 property="creator">Alice</h3> ... </div> ... <div resource="/alice/posts/jos_barbecue"> <h2 property="title">Jo's Barbecue</h2> <p>Date: <span property="created">2011-09-14</span></p> <h3 property="creator">Eve</h3> ... </div> ... </body> mark up human-readable data with machine-readable indicators
What is RDFa? • Example: <body vocab="http://purl.org/dc/terms/"> <div resource="/alice/posts/trouble_with_bob"> <h2 property="title">The trouble with Bob</h2> <p>Date: <span property="created">2011-09-10</span></p> <h3 property="creator">Alice</h3> </div> <div resource="/alice/posts/jos_barbecue"> <h2 property="title">Jo's Barbecue</h2> <p>Date: <span property="created">2011-09-14</span></p> <h3 property="creator">Eve</h3> </div> </body>
Why RDFa? • Embedding RDFsubject-predicate-object expressions in existing markup languages such as XHTML. • Enables the extraction of RDF model triples by compliant user agents • Apps: • To provide richer search results by extracting fine-grained structured details from the Web pages they crawl.
Versions • RDFa 1.0 • was specified only for XHTML • RDFa 1.1 • is the newer version specified for both XHTML and HTML5. • also works for any XML-based languages like SVG
Changes • Differences between RDFa 1.1 and RDFa1.0: • The removal of the specific rules for XHTML - these are now defined in XHTML + RDFa • Dayatype Expansion : RDFa attributes can contain Terms, CURIES, or Absolute IRIs. • Host languages are permitted to define collections of default terms, default prefix mappings, and a default vocabulary • The ability to define a default vocabulary to use for Terms that are undefined (via @vocab).. • Terms are required to be compared in a case-insensitive manner. • A richer behavior of the @property attribute, that can replace, in many cases the @rel attribute. • A slightly different handling of @typeof, making it better adapted to practical usage.
Current Status • Standards: 2012-06-07 • RDFa Core 1.1 • XHTML+RDFa 1.1 • RDFa Lite 1.1 • Group Notes: before 2012-07-05 RDFa API , RDF Interfaces, RDFa 1.1 Primer, HTML Data Guide, XML in HTML Meeting Report • Drafts: 2012-03-29 HTML+RDFa1.1
Example <div vocab="http://purl.org/dc/terms/"> <div resource="/alice/posts/trouble_with_bob"> <h2 property="title">The trouble with Bob</h2> ... <h3 vocab="http://xmlns.com/foaf/0.1/" property="http://purl.org/dc/terms/creator" typeof="Person"> <span property="name">Alice Birpemswick</span>, Email: <a rel="mbox" href="mailto:alice@example.com">alice@example.com</a>, Phone: <a rel="phone" href="tel:+1-617-555-7332">+1 617.555.7332</a> </h3> ... </div> ... </div>
Example <div vocab="http://purl.org/dc/terms/"> <div resource="/alice/posts/trouble_with_bob"> <h2 property="title">The trouble with Bob</h2> ... <h3 vocab="http://xmlns.com/foaf/0.1/" property="http://purl.org/dc/terms/creator" typeof="Person"> <span property="name">Alice Birpemswick</span>, Email: <a rel="mbox" href="mailto:alice@example.com">alice@example.com</a>, Phone: <a rel="phone" href="tel:+1-617-555-7332">+1 617.555.7332</a> </h3> ... </div> ... </div>
Example <div vocab="http://purl.org/dc/terms/"> <div resource="/alice/posts/trouble_with_bob"> <h2 property="title">The trouble with Bob</h2> <h3 property="creator" resource="#me">Alice</h3> ... </div> </div> ... • <div class="sidebar" vocab="http://xmlns.com/foaf/0.1/" resource="#me" typeof="Person"> • <p> • <span property="name">Alice Birpemswick</span>, • Email: <a property="mbox" href="mailto:alice@example.com">alice@example.com</a>, • Phone: <a property="phone" href="tel:+1-617-555-7332">+1 617.555.7332</a> • </p> • ... • </div>
References • The W3C RDFa 1.1 Primer • The W3C RDFa 1.1 Core • The Wikipedia entry on RDFa