Re: API question

On Mon, 01 Nov 2010 11:17:04 +0000
Nathan <nathan@webr3.org> wrote:

> and if we add in a simple rule saying that strings which aren't
> curies map to PlainLiterals then we can also enable:
> 
>    context.createTriple(":me", "foaf:name", "nathan" );

I assume by CURIEs in the above, you mean CURIEs-or-URIs, so full URIs
would be OK. I don't think that's a good idea though. It could result
in surprising consequences. 

Consider the following (and let's forget daylight savings yesterday):

	context.createTriple(":me", "vcard:tz", "UTC+01:00");

You may surprised to find that <UTC+01:00> is a syntactically valid
URI. It has a scheme of "UTC+01" (which is unregistered, but we
shouldn't require implementations to track which URI schemes are
registered) and a scheme-specific part of "00".

APIs should try to avoid surprises.

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

Received on Monday, 1 November 2010 14:39:17 UTC