[Mulgara-dev] More TQL questions - performance issues with MINUS

Paul Gearon gearon at ieee.org
Tue Jul 28 18:11:08 UTC 2009


On Tue, Jul 28, 2009 at 12:45 PM, Dragisa
Krsmanovic<dkrsmanovic at plos.org> wrote:
> On Tue, 2009-07-28 at 12:32 -0500, Paul Gearon wrote:
>> > Hm. This query gives me org.mulgara.query.TuplesException: Unable to
>> > subtract: no common variables. Tried putting $p in column list too.
>>
>> This must be a regression bug that I've missed. I'll look into it this
>> in the morning.
>>
>> Maybe it put the minus on the last constraint instead of the whole
>> expression? Try changing the query to:
>>  select $id $accstate $email
>>  from <local:///topazproject#profiles>
>>  where $id <rdf:type> <http://xmlns.com/foaf/0.1/OnlineAccount> in
>>  <local:///topazproject#users>
>>    and $id <topaz:accountState> $accstate in
>> <local:///topazproject#users>
>>    and $p <http://xmlns.com/foaf/0.1/holdsAccount> $id
>>    and $p <http://xmlns.com/foaf/0.1/mbox> $email
>>    minus (
>>      $p <topaz:displayName> $username
>>      and $p <http://xmlns.com/foaf/0.1/givenname> $firstname
>>      and $p <http://xmlns.com/foaf/0.1/surname> $lastname
>>    );
>>
>> If that works, then I know where my bug is.
>>
>
> This query doesn't give me the error but runs "forever".

OK, do that gives me one answer. But I'm confused about the length of
time it takes.

What about if you try breaking it up? Try the following:

  select $id $accstate $email
  from <local:///topazproject#profiles>
  where $id <rdf:type> <http://xmlns.com/foaf/0.1/OnlineAccount> in
  <local:///topazproject#users>
    and $id <topaz:accountState> $accstate in
 <local:///topazproject#users>
    and $p <http://xmlns.com/foaf/0.1/holdsAccount> $id
    and $p <http://xmlns.com/foaf/0.1/mbox> $email
    minus (
      $p <topaz:displayName> $username
     ) minus (
      $p <http://xmlns.com/foaf/0.1/givenname> $firstname
     ) minus (
      $p <http://xmlns.com/foaf/0.1/surname> $lastname
    );

I'm not advocating that you do this in production, but I'm interested
in the behavior.

Regards,
Paul



More information about the Mulgara-dev mailing list