W3C home > Mailing lists > Public > public-html-data-tf@w3.org > October 2011

Single heuristic mapping for property URIs

From: Toby Inkster <tai@g5n.co.uk>
Date: Wed, 26 Oct 2011 11:53:30 +0100
To: public-html-data-tf@w3.org
Message-ID: <20111026115330.1769c0f9@miranda.g5n.co.uk>
On Tue, 25 Oct 2011 16:49:45 +0100
Toby Inkster <tai@g5n.co.uk> wrote:

> This single (albeit complex) mapping seems to cover
> http://schema.org/, http://microformats.org/profile/hcard,
> http://n.whatwg.org/work, Google Rich Snippets, and most other common
> RDF vocabs including FOAF, SIOC, SKOS, OWL, etc.

I've now implemented this mapping in my Microdata parser. Without
requiring any special knowledge of different Microdata and RDF
vocabularies, or any registry, it "just works". It generates sensible
property URIs for all of the following examples:

	<div itemscope itemtype="http://schema.org/Person">
	  <span itemprop="name">Alice</span>
	  <!-- result: http://schema.org/name -->
	</div>

	<div itemscope
	  itemtype="http://schema.org/Person/Employee/AcmeEmployee"> 
	  <span itemprop="name">Alice</span>
	  <!-- result: http://schema.org/name -->
	</div>

	<div itemscope itemtype="http://xmlns.com/foaf/0.1/Person">
	  <span itemprop="name">Alice</span>
	  <!-- result: http://xmlns.com/foaf/0.1/name -->
	</div>

	<div itemscope itemtype="http://microformats.org/profile/hcard">
	  <span itemprop="fn">Alice</span>
	  <!-- result: http://microformats.org/profile/hcard#fn -->
	</div>

	<div itemscope itemtype="http://example.com/2011/vocab#Person">
	  <span itemprop="name">Alice</span>
	  <!-- result: http://example.com/2011/vocab#name -->
	</div>

Source code for a Perl module implementing this is here:

https://metacpan.org/source/TOBYINK/HTML-HTML5-Microdata-Parser-0.100/lib/HTML/HTML5/Microdata/Strategy/Heuristic.pm

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>
Received on Wednesday, 26 October 2011 10:52:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 26 October 2011 10:52:38 GMT