Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render demo graph using Alchemy.js and GraphJSON #7

Merged
merged 5 commits into from
Jan 16, 2019
Merged

Conversation

macbre
Copy link
Contributor

@macbre macbre commented Jan 16, 2019

Football players from Iceland in Premier League

$ query_football_graph 
2019-01-16 10:52:59 root                      INFO     Looking for players from Iceland in Premier League
2019-01-16 10:52:59 root                      INFO     Querying "football" graph: 
    MATCH (t:SportsTeam)<-[a:athlete]-(p:Person)
    WHERE t.memberOf = 'Premier League'
    AND p.nationality = 'Iceland' RETURN t.name,p.name,a.since,a.until
2019-01-16 10:52:59 RedisGraph                INFO     Using redis: localhost:56379
{'t.name': 'Arsenal F.C.', 'p.name': 'Ólafur Ingi Skúlason', 'a.since': '2001.000000', 'a.until': '2005.000000'}
{'t.name': 'Tottenham Hotspur F.C.', 'p.name': 'Gylfi Þór Sigurðsson', 'a.since': '2012.000000', 'a.until': '2014.000000'}
{'t.name': 'Tottenham Hotspur F.C.', 'p.name': 'Eiður Smári Guðjohnsen', 'a.since': '2010.000000', 'a.until': '2010.000000'}
{'t.name': 'Chelsea F.C.', 'p.name': 'Eiður Smári Guðjohnsen', 'a.since': '2000.000000', 'a.until': '2006.000000'}
{'t.name': 'Everton F.C.', 'p.name': 'Gylfi Þór Sigurðsson', 'a.since': '2017.000000', 'a.until': 'NULL'}
{'t.name': 'Burnley F.C.', 'p.name': 'Jóhann Berg Guðmundsson', 'a.since': '2016.000000', 'a.until': 'NULL'}

iceland png

Who played in Liverpool and Manchester United

2019-01-16 11:23:05 root                      INFO     Looking for players who played in both Liverpool F.C. in Manchester United F.C.
2019-01-16 11:23:05 root                      INFO     Querying "football" graph: 
    MATCH (t1:SportsTeam)<-[a1:athlete]-(p:Person)-[a2:athlete]->(t2:SportsTeam)
    WHERE t1.name = 'Liverpool F.C.' and t2.name = 'Manchester United F.C.'
    RETURN p.name,
        t1.name,t2.name,
        a1.since,a1.until,
        a2.since,a2.until
2019-01-16 11:23:05 RedisGraph                INFO     Using redis: localhost:56379
{'p.name': 'Peter Andrew Beardsley', 't1.name': 'Liverpool F.C.', 't2.name': 'Manchester United F.C.', 'a1.since': '1987.000000', 'a1.until': '1991.000000', 'a2.since': '1982.000000', 'a2.until': '1983.000000'}
{'p.name': 'Paul Emerson Carlyle Ince', 't1.name': 'Liverpool F.C.', 't2.name': 'Manchester United F.C.', 'a1.since': '1997.000000', 'a1.until': '1999.000000', 'a2.since': '1989.000000', 'a2.until': '1995.000000'}
{'p.name': 'Michael James Owen', 't1.name': 'Liverpool F.C.', 't2.name': 'Manchester United F.C.', 'a1.since': '1996.000000', 'a1.until': '2004.000000', 'a2.since': '2009.000000', 'a2.until': '2012.000000'}

manu_liverpool

Midfielders in Premier League

2019-01-16 12:36:05 root                      INFO     Looking for players from Premier League playing as MF
2019-01-16 12:36:05 root                      INFO     Querying "football" graph: 
    MATCH (t1:SportsTeam)-[a1:athlete]->(p:Person)-[a:athlete]->(t:SportsTeam)
    WHERE t.memberOf = 'Premier League' AND a1.position = 'MF'
    RETURN t.name,p.name,a.since,a.until
