I'm using TypeDB 2.2.0 and I'm getting the following error in Workbase with a query that used to work in previous versions. How do I do "not equal" between two concepts? (see query below)
Error: 13 INTERNAL: [QRY16] Invalid Query Pattern: The pattern '{{ $t2 != $t; $t2 isa transaction;
$_0 = "Peter"; $_0 isa name;
$t isa transaction;
$v has $_0; $v isa person;
$1 ($t, $v);
$2 ($t, $pu);
$3 ($pu, $t2); }}' can never be satisfied the current schema, specifically due to '[{ $t2 != $t; $t2 isa transaction;
$_0 = "Peter"; $_0 isa name;
$t isa transaction;
$v has $_0; $v isa person;
$1 ($t, $v);
$2 ($t, $pu);
$3 ($pu, $t2); }]'. Please check server logs for the stack trace.
match
$v isa person, has name "Peter";
$t isa transaction;
$1 ($t, $v);
$2 ($t, $pu);
$3 ($pu, $t2);
$t2 isa transaction;
$t2 != $t;
offset 0; limit 10;
You want not { $t2 is $t; };
$a is $b
declares that $a
and $b
are exactly the same concept, so not { $t2 is $t; };
says that they are not the same concept. Both forms work for comparing variables that could be entities, relations or attributes.
There are also value comparators that are only used to compare two variables that denote attributes and compare them by value only:
$a = $b
$a != $b
$a > $b
$a < $b
$a >= $b
$a <= $b