Re: @title

On 17 Apr 2008, at 09:31, Dan Brickley wrote:

 > And imagemaps too I hope -
 > http://www.w3.org/QA/2008/01/rdfa_and_html_imagemap.html
 >
 > If anyone with an RDFa parser cares to experimentally extend it so we
 > can get imagemap path data out as triples, I'd be very happy...

I'd be interested in implementing this.

As an example, to get this information out:

	<rdf:RDF
		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
		xmlns:foaf="http://xmlns.com/foaf/0.1/"
		xmlns:imreg="http://www.w3.org/2004/02/image-regions#">
	
		<foaf:Person rdf:about="#me">
			<foaf:name>Toby Inkster</foaf:name>
		</foaf:Person>
	
		<foaf:Image rdf:about="http://example.com/mypic">
			<imreg:region>
				<imreg:Rectangle rdf:nodeID="#reg">
					<imreg:boundingBox>42,17,304,231</imreg:boundingBox>
					<imreg:regionDepicts rdf:resource="#me" />
				</imreg:Rectangle>
			</imreg:region>
		</foaf:Image>
	
	</rdf:RDF>

... from something like this:

	<div about="#me" class="figure">
		<img src="mypic" alt="Photo of: " usemap="#themap" />
		<span class="legend" property="foaf:name">Toby Inkster</span>
	</div>
	<map name="themap" id="themap">
		<area shape="rect" coords="42,17,304,231" href="#me"
		rel="imreg:regionDepicts" />
	</map>

The only extra rules required would be:

	1. Any <area> elements have an implicit @typeof attribute of
	   imreg:Rectangle, imreg:Polygon or imreg:Circle depending
	   on the contents of @shape.

	2. For any <img> elements with a non-empty @usemap, an implicit
	   imreg:region relationship exists between the image URI and
	   each <area> element within the map.

A slight problem though is that it increases parsing complexity
significantly, owing to the fact that the <map> element may be
anywhere in the page, so may be encountered either before or
after the <img> element.

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

Received on Friday, 18 April 2008 14:06:43 UTC