This is a project in which we scrapped marine animals data from a website and then vizualized using neo4j database and created relationships to understand it better.
MATCH (n:feed_habits) WITH n.Feeding_Habits AS habit, collect(n) AS DUPLICATES WHERE size(duplicates) > 1 FOREACH (n in tail(duplicates) | DELETE n)
MATCH (n:Marine),(m:Marine) WHERE NOT m=n and n.Habitat=m.Habitat CREATE (m)-[r:neighbor]->(n) RETURN r
MATCH (m:Marine),(f:feed_habits) WHERE m.feed_habits=f.feed_habits CREATE (m)-[r:Identical_Feeding_Habits_]->(f) RETURN r
There are 2 commands that does this thing.
1.
MATCH (n)
WHERE n.ConservationStatus contains 'Endangered' RETURN n
2.
MATCH (m:Marine),(n:feed_habits) WHERE m.ConservationStatus contains 'Endangered' and m.Feeding_Habits = n.Feeding_Habits RETURN m,n