Re: Single heuristic mapping for property URIs

This depends on authors implicitly following a particular naming convention
within their vocabularies. However, the Microdata spec is clear that the
itemtype URL is an opaque string and doesn't need to follow any
pattern. This means that someone could potentially create a Foo vocabulary
that has a Person type and a Book type.

They could choose to have a global title property:

http://foo.org/title


Or they could choose to have different title properties for the Person and
the Book... this is totally OK.

http://foo.org/Person/title
http://foo.org/Book/title


Or they could have something like this:

http://vocab.org/FOO/Person
http://vocab.org/FOO/title


Based on the algorithm you described yesterday, property generation would
fail for the second two if I'm not mistaken.

In addition, many content authors will probably get the case wrong, even for
vocabularies like Schema.org. If you look at the Rich Snippets testing tool,
it is clear they don't care about case because they change the itemtype to
lowercase when they display. This could very well lead authors to believe
that case is not important and thus lead to many authors using something
like http://schema.org/person for itemtypes.

I don't think we can create a reliable URI generation method by using case,
or any other character attributes.

-Lin

On Wed, Oct 26, 2011 at 11:53 AM, Toby Inkster <tai@g5n.co.uk> wrote:

> 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>
>
>
>


-- 
Lin Clark
DERI, NUI Galway <http://www.deri.ie/>

lin-clark.com
twitter.com/linclark

Received on Wednesday, 26 October 2011 11:11:39 UTC