90 likes | 104 Views
Learn about embedding data in HTML using microformat examples such as hCard and geo, RDFa with DublinCore, and Microdata with schema.org. Understand when to use each syntax for best practices and SEO optimization.
E N D
HTML Data Guide W3C Interest Group Note 08 March 2012 OC Working Group – 09.07.2012 by Alex Oberhauser
Microformat – Example (hCard and geo) <ul class="vcard"> <li class="fn">Joe Doe</li> <li class="org">The Example Company</li> <li class="tel">604-555-1234</li> <li><a class="url"ref="http://example.com/">http://example.com/</a></li> </ul> <span class="geo"> <span class="latitude">52.48</span> <span class="longitude">-1.89</span> </span>
RDFa – Example (DublinCore) <div xmlns:dc="http://purl.org/dc/elements/1.1/" about="http://www.example.com/books/wikinomics"> <span property="dc:title">Wikinomics</span> <span property="dc:creator">Don Tapscott</span> <span property="dc:date">2006-10-01</span> </div>
Microdata – Example (schema.org) <div itemscopeitemtype="http://schema.org/Person"> <span itemprop="name">Jane Doe</span> <img src="janedoe.jpg" itemprop="image" /> <span itemprop="jobTitle">Professor</span> <div itemprop="address" itemscopeitemtype="http://schema.org/PostalAddress"> <span itemprop="streetAddress">20341 Whitworth Institute</span> <span itemprop="addressLocality">Seattle</span> <span itemprop="addressRegion">WA</span> <span itemprop="postalCode">98052</span> </div>
What do use? What is recommended? • Possible to use all three syntaxes on one page (for one item) • For SEO Microdatais recommended • For easy extraction to RDF use RDFa • Microformatand Microdata can be mapped to the same JSON data model (see http://dev.w3.org/html5/md/Overview.html#json)
Personal Recommendation • Microdatafor search engine optimization (relative easy to use) • If RDF is needed provide a (REST) API • Justification: RDFa is not easier than plain RDF, but RDF/(XML/N3/N-Triple) is easier parsable.