Visualizing your Knowledge Graph.

This blog was originally posted on exaptive.com/blog, and uses the Exaptive Cognitive City to describe turning data into information - knowledge brokering.

At the beginning of the year we posited that those of us who work with complex data  need to move away from rows and columns and move towards graphs when thinking and working with our data. The first step is creating your model. This step is critical, and unfortunately, in my opinion, it is the least fun, mostly because this step is hard. We'd like to immediately be able to create cool network diagrams and query the data to find unique and innovative match-ups, but starting with the model is often the most non-intuitive, and over-looked step. So, while I want to jump into creating mind-blowing data visualizations, we are going to spend a bit more time with models and data entry. We want to ensure that you get the value in being able to generalize the problem you are mapping out. 

Building (and revising) your model

In our model building challenge, many people were able to easily grasp creating an Element Type - it is simply a way to categorize things. It is in sorting out how these categories of things are connected to each other where things start to get complicated. In fact, we had many models in our model building challenge that stalled after creating one or more Element types. 

Modeling the relationship between students and parents.

To illustrate what I mean by this, let's take the example from our knowledge graph blog-post in which  a teacher maps out the student-parent landscape. In your first review of building this model, you might think that the model would include Students, Mothers, and Fathers. However, if you have been a teacher for many years, your model will evolve as your students themselves become parents. In this case you can see that each one of these categories (Student, Mother, Father) - aka Element Types - could actually be described by a single category - Person. This illuminates one of the critical tenets in building a model: almost all of the complexity is in the connections, not in the Element Types themselves. 

The evolved version of this model might simply include one Element Type: Person, and then have distinct connections that describe the relationship between people (see image, left). One benefit of a graph database generally (and the Cognitive City specifically) is that you can add more information on the Element Type itself (i.e. gender) which allows you to add nuance to the model by capturing parent status (step- or bio-) in the connections.

What's next? Adding Data

The topic of adding data deserves a whole separate blog post (at least) so all I will say is that adding data allows you to test the rigor of your model. In the Cognitive City, creating the Element Type itself starts to populate a form by which you can manually add data. Adding properties to your Element Type (i.e. gender on People) and the relevant connections will also create fields on this form that can be customized to be understandable to other human beings. An example of a form from this model can be seen below.

The form itself helps to illustrate that the complexity is in the connections themselves. Once you have confirmed the veracity of your model by having entered information manually, it's best to upload the rest of the data in bulk.

Visualizing your Data

The best way to see if your model accurately maps to your situation is to view the data you have uploaded into the graph. This is where we start generating pretty pictures. Using the model that captures whether a parent is a biological parent or a step parent from the image earlier, a class of 35 students would look something like this:

Each person in this view is represented by a pink circle, and the various relationships are distinguished only by the text on the connections between each person. This view while a little complex, still tells us little about the nuance in the relationships at a glance. To make the relationships easier to visualize, what is required is styling the view such that you can distinguish the people and their relationships. The following view shows the gender of each person (by matching icons to the property: gender) as well as which people are students (gold nodes).

This view still doesn't illuminate students with a more complex relationship than a single biological mother and father. We can style the connections to to indicate parents that are biological (red lines) distinct from those that are step parents (green lines) and show which parents are married to each other (by shortening the length of the connections between married couples).

Sometimes understanding your data is best accomplished by representing it as a network diagram, but not always. The image below, while beautiful in its own way, is the perfect hairball. The data modeled here contains only people and the projects they are managing.


The power in using a knowledge graph is in being able to navigate hairballs like these and pull out the information you are most interested in. In fact, you engage with knowledge graphs every day without ever seeing nodes and edges. Your timeline or your feed is a linear (or not, to the chagrin of social media users), representation of the data in a knowledge graph. The cards presented to you while shopping online are another example of nodes in a knowledge graph. 

To see the many ways that data can be represented visually, check out the Living Systematic Review of COVID Data that can be found at iddo.cognitive.city.

The ethics of brain disorder.

An argument can be made that who you are and what you experience are constructs of your brain. What you see and hear and taste and smell and feel, while coming from your sensory organs, are processed, and "interpreted" in the brain. They are merely information that is processed by your brain and result in what could perhaps be called an arbitrary reality. And your brain can be fooled: optical illusions and tactile illusions are just two ways for you to demonstrate that your brain creates your reality.

So if you take the case, even if just for a moment, that your brain creates your reality - you can start to delve into the possibility that everything could (should?) be questioned. Your view of yourself, for sure - are you REALLY that way? Definitely your view of others and life should be questioned. What about your past? You already have several examples of how things didn't really go down as you remember. And it is becoming increasingly obvious that eye witness testimony is flawed, sometimes fatally. And what about your future? That you even think that your future exists (good or bad) demonstrates the wondrous ability of our brain to fabricate a reality.

One pitfall we all have (yes, even you) is thinking that you can distinguish what is real from what isn't. Have you ever awoken from a dream where you and your significant fought? And you were still upset late into the day with said person until you realized that the reason for your ire couldn't possibly be real - I mean, when have you ever had a pet dragon that they hated, much less secretly barbecued for your friends?

So where do ethics come in? One notion that deserves scrutiny is that we are fundamentally good and that when we do something bad, we did it on purpose. You might consider that our entire justice (punishment?) system is based on this notion. That we have an insanity defense is proof that the accepted perception is that 'normally' we can distinguish right from wrong, unless something is off with our brain.

If you are up for wading into the contradictions that may be starting to tingle your spidey-sense, I recommend reading David Eagleman's book - Incognito. In this book, Eagleman relates a story in which a man's penchant for child pornography is solely the result of his brain tumor. That a complex behavior could be the result of brain disfunction is astounding, and begs further inquiry into the behavioral effects of brain abnormality. Especially when you consider that the brain can be trained to do anything. ANYTHING. For further reading on the amazing ability of the brain to learn and relearn (even seemingly impossible) things, check out The Brain that Changes Itself by Norman Doidge.

If the brain creates a reality that includes how we interact with the world - is our prison system really the best way to habilitate a human being? This is a question that is so mired in "yeah, buts..." that it is vastly difficult to hold a reasonable discourse on it. But we can (should?) start to question how we think about people who have committed heinous crimes. Like Aaron Hernandez.

Aaron committed suicide at 27 years of age while he was in jail for murder, and he had C.T.E., Chronic traumatic encephalopathy - a persistent or long-standing neurological (brain) disorder induced by trauma. Hernandez was an embarrassment to his former team and they refunded thousands of fans who had purchased his jersey. The hidden communication behind all this could be interpreted as "We didn't realize how bad a human being this individual was and we are sorry".

How does one get C.T.E. and did this disease play a role in his criminal behavior? C.T.E. is caused by repeated trauma to the head, as is common amongst veterans or athletes such as boxers, WWE fighters and NFL players.

Much of what we know about the brain is through studies that reported functional or behavioral deficits after localized trauma. We know that trauma to the fore-brain can impact higher order functions such as decision-making and social cognition. People with damage to the amygdala are more likely to make decisions that do not take emotional processing into account.

Since we know that damage to the brain can result in personality changes that can have dire consequences, shouldn't we be putting attention on how best to eliminate those factors that can induce the worst kind of behavior in people?

Wait, what? Did I just say out loud that certain activities (like perhaps tackle football) may actually result in human beings committing heinous acts? There is a lot about the brain that we don't know, yet when there is compelling evidence that some activity has horrible consequences (don't get me started on global warming) shouldn't we take action to eliminate the risk?

Originally published at sciencebanter.blogspot.com