Skip to main content
Skip table of contents

4. Link and Filter

In this Session…

Before you begin…

  • Using Link to create new edges.

  • Using the Degree Centrality algorithm to Filter data.

  • Using Snapshots to save data.

Download the tutorial files:
HowTo_04_START_GOT.graphxr.zip

https://kineviz.com/s/GXR_QSG.zip


Slide

1

How To GraphXR 4. Link and Filter

2

Before You Begin…

Ideally, you’ll have worked through Module 3. Properties and Extract. If you’re starting here, and you want to follow along, you’ll need to:

  • Log in to GraphXR, create a Project, and open its graph space. 

  • Download the file https://kineviz.com/s/GXR_QSG.zip, which contains the Game of Thrones data we’ll use in our tutorials.

  • Download the starting data (HowTo_04_START.graphxr) for this module and drag and drop it onto the graph space.  

3

So far, we’ve extracted a House category from the Characters.csv data and created a BELONGS_TO relationship linking House to Character nodes.

4

Drag and drop Lines.csv onto the project. It includes the number of lines and words spoken by each character in every episode of HBO’s Game of Thrones. Go ahead and zoom out—at over 3,000 nodes, Lines.csv is a much larger dataset than Characters.csv.

5

Open the Table panel to view Lines data in a spreadsheet format. Under the Category tab click the Lines bubble and locate the speaker property.

6

With the Link transform, properties with equivalent values can be linked even if the property names are different.
In the Characters category, the characterName property is equivalent to the Lines’ speaker property– which lets us link characters to the number of lines they spoke on each episode. 

7

Open the Transform panel => Link  tab. Here’s where we’ll create edges of either a new or an existing relationship. Enter a Characters-SPOKE-Lines pattern with a source property of characterName and target property of speaker. Now click Run.

8

You’ll notice many Lines nodes with no connections. These correspond to lines spoken by characters who weren’t in the Characters.csv source data. We’ll remove these extraneous nodes.

9

But first let’s save our graph state in memory using Snapshots. We use it to create a local library of graph states that can be downloaded as a .zip archive.  Open the Project panel and Settings tab and click the Show Snapshot checkbox.

10

The title bar of the Snapshots dialog appears in the project space. Click the plus sign to capture a Snapshot.
(Data Views are similar, but are saved to the GraphXR server). 

11

Click the arrow icon on the left to show the list of snapshots you’ve taken so far. Notice that you can save your snapshots archive locally at any time. 

12

Now let’s return to cleaning up our graph. We’ll use the Degree centrality algorithm to flag nodes with no connections, then select and delete them.
In the Algorithm panel and Centrality tab, click the Degree button.  

13

The algorithm writes the number of connections for each node to a new degree property. We can see it in the Property tab, and in the Table panel and Lines category.

14

Now let’s remove nodes with a degree of 0. With the legend’s Property tab selected, select the Lines category and degree property from the dropdown menu.

15

Locate the Linesdegree value of 0, click to select those nodes and press the delete key (or the Delete toolbar icon, or Delete in the right-click menu).

16

Only nodes with at least one connection now remain.

17

We can do the same thing using a Filter. Load the snapshot we took, and run the Degree algorithm again.

18

Now open the Filter panel, and choose the degree Node Property. Enter ‘0’ as the Max value, to filter out any node with degree greater than zero.

19

Click Select Visible Nodes, and click the trash icon to delete the filter and restore data to the graph that has degree greater than zero.

20

Now dismiss the Filter panel and delete the selected nodes. Either right-click and select Delete, click the Delete toolbar icon, or simply press the keyboard delete key 

21

What’s left are the nodes that have at least one connection. Let’s take another snapshot and download the snapshot archive (or save a data View or a GXRF file).
Next in Module 5. Aggregate, Merge, and f(x) we’ll work with Episodes.csv, , which includes data about the series episodes.

Next Steps…

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.