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: Mon, 3 Jan 2011 06:42:54 +0100
Cc: RDFa WG <public-rdfa-wg@w3.org>, Tim Berners-Lee <timbl@w3.org>
Message-Id: <3E12DD91-7E72-42BC-9DDA-D001CAE2EA7F@w3.org>
To: Manu Sporny <msporny@digitalbazaar.com>

On Jan 3, 2011, at 05:10 , Manu Sporny wrote:

> If there are no objections to this proposal in 7 days, we will close
> ISSUE-61: Does the RDFa API need a vocabulary helper.
> http://www.w3.org/2010/02/rdfa/track/issues/61
> This issue concerns the availability of a mechanism to help developers
> resolve CURIEs. There were two mechanisms that were requested, the first
> would allow a developer to create a CURIE resolver object and use it
> like so:
> var foaf = graph.ns("http://xmlns.com/foaf/0.1/");
> var foafname = foaf("name");
> // at this point, foafname == "http://xmlns.com/foaf/0.1/name"
> The second mechanism would allow a developer to resolve a CURIE using a
> simple method call:
> document.data.setMapping("foaf", "http://xmlns.com/foaf/0.1/");
> var foafname = document.data.resolve("foaf:name");
> // at this point, foafname == "http://xmlns.com/foaf/0.1/name"


> For example, the following is possible when using the RDF API:
> var rdf = document.data.rdf;
> rdf.prefixes.foaf = "http://xmlns.com/foaf/0.1/";
> var foafname = rdf.resolve("foaf:name");
> // at this point, foafname == "http://xmlns.com/foaf/0.1/name"
> Given the code above, the following is also possible using the RDF API:
> var short = rdf.prefixes.shrink(foafname);
> // at this point short == "foaf:name"

The direct counterpart of the original issue/proposal would be to have a definition of prefixes so that I could also say

var foafname = rdf.prefixes.foaf('name')

Ie, once I have defined the prefix I would not have to repeat it verbatim because it becomes a function of its own right. 

> The above demonstrates the low-level CURIE resolution interfaces. The
> following is possible when using the RDFa API (high-level CURIE
> resolution interfaces):
> document.data.setMapping("foaf", "http://xmlns.com/foaf/0.1/");
> var people = document.getItemsByType("foaf:Person");
> The RDF API and RDFa API may be used together, for example:
> document.data.rdf.prefixes.foaf = "http://xmlns.com/foaf/0.1/";
> var people = document.getItemsByType("foaf:Person");
> The RDFa WG has found that having a number of mechanisms to shrink and
> expand CURIEs is important and should be supported. Additionally, the
> RDFa WG has found that being able to use CURIEs directly in method calls
> in both the RDF API and RDFa API is vital for ease of use.
> However, the RDFa WG has also found that having two mechanisms for
> resolving CURIEs may be confusing to developers and does not provide
> enough benefit to warrant the addition of a CURIEResolver interface into
> the RDF API or RDFa API. That is to say, foaf("name") will not be
> supported as a programming pattern - rather "foaf:name" will be
> supported when used with the RDF API and RDFa API methods.

I must admit I am not convinced about the 'confusion' argument. I understand that, mainly for RDFa developers having only a method that always uses the full CURIE (ie, 'foaf:name') is more understandable. But, for RDF developers, I would find a coding pattern of the form foaf('name') much more intuitive.

> If a
> developer desires a coding pattern like foaf("name"), a
> CURIEResolver-like mechanism can be created fairly easily in user-space
> code (as demonstrated above).

I may have missed it, but that is not really part of what you wrote. I understand one can do something like

var foafresolve = function(name) { .....resolve('foaf'+name) }

and use foafresolve('name') beyond that point, but it is a bit convoluted for me to do that...

I wonder whether it is possible to change the specs slightly to allow for both mechanisms.


> The proposal is to keep the CURIE resolution additions described above
> and specified in the RDF API and RDFa API specifications. A
> CURIEResolver interface will not be supported to ensure a consistent
> mechanism for resolving CURIEs across the RDF API and RDFa API.
> Please comment in 7 days from this post if you object to this proposal.
> If there are no objections within 7 days, ISSUE-61 will be closed.
> -- manu
> -- 
> Manu Sporny (skype: msporny, twitter: manusporny)
> President/CEO - Digital Bazaar, Inc.
> blog: Linked Data in JSON
> http://digitalbazaar.com/2010/10/30/json-ld/

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 Monday, 3 January 2011 05:38:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:05:23 UTC