question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.1-rc3 - Bug?: <>/= don't work properly with @class

See original GitHub issue

Continuing from relevant issue #4279 : Those doesn’t give any results: traverse outV() from (traverse inE('FactContains') from #12:15) while @class = 'FactGeneral' limit 2000 (In Browse mode: 0 results)

traverse outV() from (traverse inE('FactContains') from #12:15) while @class = 'FactPersonal' limit 2000 (In Browse mode: 0 results)

while this gives:

traverse outV() from (traverse inE('FactContains') from #12:15) while @class <> 'FactPersonal' limit 2000 (In Browse mode: 58 results - duplicated)

image

and this gives:

traverse outV() from (traverse inE('FactContains') from #12:15) while @class <> 'FactGeneral' limit 2000 (In Browse mode: 40 results - duplicated)

image

I thought Entity shouldn’t have been returned in those two cases right?

Another situation select expand(outV()) from (select expand(inE('FactContains')) from #12:15) where @class <> 'FactPersonal' limit 2000

select expand(outV()) from (select expand(inE('FactContains')) from #12:15) where @class <> 'FactGeneral' limit 2000

returning the same number of rows: 32(where this came from?) all FactGenral in both cases

I tried with = returning no results as with traverse…

FactGeneral (total in my db 53) and FactPersonal (total in my db 7) are subclasses of Fact (total in my db 60)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
santo-itcommented, Mar 1, 2017

Hi,

I made some tests with 2.2.17 - these are some results:

  1. SQL to recreate the original graph:
CREATE CLASS Fact EXTENDS V;
CREATE PROPERTY Fact.Id LONG;
 
CREATE CLASS FactGeneral EXTENDS V, Fact;
CREATE INDEX FactGeneral.Id ON FactGeneral(Id) UNIQUE;

CREATE CLASS FactPersonal EXTENDS V, Fact;
CREATE INDEX FactPersonal.Id ON FactPersonal(Id) UNIQUE;

CREATE CLASS Entity EXTENDS V;
CREATE PROPERTY Entity.Id LONG;
CREATE INDEX Entity.Id ON Entity(Id) UNIQUE;

INSERT INTO Entity SET Id = 1;

INSERT INTO FactGeneral SET Id = 1;
INSERT INTO FactGeneral SET Id = 2;
INSERT INTO FactGeneral SET Id = 3;
INSERT INTO FactGeneral SET Id = 4;
INSERT INTO FactGeneral SET Id = 5;
INSERT INTO FactGeneral SET Id = 6;
INSERT INTO FactGeneral SET Id = 7;
INSERT INTO FactGeneral SET Id = 8;
INSERT INTO FactGeneral SET Id = 9;
INSERT INTO FactGeneral SET Id = 10;
INSERT INTO FactGeneral SET Id = 11;
INSERT INTO FactGeneral SET Id = 12;
INSERT INTO FactGeneral SET Id = 13;
INSERT INTO FactGeneral SET Id = 14;
INSERT INTO FactGeneral SET Id = 15;
INSERT INTO FactGeneral SET Id = 16;
INSERT INTO FactGeneral SET Id = 17;
INSERT INTO FactGeneral SET Id = 18;
INSERT INTO FactGeneral SET Id = 19;
INSERT INTO FactGeneral SET Id = 20;
INSERT INTO FactGeneral SET Id = 21;
INSERT INTO FactGeneral SET Id = 22;
INSERT INTO FactGeneral SET Id = 23;
INSERT INTO FactGeneral SET Id = 24;
INSERT INTO FactGeneral SET Id = 25;
INSERT INTO FactGeneral SET Id = 26;
INSERT INTO FactGeneral SET Id = 27;
INSERT INTO FactGeneral SET Id = 28;
INSERT INTO FactGeneral SET Id = 29;
INSERT INTO FactGeneral SET Id = 30;
INSERT INTO FactGeneral SET Id = 31;
INSERT INTO FactGeneral SET Id = 32;
INSERT INTO FactGeneral SET Id = 33;
INSERT INTO FactGeneral SET Id = 34;
INSERT INTO FactGeneral SET Id = 35;
INSERT INTO FactGeneral SET Id = 36;
INSERT INTO FactGeneral SET Id = 37;
INSERT INTO FactGeneral SET Id = 38;
INSERT INTO FactGeneral SET Id = 39;
INSERT INTO FactGeneral SET Id = 40;
INSERT INTO FactGeneral SET Id = 41;
INSERT INTO FactGeneral SET Id = 42;
INSERT INTO FactGeneral SET Id = 43;
INSERT INTO FactGeneral SET Id = 44;
INSERT INTO FactGeneral SET Id = 45;
INSERT INTO FactGeneral SET Id = 46;
INSERT INTO FactGeneral SET Id = 47;
INSERT INTO FactGeneral SET Id = 48;
INSERT INTO FactGeneral SET Id = 49;
INSERT INTO FactGeneral SET Id = 50;
INSERT INTO FactGeneral SET Id = 51;
INSERT INTO FactGeneral SET Id = 52;
INSERT INTO FactGeneral SET Id = 53;

INSERT INTO FactPersonal SET Id = 1;
INSERT INTO FactPersonal SET Id = 2;
INSERT INTO FactPersonal SET Id = 3;
INSERT INTO FactPersonal SET Id = 4;
INSERT INTO FactPersonal SET Id = 5;
INSERT INTO FactPersonal SET Id = 6;
INSERT INTO FactPersonal SET Id = 7;

CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=1) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=2) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=3) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=4) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=5) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=6) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=7) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=8) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=9) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=10) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=11) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=12) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=13) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=14) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=15) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=16) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=17) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=18) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=19) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=20) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=21) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=22) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=23) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=24) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=25) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=26) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=27) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=28) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=29) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=30) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=31) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=32) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=33) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=34) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=35) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=36) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=37) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=38) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=39) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=40) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=41) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=42) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=43) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=44) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=45) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=46) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=47) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=48) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=49) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=50) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=51) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=52) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactGeneral WHERE Id=53) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactPersonal WHERE Id=1) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactPersonal WHERE Id=2) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactPersonal WHERE Id=3) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactPersonal WHERE Id=4) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactPersonal WHERE Id=5) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactPersonal WHERE Id=6) TO (SELECT FROM Entity WHERE Id=1);
CREATE EDGE FactContains FROM (SELECT FROM FactPersonal WHERE Id=7) TO (SELECT FROM Entity WHERE Id=1);

