calinconstantinov / GGCD

Dataset for Neo4j Global Graph Celebration Day

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Neo4j Global Graph Celebration Day

Run these queries on the Global Graph Celebration Day attendee graph: https://globalgraphcelebrationday.com/

  1. Find all Events
    MATCH (e:Event)
    RETURN e

  2. Find all Events, order by Country
    MATCH (e:Event)
    RETURN e.Country, e.City
    ORDER BY e.Country ASC

  3. Find all persons attending in Romania
    MATCH (p:Person)-[:ATTENDING]->(e:Event)
    WHERE e.Country = 'Romania'
    RETURN p, e

  4. Find the Events with most Persons attending
    MATCH (p:Person)-[:ATTENDING]->(e:Event)
    WITH e, count(p) as participants
    ORDER BY count(p) DESC
    RETURN e.name, e.Country, e.City, e.Description, participants

  5. Find the hobbies of persons attending in Romania
    MATCH (p:Person)-[:ATTENDING]->(e:Event)
    WHERE e.Country = 'Romania'
    WITH p
    MATCH (p)-[:ENJOYS]->(h:Hobby)
    RETURN p, h

  6. Optionally find the Hobbies, Tools and Usecases for the Persons atteding in Romania
    MATCH (p:Person)-[:ATTENDING]->(e:Event)
    WHERE e.Country = 'Romania'
    WITH p
    OPTIONAL MATCH (p)-[:ENJOYS]->(h:Hobby)
    OPTIONAL MATCH (p)-[:USES]->(t:Tool)
    OPTIONAL MATCH (p)-[:INTERESTED_IN]->(u:Usecase)
    RETURN p, h, t, u

  7. The are multiple entries for Calin. Find all data for Calin, only returning the first match
    MATCH (p:Person)-[:ATTENDING]->(e:Event)
    WHERE e.Country = 'Romania' and p.name = "Calin"
    WITH p
    LIMIT 1
    OPTIONAL MATCH (p)-[:ENJOYS]->(h:Hobby)
    OPTIONAL MATCH (p)-[:USES]->(t:Tool)
    OPTIONAL MATCH (p)-[:INTERESTED_IN]->(u:Usecase)
    RETURN p, h, t, u

  8. Find the most popular Usecases for Persons attending in Romania
    MATCH (p:Person)-[:ATTENDING]->(e:Event)
    WHERE e.Country = 'Romania'
    WITH p
    MATCH (p)-[:INTERESTED_IN]->(u:Usecase)
    RETURN u.name as usecase, count(p) as peopleInterested
    ORDER BY count(p) DESC

  9. Use the trim() function for grouping duplicate Usecases
    MATCH (p:Person)-[:ATTENDING]->(e:Event)
    WHERE e.Country = 'Romania'
    WITH p
    MATCH (p)-[:INTERESTED_IN]->(u:Usecase)
    RETURN trim(u.name) as usecase, count(p) as peopleInterested
    ORDER BY count(p) DESC

  10. Find the most similar to Calin Persons on the planet
    MATCH (p:Person)-[:ATTENDING]->(e:Event)
    WHERE e.Country = 'Romania' and p.name = "Calin"
    WITH p
    LIMIT 1
    MATCH (p)-[:ENJOYS]->(h:Hobby)
    WITH p, h
    MATCH (s:Person)-[:ENJOYS]->(h)
    WHERE s.name <> "Calin"
    RETURN s.name, s.id, count(h) as commonHobies
    ORDER BY count(h) DESC
    LIMIT 10

About

Dataset for Neo4j Global Graph Celebration Day

License:Apache License 2.0


Languages

Language:Java 100.0%