[redland-dev] Possible search problem using the mysql storage
Dave Beckett
dave.beckett at bristol.ac.uk
Wed Apr 6 11:16:31 BST 2005
On Fri, 25 Mar 2005 17:44:55 +0000, Daniel Larsson <daniel.larsson at servicefactory.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> While playing around with some RDF models, I recently tried out the
> mysql storage instead of the memory storage I had used previously. Now
> I've started to get exceptions in my 'get_targets' searches (using the
> Python bindings) due to the iterator being returned is 0 (NULL). This
> occurs when there are no matches for the query, but using the memory
> storage, I get an "empty" iterator back.
>
> Using model.find_statements(Statement(X, Y, None)) works as expected though.
>
> I'm running redland 1.0.0 with redland-bindings 1.0.0.2 (FreeBSD).
>
> I can try look more closely at the problem, bug figured I'd post a note
> here first in case this is known already.
I see what you mean, this is an inconsistency which should be fixed.
I'll switch things so that you always get an iterator back (when
there is no error, which will still return NULL) and always get an
empty iterator when there are no results.
The same should probably also apply to stream as they are pretty much
the same forward-moving cursor but over different objects.
Iterators are a mostly internal part of redland, mapping to binding
language concepts sequences, arrays or whatever they are called but
it looks like it isn't entirely hidden from view until I fix this.
If it also applies to streams it'll be more visible at the API but I
think the error / empty stream distinction needs to be made.
Dave
More information about the redland-dev
mailing list