1.1 possible additional part in the graph

CREATE CLASS OtherClass EXTENDS V;
CREATE PROPERTY OtherClass.Id LONG;
CREATE INDEX OtherClass.Id ON OtherClass(Id) UNIQUE;

INSERT INTO OtherClass SET Id = 1;
CREATE EDGE OtherEdge FROM (SELECT FROM OtherClass WHERE Id=1) TO (SELECT FROM FactPersonal WHERE Id=1);
  1. Queries

2.1 Counts, using match:

a. 53, ok:

select count(*) from (match {Class: FactGeneral, as: factgeneral}-FactContains->{class: Entity, as: entity, where:(Id=1)} return factgeneral)

b. 7, ok:

select count(*) from (match {Class: FactPersonal, as: factpersonal}-FactContains->{class: Entity, as: entity, where:(Id=1)} return factpersonal)

c. 60, ok:

select count(*) from (match {Class: fact, as: fact}-FactContains->{class: Entity, as: entity, where:(Id=1)} return fact)

2.2 Traverses

a. :

traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)

b. count of previous traverse 61, :

select count(*) from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1))

c. count more in details, ok:

select @class, count(*) from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)) group by @class

FactContains 60 Entity 1

d. 0 :

traverse outV() from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)) while @class = 'FactGeneral' limit 2000 

e. 0 :

