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

'get' method in DataStore?

From: Ivan Herman <ivan@w3.org>
Date: Fri, 11 Jun 2010 14:45:06 +0200
Message-Id: <0E60A540-29FD-4EB9-86DC-D0AACD82D9DA@w3.org>
To: Manu Sporny <msporny@digitalbazaar.com>, Benjamin Adrian <benjamin.adrian@dfki.de>
I wonder whether this should not be a new issue.

Looking at the DataStore interface, it has a 'get' method, saying 

"Returns the RDFTriple object at the given index in the list."

I wonder whether this is wise and whether it should be defined at all. Indeed, this reflects a particular implementation approach for the store, namely that all triples are stored in some sort of an internal array. This is not necessarily true (say the triples are stored in a background database where triples are keyed according to their, say, subjects). It also suggests (I know, it does not say it!) that two consecutive runs would place the triple onto the same index which is not necessarily true either.

I know I was already unhappy with the way the filter method is define, because it returns another datastore which I find an overkill. I do not know what is the correct WebIDL (or indeed Javascript) approach, but what I would expect is that filter returns some sort of an iteratable. In python terms, what you would want is

for (s,p,o,origin) in store.filter(....) :

So, what I would propose is:

- get rid of the 'get' method
- define filter as an iteratable.



P.S. yes, as you can deduce it: I am looking at how this interface can be defined on top an existing RDF environments, RDFLib in this case...

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 Friday, 11 June 2010 14:28:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:19:47 UTC