W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > October 2010

Re: RDFa API - adding Namespace

From: Toby Inkster <tai@g5n.co.uk>
Date: Sun, 10 Oct 2010 11:06:53 +0100
To: nathan@webr3.org
Cc: Tim Berners-Lee <timbl@w3.org>, Ivan Herman <ivan@w3.org>, RDFA Working Group <public-rdfa-wg@w3.org>
Message-ID: <20101010110653.14085e7a@miranda.g5n.co.uk>
On Sat, 09 Oct 2010 18:44:16 +0100
Nathan <nathan@webr3.org> wrote:

> foaf('name');

This is probably something that doesn't need to be done as part of the
API itself. Individual scripters or library/toolkit authors can very
easily implement something like that on top of the API.

	function prefixMapper (p)
	{
		return function (s) { return p+s; };
	}

	var foaf = prefixMapper('http://xmlns.com/foaf/0.1/');
	var dc   = prefixMapper('http://purl.org/dc/terms/');

	window.alert(foaf('name'));
	window.alert(dc('title'));

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>
Received on Sunday, 10 October 2010 10:07:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:08 GMT