cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Depreciation of [r:]

genealogy
Graph Buddy

I'm trying to update queries in anticipation of the changes in future Cypher versions. Here's my dilemma. My existing and working example query is:

MATCH path=(m1)-[r:shared_match]-(m2)-[r2:Gedcom_DNA]-(p:Person) where m1.RN>0 and m2.RN>0
with path,collect(distinct p.RN) as rns
optional match path2=(a:Person)-[:father|mother0..15]->(mrca:Person)<-[r4:father|mother0..15]-(b:Person)
where a.RN=1 and b.RN in rns
with path,path2,rns,relationships(path) as r3
optional match (c:Person)-[q:bp|dd|up]->(d:Place) where c.RN in rns
RETURN path,path2,q,d

The Neo4j browser display the triangle warning alter with this message:

This feature is deprecated and will be removed in future versions.

Binding relationships to a list in a variable length pattern is deprecated. (Binding a variable length relationship pattern to a variable ('r4') is deprecated and will be unsupported in a future version. The recommended way is to bind the whole path to a variable, then extract the relationships: MATCH p = (...)-[...]-(...) WITH *, relationships(p) AS r4)

I can make this work for a relationship without the *0..15 but not with the extended traversal. I've not figured out where to put this in the query.

I've tried this and it works but still leaves me with the warning:

MATCH path=(m1)-[r:shared_match]-(m2)-[r2:Gedcom_DNA]-(p:Person)
where m1.RN>0 and m2.RN>0
with path,collect(distinct p.RN) as rns
optional match path2=(a:Person)-[:father|mother*0..15]->(mrca:Person)<-
[r4:father|mother*0..15]-(b:Person)
where a.RN=1 and b.RN in rns
with path,path2,rns,relationships(path) as r3
optional match (c:Person)-[q:bp|dd|up]->(d:Place) where c.RN in rns
RETURN path,path2,q,d

I've tried putting the 0..15 in other places and they don't work. Example: relationships(path:father|mother0..15) as r3

The documentation on this seems sparse, including the timing on the depreciation.

Would appreciate a post on the proper formatting of this and similar queries

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online