traverse outV() from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)) while @class = 'FactPersonal' limit 2000  

f. returns rows

traverse outV() from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)) while @class <> 'FactPersonal' limit 2000

g. count of previous traverse , 114

select count(*) from (traverse outV() from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)) while @class <> 'FactPersonal' limit 2000)

f. previous count, aggregated by class:

select @class, count(*) from (traverse outV() from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)) while @class <> 'FactPersonal' limit 2000) group by @class

FactContains 60 Entity 1 FactGeneral 53

i. returs rows

traverse outV() from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)) while @class <> 'FactGeneral' limit 2000

m. return rows

traverse outV() from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)) while @class <> 'FactGeneral' limit 2000

n. count of previous rows , 68

traverse outV() from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)) while @class <> 'FactGeneral' limit 2000

p. previous count, aggregated by class:

select @class, count(*) from (traverse outV() from (traverse inE('FactContains') from (SELECT FROM Entity WHERE Id=1)) while @class <> 'FactGeneral' limit 2000) group by @class

FactContains: 60 Entity: 1 FactPersonal: 7

2.3 match queries

a. returns 1 entity, ok:

match {as: other}--{Class: fact, as: fact}-FactContains->{class: Entity, as: entity, where:(Id=1)} return entity

c. returns 1, expected:

match {as: other}--{Class: fact, as: fact}-FactContains->{class: Entity, as: entity, where:(Id=1)} return other.Id

2.4 select queries

a. :

select expand(inE('FactContains')) from (SELECT FROM Entity WHERE Id=1) limit 2000 

b.:

select count(*) from (select expand(inE('FactContains')) from (SELECT FROM Entity WHERE Id=1) limit 2000 )

60

c.

select expand(outV()) from (select expand(inE('FactContains')) FROM (SELECT FROM Entity WHERE Id=1)) where @class <> 'FactPersonal' limit 2000

d. previous count by class

select @class, count(*) from (select expand(outV()) from (select expand(inE('FactContains')) FROM (SELECT FROM Entity WHERE Id=1)) where @class <> 'FactPersonal' limit 2000) group by @class 

FactGeneral 53 FactPersonal 7

e.

select expand(outV()) from (select expand(inE('FactContains')) from (SELECT FROM Entity WHERE Id=1)) where @class <> 'FactGeneral' limit 2000 

f. previous count by class

select @class, count(*) from (select expand(outV()) from (select expand(inE('FactContains')) from (SELECT FROM Entity WHERE Id=1)) where @class <> 'FactGeneral' limit 2000) group by @class

FactGeneral 53 FactPersonal 7

0reactions
zifnab87commented, Mar 1, 2017

Awesome! Thanks @santo-it! I feel that this issue can be closed. I also believe that the tests need to be added in the automated test suite you have because bugs or different behaviors tend to reappear if there aren’t any test safeguards

Read more comments on GitHub >

github_iconTop Results From Across the Web

2.1-rc3 - Bug?: filtering vertices on classes using inV() or outV ...
Hi I am trying to run this query: traverse outV('FactPersonal') from (traverse inE('FactContains') from #12:15 while $depth <= 1) while $depth <= 1...
Read more >
Revolution 2.1 RC3 Lightens Further and Gets Lots of Little ...
Release Candidate 3 2 (RC-3) fixes a number of issues and bugs identified ... and maps/classes generated in order to work across platforms....
Read more >
Issues for Maestro | Drupal.org
Title Status Pri... Invalid Link in Actions column of TaskConsole Postponed (maintainer needs more info) Nor... maestro webform modelu RuntimeException Needs review Nor... Token // unexpected...
Read more >
Flatline 2.1 - Page 2 - Simple Machines Forum
Found it. There is an issue with the theme: if the news is not showing on the main page, the div class="newsandtime" is...
Read more >
Play 2.0-RC3 -- Error: Could not find or load main class
Copy the folder to a path without spaces in the name. "Program Files" has a space in the name and this often causes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found