Having Issue With Neo4j Output Result

Hi

May i know how can i fix this issue with the output result of Neo4j? As from the uploaded file the output was fine with the knowledge graph but after i ran this cypher query

MATCH ()-[r:attribute]->()
DELETE r

It shows the output with (No changes, no records). Is there any way that i can retrieve back the knowledge graph output please. Both of them i used the same cypher query as

MATCH (s:ID)-[r]-(m)

RETURN s, r, m

Thank you.

Hi,

I'm not sure what you are after, but the query

MATCH ()-[r:attribute]->()
DELETE r

removes all of the attribute relationships from the graph, so none exists in the graph anymore.

And if that was your only relationship type, there are now no relationships left in the graph, so the query

MATCH (s:ID)-[r]-(m)
RETURN s, r, m

will match nothing. (Doesn't need to be the only relationship type overall, just the only one that ID nodes connect with for this.)

You can try

MATCH (s:ID)
OPTIONAL MATCH (s)-[r]-(m)
RETURN s, r, m

To see the ID nodes that are still in the graph, and any potential relationships there might be.

But if you want the relationships back in the output they will need to be re-added to the graph.

Hope that was helpful,
Therese

Hi Therese

Thanks for your solution response. Very kind of you. I am able to get back the output already. Thank you.

Best

Chung