Reputation: 1095
Like I have a node by label person
Then there are some alternate nodes attached to it by some relation for the time being I don't know the relation. What I want through report is to know the orphaned nodes in neo4j i.e those that don't have relationship with the Person node or if their relation status property is inactive so its of no use.
I want to create that report in order to remove the orphaned/unused nodes
I have to create a report that should include the following types of nodes.
1. Get All active Alternate Nodes means nodes that have status as Confirmed.
a. Which do not have any incoming relationships.
Or
b. No active incoming relationships means the status property of relationship is not confirmed.
The case is I don't know what relationship is between them I have to just check with or without relationship
I tried cypher query but didn't worked for unknown relationship
Upvotes: 1
Views: 941
Reputation: 12714
I don't see your graph so I created a sample. See below.
If you want to collect all Alona and Inactive nodes, then you can write your query as:
match (n)
where not (n) <--()
and (n.Status = 'Confirmed' or n.Status != 'Confirmed')
return n
which simplifies into:
match (n)
where not (n) <--()
return n
Result:
Upvotes: 1