Let’s make it easy to find out what exercises to include when you gather your Crossfit friends. First create a list of exercises, then find out what favorite exercises you share to create the optimal WOD (Workout of the day).
CREATE (lisa:Person {name: 'Lisa'}),
(fredrik:Person {name: 'Fredrik'}),
(filippa:Person {name: 'Filippa'}),
(crossfit:Workout {name:'Crossfit'}),
(burpee:Exercise {name:'Burpee'}),
(pistols:Exercise {name: 'Pistols'}),
(squats:Exercise {name: 'Air squats'}),
(hspu:Exercise {name: 'HSPU'}),
(pushups:Exercise {name: 'Push ups'}),
(wod:Goal {name: 'WOD'}),
(lisa)-[:WANTS]->(crossfit),
(fredrik)-[:WANTS]->(crossfit),
(filippa)-[:WANTS]->(crossfit),
(lisa)-[:LIKES]->(burpee),
(lisa)-[:LIKES]->(pistols),
(lisa)-[:LIKES]->(squats),
(fredrik)-[:LIKES]->(burpee),
(fredrik)-[:LIKES]->(pistols),
(fredrik)-[:LIKES]->(pushups),
(filippa)-[:LIKES]->(burpee),
(filippa)-[:LIKES]->(hspu),
(filippa)-[:LIKES]->(squats),
(crossfit)-[:CREATE]->(wod)
RETURN lisa, fredrik, filippa, crossfit, burpee, pistols, squats, hspu, pushups, wod
Based on your lists, find out what exercises that are most popular among the team.
MATCH (burpee:Exercise {name:'Burpee'})
FOREACH (name in ['Lisa', 'Fredrik', 'Filippa'] |
CREATE (burpee)-[:LIKE]->(:Exercise {name:name}))
MATCH (wod {name:'WOD'})-[:LIKES]->(crossfit)
RETURN wod, crossfit