2019-01-16 12:36:05 RedisGraph                INFO     Using redis: localhost:56379
{'t.name': 'Manchester City F.C.', 'p.name': 'İlkay Gündoğan', 'a.since': '2016.000000', 'a.until': 'NULL'}
{'t.name': 'Watford F.C.', 'p.name': 'Étienne Capoue', 'a.since': '2015.000000', 'a.until': 'NULL'}
{'t.name': 'Tottenham Hotspur F.C.', 'p.name': 'Étienne Capoue', 'a.since': '2013.000000', 'a.until': '2015.000000'}
{'t.name': 'Liverpool F.C.', 'p.name': 'Xherdan Shaqiri', 'a.since': '2018.000000', 'a.until': 'NULL'}
{'t.name': 'West Ham United F.C.', 'p.name': 'Manuel Lanzini', 'a.since': '2015.000000', 'a.until': '2016.000000'}
{'t.name': 'West Ham United F.C.', 'p.name': 'Domingos Quina', 'a.since': '2016.000000', 'a.until': '2018.000000'}
{'t.name': 'Watford F.C.', 'p.name': 'Domingos Quina', 'a.since': '2018.000000', 'a.until': 'NULL'}
{'t.name': 'Tottenham Hotspur F.C.', 'p.name': 'Harry Winks', 'a.since': '2014.000000', 'a.until': 'NULL'}
{'t.name': 'Liverpool F.C.', 'p.name': 'Ryan Kent', 'a.since': '2015.000000', 'a.until': 'NULL'}
{'t.name': 'A.F.C. Bournemouth', 'p.name': 'Ryan Fraser', 'a.since': '2013.000000', 'a.until': 'NULL'}
{'t.name': 'Chelsea F.C.', 'p.name': 'Ross Barkley', 'a.since': '2018.000000', 'a.until': 'NULL'}
{'t.name': 'Everton F.C.', 'p.name': 'Ross Barkley', 'a.since': '2010.000000', 'a.until': '2018.000000'}
{'t.name': 'Liverpool F.C.', 'p.name': 'Jonjo Shelvey', 'a.since': '2010.000000', 'a.until': '2013.000000'}
{'t.name': 'Manchester United F.C.', 'p.name': 'Nemanja Matić', 'a.since': '2017.000000', 'a.until': 'NULL'}
{'t.name': 'Chelsea F.C.', 'p.name': 'Nemanja Matić', 'a.since': '2009.000000', 'a.until': '2011.000000'}
{'t.name': 'Leicester City F.C.', 'p.name': 'Nampalys Mendy', 'a.since': '2016.000000', 'a.until': 'NULL'}
{'t.name': 'Liverpool F.C.', 'p.name': 'Naby Keïta', 'a.since': '2018.000000', 'a.until': 'NULL'}
{'t.name': 'Leicester City F.C.', 'p.name': "N'Golo Kanté", 'a.since': '2015.000000', 'a.until': '2016.000000'}
{'t.name': 'Chelsea F.C.', 'p.name': "N'Golo Kanté", 'a.since': '2016.000000', 'a.until': 'NULL'}
{'t.name': 'Everton F.C.', 'p.name': 'Muhamed Bešić', 'a.since': '2014.000000', 'a.until': 'NULL'}
{'t.name': 'Manchester United F.C.', 'p.name': 'Morgan Schneiderlin', 'a.since': '2015.000000', 'a.until': '2017.000000'}
{'t.name': 'Everton F.C.', 'p.name': 'Morgan Schneiderlin', 'a.since': '2017.000000', 'a.until': 'NULL'}
{'t.name': 'Southampton F.C.', 'p.name': 'Morgan Schneiderlin', 'a.since': '2008.000000', 'a.until': '2015.000000'}
{'t.name': 'Arsenal F.C.', 'p.name': 'Mesut Özil', 'a.since': '2013.000000', 'a.until': 'NULL'}
{'t.name': 'Chelsea F.C.', 'p.name': 'Mateo Kovačić', 'a.since': '2018.000000', 'a.until': 'NULL'}
{'t.name': 'Manchester City F.C.', 'p.name': 'Leroy Sané', 'a.since': '2016.000000', 'a.until': 'NULL'}
{'t.name': 'Chelsea F.C.', 'p.name': 'Kevin De Bruyne', 'a.since': '2012.000000', 'a.until': '2014.000000'}
{'t.name': 'Crystal Palace F.C.', 'p.name': 'Luka Milivojević', 'a.since': '2017.000000', 'a.until': 'NULL'}
{'t.name': 'Liverpool F.C.', 'p.name': 'Ki-Jana Hoever', 'a.since': '2018.000000', 'a.until': 'NULL'}
{'t.name': 'Liverpool F.C.', 'p.name': 'Lazar Marković', 'a.since': '2014.000000', 'a.until': 'NULL'}
{'t.name': 'Leicester City F.C.', 'p.name': 'Bartosz Kapustka', 'a.since': '2016.000000', 'a.until': 'NULL'}
{'t.name': 'Leicester City F.C.', 'p.name': 'Hamza Choudhury', 'a.since': '2016.000000', 'a.until': 'NULL'}
{'t.name': 'Leicester City F.C.', 'p.name': 'Daniel Amartey', 'a.since': '2016.000000', 'a.until': 'NULL'}
{'t.name': 'Burnley F.C.', 'p.name': 'Jóhann Berg Guðmundsson', 'a.since': '2016.000000', 'a.until': 'NULL'}
{'t.name': 'Liverpool F.C.', 'p.name': 'Emre Can', 'a.since': '2014.000000', 'a.until': '2018.000000'}
{'t.name': 'Leicester City F.C.', 'p.name': 'Jeffrey Schlupp', 'a.since': '2010.000000', 'a.until': '2017.000000'}
{'t.name': 'Crystal Palace F.C.', 'p.name': 'Jeffrey Schlupp', 'a.since': '2017.000000', 'a.until': 'NULL'}
{'t.name': 'Crystal Palace F.C.', 'p.name': 'James McArthur', 'a.since': '2014.000000', 'a.until': 'NULL'}
{'t.name': 'Arsenal F.C.', 'p.name': 'Gedion Zelalem', 'a.since': '2014.000000', 'a.until': 'NULL'}
{'t.name': 'West Ham United F.C.', 'p.name': 'Cheikhou Kouyaté', 'a.since': '2014.000000', 'a.until': 'NULL'}
{'t.name': 'Arsenal F.C.', 'p.name': 'Ainsley Maitland-Niles', 'a.since': '2014.000000', 'a.until': 'NULL'}

midfielders

@macbre macbre merged commit 35017f0 into master Jan 16, 2019
@macbre macbre deleted the alchemy-js-graphs branch January 16, 2019 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant