Examples of Query Driven Graph Modelling from business all the way down to code

I am looking for hands-on examples or even templates for query-driven data modelling / knowledge graph design that reach all the way from the initial business question down to graph code.

I have found some very few examples in Denise Gosnell’s “The Practitioner’s Guide to Graph Data”, but her examples start at a too graph-close level, making it hard to communicate them to the business side (who do not think in metrics, data points, verticals and edges immediately). I would be curious to see an example that starts with a purely business-oriented question, say “Which of my regional offices are similar to each other in terms of types of customers / types of projects they deliver?”, breaking it down into ever more specific metrics and data points and finally a conceptual graph-oriented model of the corresponding query / queries.

I would be very grateful for any tips for case descriptions or even templates.


hello :wave:! I’m so glad you are finding parts of my book to be helpful.

I agree that an improvement would be to start with a business oriented question and break it down before going so heavy into the graph concepts.

Have you started chapter 10?

We cover the business concepts of recommendations and break it down into smaller questions.

For the business question above, I would recommend building up to it with the following sequence of smaller questions:

Understanding recommendations with a sample of one:

  1. What is my set of regional offices? Pick one office.
  2. Which customers visit that office? Pick one customer.
  3. Which other offices that that customer visit, excluding the original office?
    Done: this is a set of offices similar to the first office according to one customer.

Now, let’s expand the same idea to use all offices and all customers:

  1. What is my set of regional offices? Put them in a set.
  2. Which customers visit any of these offices? Put them in another set.
  3. Which other offices are visited by this set of customers, excluding the original set of offices?
    Done: this is a set of offices similar to the regional offices according to their customers.

You can repeat this line of thinking for other concepts like projects, deliveries, etc.

I hope this helps! Thank you for the question.


Thank you very much, Denise!

First: I forgot to mention in my original post that I find your book as a whole very useful and highly readable, especially for those who come from the relational world - it is now part of our standard library here at the office. I just was missing some way of communicating and operationalizing graph thinking when discussing with my colleagues from the business side. We try to establish a development approach that is as much query-driven as possible, so the “recipe” you describe here is very useful. We will try it out and then give feedback how it works.

(Also, I will reshare your answer with the Knowledge Graph Conference-community on Slack, if you don’t mind).

Thanks again for taking the time to help us with this.

1 Like