In this Session…

Before you begin…

  • Using GraphXR’s Mapping Editor to model tabular data (CSV) as graph data.

To follow along, download the files: http://kineviz.com/s/GXR_QSG.zip


Slide

1

How To GraphXR 14. Data Mapping

2

Before You Begin…

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

3

If you regularly work with CSVs sharing a common data structure, it’s useful to be able to apply the same graph schema every time. This is accomplished by CSV mapping. Clear the graph space, then open the Query panel and CSV tab.

4

Click Load CSV, navigate to the Lines.csv file in your Game of Thrones dataset (GXR_QSG.zip) and select it.

5

The number of rows and columns in Lines.csv is displayed and a preview of the file is displayed below.

6

Click New to open the Mapping Editor and create a new mapping for this data. For this example, we’ll define the graph pattern:

(Words) - [spoken_on] - (Episode) and map wordCount, speaker, and seasonEpisode columns as properties.

7

In the Mapping Editor, click Add Category to define a category named Words based on data in the csv. In the Category name, enter Words. Now add its properties by selecting from the menu or clicking the + icon. We’ll add wordCount and speaker.

8

Click Add Category again to add an Episode category and seasonEpisode property.  We can rename properties, so we’ll just call it episode. Click As Key to have a single node created for each unique value of the property. Now let’s add a relationship.

9

Click the Add Relationship icon. Now click the source category (Words), then the target category (Episode). The relationship is created and given a default name based on the source and target you chose (Words_Episode).

10

In Relationship Name, rename the relationship spoken_on. We could also add and rename properties, but for this model we don’t need to.

11

Once you are satisfied with your mapping, use Save As to enter a name for new mapping and save it. Use Save for an  existing mapping you’ve edited.

12

You can also Export the mapping as a JSON file for use in other GraphXR projects.

13

When the mapping is saved, the editor window closes and the mapping appears in the Mapping dropdown menu. Click Apply to apply it to the CSV that you’ve loaded.

14

We’ve now applied our data mapping to the Lines.csv data.

15

Data can also be mapped and loaded from a relational database using SQL, from flat JSON files, or by using Gremlin.

16

Congratulations! By completing this learning series, you’re well on your way to mastering GraphXR!  We cordially invite you to join the Kineviz Community to share questions, insights and enthusiasm!

Next Steps…

  • Congratulations! You’ve now completed basic hands-on training for GraphXR!

  • Join the GraphXR community, to watch for new developments in GraphXR and its use.

  • Check out the Gallery.