Re: RDFa API - adding Namespace

On 10/11/2010 04:19 AM, Nathan wrote:
> perhaps if we ask "why not add it?", is there a good reason not to?

Yes, there are several very good reasons not to: 1) it adds another way
of creating CURIEs whose benefits are not clear 2) it requires the
creation of an object to specify a CURIE, 3) it requires the developer
to manage the CURIE separately from the RDFa API and 4) It is more
complex than necessary.

When we did the second pass of the design phase on the RDFa API, we
attempted to make sure that it was a simple as possible for those not
familiar with RDF. We wanted to make sure that people could use the API
without having deep knowledge about "Namespaces" or CURIEs. We wanted to
make sure that people didn't have to create objects just in order to
specify an IRI. In short, we ensured that only strings were used to
interface with the RDFa API.

In other words, creating an object just to create a CURIE was an
anti-pattern. We didn't want people to do this:

doSomething(foaf('name'));

Instead, we wanted this:

doSomething("foaf:name");

We believe that the second is easier to understand (it's just a string,
which is interpreted in one way - via the Context), it's more compact
and leads to more readable code.

What's wrong with this (which is supported by the current API)?

var t1 = data.createTriple(me, "rdf:type", "foaf:Person");

Why do we need to make it any more complicated than that?

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: Saving Journalism - The PaySwarm Developer API
http://digitalbazaar.com/2010/09/12/payswarm-api/

Received on Monday, 11 October 2010 12:54:45 UTC