- From: Toby Inkster <tai@g5n.co.uk>
- Date: Tue, 25 Oct 2011 16:49:45 +0100
- To: public-html-data-tf@w3.org
On Tue, 25 Oct 2011 13:59:43 +0100 Toby Inkster <tai@g5n.co.uk> wrote: > 1. all processors use the same (default) mapping for all > vocabularies I'll add that there's nothing to prevent this mapping from being non-trivial. Consider: <div itemscope itemtype="$foo"> <span itemprop="$bar">Bar</span> </div> where $foo is a full URL and $bar is a short name. A single (but complex mapping could be)... i. Find the final occurrence of '#' or '/' in $foo, and split the string $foo on that character. Call the portion before it $pfx and the portion afterwards $sfx, and the character that was split on $char. ii. If $char is '#' then the full URI for $bar is CONCAT($pfx, '#', $bar). iii. If $char is '/' and $sfx begins with a lowercase letter, then the full URI for $bar is CONCAT($foo, '#', $bar) iv. If $char is '/' and $sfx begins with an uppercase letter, then continue reducing $pfx by splitting it into ($pfx, $char, $sfx) based on its last '/' character until either $sfx does not begin with an uppercase letter, or $pfx has been reduced to a minimum prefix. The definition of a minimum prefix will vary based on URI scheme, but for HTTP and HTTPS would be "http://" or "https://" followed by an authority (i.e. hostname/IP with optional port designation). After a final $pfx has been reached, the full URI for $bar is CONCAT($pfx, '/', $bar). 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. It requires no dereferencing to do the mapping, no special knowledge of any vocabularies, and no registry system. Examples of the mapping in action: $foo = "http://schema.org/Person" $bar = "name" $result = "http://schema.org/name" $foo = "http://schema.org/Person/Employee/AcmeCorpEmployee" $bar = "name" $result = "http://schema.org/name" $foo = "http://xmlns.com/foaf/0.1/Person" $bar = "name" $result = "http://xmlns.com/foaf/0.1/name" $foo = "http://example.com/vocab#Person" $bar = "name" $result = "http://example.com/vocab#name" $foo = "http://example.com/vocab/person" $bar = "name" $result = "http://example.com/vocab/person#name" -- Toby A Inkster <mailto:mail@tobyinkster.co.uk> <http://tobyinkster.co.uk>
Received on Tuesday, 25 October 2011 15:49:05 UTC