Curious about the future of data-driven systems? Join our Data Engineering roundtable and learn how to build scalable data platforms.
Data Engineering: The industry has come a long way from organizing unstructured data to adopting today's modern data pipelines. See how.
Mark is a graph advocate and field engineer for Neo Technology, the company behind the Neo4j graph database. As a field engineer, Mark helps customers embrace graph data and Neo4j building sophisticated solutions to challenging data problems. When he's not with customers Mark is a developer on Neo4j and writes his experiences of being a graphista on a popular blog at http://markhneedham.com/blog. He tweets at @markhneedham.
Stats
| Reputation: | 2456 |
| Pageviews: | 5.3M |
| Articles: | 92 |
| Comments: | 2 |
Comments
Jul 10, 2017 · Jordan Baker
Even better!
Dec 29, 2013 · Mr B Loid
Hi Peter,
Thanks for your comments. I'll try to address them one at a time:
> 1.) You miss the link between players and "players in matches".
> 2.) goal property is missing.
Good catch, hadn't noticed that.
> For instance you could give us a query comparision of a more complicated use case, let's say
> "the average amount of goals scored by french players in european champions league per
> year". My hypothesis is that a SQL guru can write this down in less than 5 minutes in a single
> sql statement whereas you cannot do this in Neo.
I don't think it'd be too difficult to write a query like that in Neo but I'll give it a try:
// get the French players who scored goals in the champions league
MATCH (g:Game)-[:in_competition]->(c:Competition)
WHERE c.name = "Champions League"
MATCH (p:Player)-[:played]-(stats)->[:in]->(game)
MATCH (p)-[:comes_from]->(country)
WHERE country.name = "France"
RETURN p.name, SUM(stats.goals)
// Find all the goals scored by French players per season
MATCH (s:Season)-[:contains_match]->(g:Game)-[:in_competition]->(c:Competition)
WHERE c.name = "Champions League"
MATCH (p:Player)-[:played]-(stats)->[:in]->(game)
MATCH (p)-[:comes_from]->(country)
WHERE country.name = "France"
RETURN country.name, s.name, SUM(stats.goals)
Is that what you meant?
> In general what is disturbing me in NoSql discussions: The way to solve a problem the "IT-way"
> is most often "select the cool hyped tool -> apply awkward transformations to the problem to be
> able to solve it with the preselected tool" BUT IT should be "analyze all facets of the problem,
> i.e. layout and needed query-paths -
Fair enough. In this case I was just hacking on this for fun and someone asked me what it would look like if it used tables instead so that's how I ended up with the comparison. Would you model it differently than I did?
Regarding Sparql - the query language I showed here (cypher) is partly based on that and partly based on SQL so there is at least some inspiration.
Didn't know about dbpedia but that sounds like a good resource to link to from my football graph - perhaps I can pull in more information from there?
I've read a bit about the semantic web but I don't know that much so thanks for the links to the course. Hopefully I can do that when it next runs.
Cheers
Mark