Re: RDFa DOM API Document update

On Sun, 16 May 2010 21:50:18 -0400
Manu Sporny <msporny@digitalbazaar.com> wrote:

> http://www.w3.org/2010/02/rdfa/sources/rdfa-dom-api/Overview-src.html

How exactly do these getElementsByX methods work? Although RDFa defines
how to generate an RDF graph from a DOM tree, it doesn't offer a clear
and unambiguous mapping back from the RDF graph to DOM nodes.

For example:

	<a about="#me" typeof="foaf:Person"
           rel="foaf:homepage" href="http://example.com/">
	  <span rel="rdf:type" resource="[foaf:Document]"
	     property="dc:title">My Homepage</span>
	</a>
	<i about="#me" property="foaf:name">Joe</i>

What element would be returned in the case of
getElementsByType('foaf:Person')? Presumably the <a> element because it
set the subject for the {?thing rdf:type foaf:Person} triple.

But what about the getElementsByType('foaf:Document')? If we apply the
same reasoning, it would be the <a> element too.

Would the <i> element be selected by getElementsByType('foaf:Person')?
After all, we know #me is a foaf:Person.

As much as I think these getElementsByX methods would be useful, I
don't think they can be implemented in an especially obvious,
consistent and predictable way.

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>

Received on Monday, 17 May 2010 07:19:36 UTC