Create Query returns null

OK. It worked now. I will convert the others to syntax v2

Sorry, part of my syntax was invalid.

For directed edges, the syntax is (FRIENDS_WITH>:r1) instead of (FRIENDS_WITH:r1>)

I have updated my code snippet above to match this.

Don’t worry, I have noticed and changed after read the documentation about Syntax V2 differences. Thank you.

My fourth query

R4 = SELECT f1
FROM Person:f1- (FRIENDS_WITH>:r1) -Person:f3 , Person:f2- (FRIENDS_WITH>:r2) -Person:f4 
WHERE r2.date_of_start == r1.date_of_start
ACCUM @@edges += r2, @@edges += r1, @@source += f1, @@source += f2, @@target += f3, @@target += f4;

got this error:

(44, 4) Error: Disconnected patterns not yet supported: alias(es) f1 disconnected from rest of pattern

And I think it was due to what you have mentioned before since I’m trying to join disconnected edges based on their property values

Hi - One comment here is that I feel that you are still trying to apply relational db query techniques, such as a cartesian join, or outer join, as a way to find these pairs. If you are just trying to show that you can query using edge attributes, that has already been shown.

It would be helpful if you could describe in words what you are trying to achieve with the fourth query, and I am sure you will get helpful suggestions.

For instance, here is a query that finds groups of friends where the friendship started on the same date

You will see that using accumulators is a powerful way to achieve this


MapAccum<DATETIME, SetAccum<VERTEX>> @@friends;
R4 = SELECT f1
FROM people:f1- (FRIENDS_WITH>:r1) -Person:f2
  ACCUM @@friends += (r1.date_of_start -> f2);
1 Like

Hi,

this is the forth query

SELECT f1, r1, f3, f2, r2, f4 into R4
FROM Person:f1- (FRIENDS_WITH>:r1) -Person:f3 , Person:f2- (FRIENDS_WITH>:r2) -Person:f4
WHERE r2.date_of_start == r1.date_of_start;

that a I tried to translate from Cypher query bellow

MATCH (n1:Person)-[k1:FRIENDS_WITH]->(n3:Person)
MATCH (n2:Person)-[k2:FRIENDS_WITH]->(n4:Person)
WHERE k2.date_of_start = k1.date_of_start and n1 <> n2
RETURN n1.name, n3.name, n2.name, n4.name, k2.date_of_start AS since

With this pattern I’m trying to check if is it possible to correlate two subgraphs based on their edges properties. Although they are disconnected may exist an implicit relationship between them based on their contextual meta information (temporal, spatial, source, and so on)

I will read more about accumulators. Thank you for the suggestion.

General speaking, the subgraphs that I’m trying to correlate may not have the same edge or vertex type and must have the same contextual information.

1 Like