W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > January 2011

Re: PROPOSAL to close ISSUE-61: Does the RDFa API need a vocabulary helper

From: Ivan Herman <ivan@w3.org>
Date: Thu, 13 Jan 2011 12:21:20 +0100
Cc: Manu Sporny <msporny@digitalbazaar.com>, RDFa WG <public-rdfa-wg@w3.org>, Tim Berners-Lee <timbl@w3.org>
Message-Id: <E254536F-0A98-4996-B8B0-887891EED862@w3.org>
To: nathan@webr3.org
Works for me...

Ivan

On Jan 13, 2011, at 12:09 , Nathan wrote:

> Ivan Herman wrote:
>> On Jan 13, 2011, at 11:11 , Nathan wrote:
>>> Ivan Herman wrote:
>>>>> That said, in a previous revision of the api, there was another (disputed iirc) approach, which was to change the return type of Profile::setPrefix from void to a "PrefixResolver", so you'd:
>>>>> 
>>>>> foaf = rdf.setPrefix('foaf', 'http://xmlns.com/foaf/0.1/');
>>>>> 
>>>>> then you could do:
>>>>> 
>>>>> foaf('name')
>>>>> rdf.resolve('foaf:name')
>>>>> rdf.prefixes.foaf + name
>>>>> ...
>>>> This is actually very close to what I am used to, which is
>>>> foaf = Namespace('http://xmlns.com/foaf/0.1/')
>>> indeed, it's a combination of both approaches :)
>>> 
>>>> although, for my instinct, the first argument ('foaf') is actually superfluous. But I can live with that...
>>> The first argument enables the rdf.resolve('foaf:name') and rdf.prefixes.foaf functionality to still be used, giving users a choice in how they prefer to resolve URIs - if the dictionary prefixes.foaf and curie resolve() methods were removed from the API all together though, then yes it would be superfluous.
>> Sorry, I was not clear. Of course that argument is necessary _unless_ the only way I want to use it is via foaf = rdf.setPrefix('foaf', 'http://xmlns.com/foaf/0.1/');
>> Which begs the question, which may be an overcomplication: what about saying
>> foaf = rdf.setPrefix('http://xmlns.com/foaf/0.1/', 'foaf');
>> ie, inverting the order of arguments and make the second optional? If not given, the system can set some sort of an internal name which is probably opaque to the user but, for example, I may not care about it because I would only use the 'foaf' return value...
> 
> I'd have to suggest that the method would no longer be a setPrefix method and we'd probably be looking for an additional method like:
> 
>  PrefixResolver createPrefixResolver(DOMString iri)
> 
> probably in addition to the aforementioned, since swapping the return of setPrefix to PrefixResolver from void is essentially "free".
> 
> Best,
> 
> Nathan
> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf







Received on Thursday, 13 January 2011 11:22:06 GMT

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