'get' method in DataStore?

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(....) :
  blablabla

So, what I would propose is:

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

Thoughts?

Ivan


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