Relational to Graph Database in Ten Minutes Flat

by Stephen Young

September 28, 2017 9:30 PM

Relational to Graph Database in Ten Minutes Flat

The Graph DBMS - it's a technology with real promise. Reduce schema bloat, discover and manage new and useful relationships, perhaps get some much-needed speed when querying highly-related data. It's a story that's seduced thousands of developers to try a Graph DBMS, but for most it's been a frustrating experience.

Why? The data-as-a-graph paradigm is just too different from the Relational Databases they're used to, that they're going to continue to use, and that are going to manage the bulk of their data for the forseeable future.The gap is too big - and there's been no way to bridge it.

RapidGrapher is our first in a set of solutions designed to address this paradigm mismatch. It lets you turn your relational data into a graph, experiment with it, and perhaps solve some of your most vexing data-related problems.

Let's take a look at how it works.

To turn your relational data into a graph, We first need to re-map the relations encoded into the RDBMS schema of your source data. The joins represented by foreign key relationships will be a factor, but most relationships in an RDBMS are encoded into table schemas.

Each cell in a table becomes a vertex, then that vertex connects to it's column name and to one or more of the other fields of its row.

RapidGrapher lets you specify a "Grapher Template" file to control how those relationships are mapped within GraphBase, but the quickest and simplest way to get started is to let RapidGrapher generate one for you. The template generated by default builds a simple leaf framework using table column names, and uses the first field in each row as a "hub" to connect that row.

To load data using its defaults, RapidGrapher needs to know...
1) The RDBMS(s) that contain the data.
2) The provider-specific Java library (and Class) used to connect with that RDBMS.
3) The URL, port, user name and password for the RDBMS connection.
4) The Relevant Databases within that RDBMS.
5) The Tables or Views that we want to include in our data graph.

We specify these using an XML file. The Samples directory of your Agility download contains an example - SampleGrapherSources.xml - which illustrates how to structure the document.

This sources file includes some sample references to static files (which we'll delete for this exercise), and references to the MySQL "Sakila" sample database.

Once you've made the necessary modifications to your GrapherSources XML document, fire up RapidGrapher from the "Tools" menu of your Agility Console. Make sure you first "Load Credentials" from the Actions menu - then select your XML document, and click "load". Your Console window will report on progress and let you know when the load is complete.

Get FactNexus News