MATCH and where

32 views
Skip to first unread message

jonatha...@gmail.com

unread,
Sep 23, 2016, 5:06:28 PM9/23/16
to OrientDB
I want to use MATCH to find pairs of nodes that share two other nodes. I run the following query:

MATCH 
{class:Gene, as:g1} -IS_PART_OF-> {class:Organism, as:o1} <-IS_PART_OF- {class:Gene, as:g2},
{class:Gene, as:g1} -OBSERVED_IN-> {class:Location, as:loc} <-OBSERVED_IN- {class:Gene, as:g2}

It almost returns what I want, but includes identical nodes in a pair:
METADATAPROPERTIES
@version
o1_name
g1_name
g2_name
loc_name
0
Plasmodium falciparum
Rh1
DHFR-TS
Kenya
0
Plasmodium falciparum
Rh1
MSPDBL2
Kenya
0
Plasmodium falciparum
Rh1
mrp2
Kenya
0
Plasmodium falciparum
Rh1
var2csa
Kenya
0
Plasmodium falciparum
Rh1
MSPDBL1
Kenya
0
Plasmodium falciparum
Rh1
Rh4
Kenya
0
Plasmodium falciparum
Rh1
hrp3
Kenya
0
Plasmodium falciparum
Rh1
MSP3
Kenya
0
Plasmodium falciparum
Rh1
Rh1
Kenya
0
Plasmodium falciparum
Rh1
EBL1
Kenya

I try to filter the identical node pairs using where:

MATCH 
{class:Gene, as:g1} -IS_PART_OF-> {class:Organism, as:o1} <-IS_PART_OF- {class:Gene, as:g2},
{class:Gene, as:g1} -OBSERVED_IN-> {class:Location, as:loc} <-OBSERVED_IN- {class:Gene, as:g2, where: ($matched.g1.name <> $currentMatch.name)}

but zero records are returned.

Any idea what's going on?

Thank you

Luigi Dell'Aquila

unread,
Sep 25, 2016, 2:22:57 AM9/25/16
to orient-...@googlegroups.com
Hi Jonathan,

That's quite strange, it seems to be a bug. Could you please report an issue here?


Thanks

Luigi

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages