Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apoc.convert.totree not returning some inner relationships #3770

Open
atish-19 opened this issue Sep 12, 2023 · 1 comment
Open

apoc.convert.totree not returning some inner relationships #3770

atish-19 opened this issue Sep 12, 2023 · 1 comment
Assignees
Labels
core-functionality Adding new procedure, function or signature to APOC core

Comments

@atish-19
Copy link

atish-19 commented Sep 12, 2023

below query (query:1)not returning Follows and belongs to relationship for id_str = '2eabebe734977c29165b9bd62f296e39' of post
however when I run the query (query:2) with this id_str in match then it is returning the complete tree.

MATCH (b:Post{isdeleted:false})
WHERE (b.posttype = 'Post' OR b.posttype = 'Poll')
with b
order by b.createdate desc
skip 0
limit 10
MATCH x = (b)
MATCH u1 = (b)<-[:CREATEDPOST]-(us1:User)
Optional Match img = (b)<-[:CREATEDPOST]-(us2:User)-[:HASURL]->(url2:URL)
Optional Match cty= (b)<-[:CREATEDPOST]-(us4:User)-[:BELONGSTO]->(ctt:City)
Optional Match usr11 = (b)<-[:CREATEDPOST]-(us3:User)<-[:FOLLOWS]-(flr:User{customerid:'64373'})
Optional Match p=(b) -[COMMENT*..2]->(c:Post)
Optional Match h = (b) - [:HASURL]->(u:URL)
Optional Match l=(b)<- [:LIKE] - (a:User{customerid:'64373'})
Optional Match o= (b)- [:POLLOPTION] -> (po:PollOption)
Optional Match ans= (b)- [:POLLOPTION] -> (pp:PollOption)- [:ANSWERBY] -> (usr:User)
With (collect (x) + COALESCE(COLLECT(u1),[]) + COALESCE(COLLECT(img),[]) + COALESCE(COLLECT(cty),[]) + COALESCE(COLLECT(usr11),[]) + COALESCE(collect(p),[]) + COALESCE(COLLECT(h),[]) + COALESCE(COLLECT(l),[]) + COALESCE(COLLECT(o),[]) + COALESCE(COLLECT(ans),[])) as path
Call apoc.convert.toTree(path)
Yield value
Return value

Match post with id_str

MATCH (b:Post{id_str:'2eabebe734977c29165b9bd62f296e39'})
WHERE (b.posttype = 'Post' OR b.posttype = 'Poll')
with b
order by b.createdate desc
skip 0
limit 10
MATCH x = (b)
MATCH u1 = (b)<-[:CREATEDPOST]-(us1:User)
Optional Match img = (b)<-[:CREATEDPOST]-(us2:User)-[:HASURL]->(url2:URL)
Optional Match cty= (b)<-[:CREATEDPOST]-(us4:User)-[:BELONGSTO]->(ctt:City)
Optional Match usr11 = (b)<-[:CREATEDPOST]-(us3:User)<-[:FOLLOWS]-(flr:User{customerid:'64373'})
Optional Match p=(b) -[COMMENT*..2]->(c:Post)
Optional Match h = (b) - [:HASURL]->(u:URL)
Optional Match l=(b)<- [:LIKE] - (a:User{customerid:'64373'})
Optional Match o= (b)- [:POLLOPTION] -> (po:PollOption)
Optional Match ans= (b)- [:POLLOPTION] -> (pp:PollOption)- [:ANSWERBY] -> (usr:User)
With (collect (x) + COALESCE(COLLECT(u1),[]) + COALESCE(COLLECT(img),[]) + COALESCE(COLLECT(cty),[]) + COALESCE(COLLECT(usr11),[]) + COALESCE(collect(p),[]) + COALESCE(COLLECT(h),[]) + COALESCE(COLLECT(l),[]) + COALESCE(COLLECT(o),[]) + COALESCE(COLLECT(ans),[])) as path
Call apoc.convert.toTree(path)
Yield value
Return value

Attaching the Graph screenshot here.
graph

Please help me

@Lojjs
Copy link
Contributor

Lojjs commented Sep 18, 2023

@atish-19 Do you have the possibility to send us your data set, alternative a smaller CREATE query in order to reproduce the issue?

Best regards Louise, Neo4j

@Lojjs Lojjs self-assigned this Sep 18, 2023
@jexp jexp moved this to Todo in APOC Extended Larus Sep 21, 2023
@vga91 vga91 moved this from Todo to Blocked in APOC Extended Larus Feb 19, 2024
@vga91 vga91 added the core-functionality Adding new procedure, function or signature to APOC core label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-functionality Adding new procedure, function or signature to APOC core
Projects
Status: Core issues
Development

No branches or pull requests

3 participants