[Mulgara-general] How to order by count, keep getting No such variable $k0 in tuples

Paul Gearon gearon at ieee.org
Fri Feb 20 20:37:38 UTC 2009


Hi Doug,

OK, I found the problem.

This happened whenever parseQuery was called on the TqlInterpreter.
However, most of the time you don't know if you'll have a "query" or a
command that will perform modifications, so parseCommand is almost
always called... and parseQuery wasn't properly tested because of
this.

The REST interface is the first system to really need this, because a
GET operation *must* not change anything. Issuing commands on the web
page (where you saw it working) sends operations in as a POST
operation. This has to go through the parseCommand method, because
those commands might be modifying commands.

Anyway, it seems to be working now, and is checked in. I'm putting
2.0.9 together very soon, and you'll find it fixed in there.

Regards,
Paul Gearon

On Thu, Feb 19, 2009 at 7:37 PM, Doug Chestnut <chestnut at apache.org> wrote:
> Hi mulgara users,
>
> I am trying make a faceted browse web interface with jquery and have
> come up with this query which gives me the type of data I need for
> facet counts (first stab at it anyway).
>
> select $Subject  count (
>  select $s from <rmi://localhost/server1#sampledata> where $s $p $Subject
> ) from <rmi://localhost/server1#sampledata> where $Subject $Predicate
> <http://simile.mit.edu/2006/01/ontologies/mods3#Topic> order by $k0
> desc limit 10;
>
> This query works great from the tutorial web form, but returns the
> following error when I try to use the tql http service (from the
> second try on):
>
> Query failed: No such variable $k0 in tuples [$Subject, $k1] (class
> org.mulgara.resolver.AppendAggregateTuples)
>
> This appears to be some sort of session problem ($kn keeps getting
> incremented), as if I try in a different browser it works, again only
> on the first try.
>
> I am using the query (above query url encoded) and the format (json)
> parameters with the tql path.
>
> Sorry if I have missed this in the docs or the mailing list, any help
> is much appreciated.
>
> --Doug
> _______________________________________________
> Mulgara-general mailing list
> Mulgara-general at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-general
>



More information about the Mulgara-general mailing list