Now You Node!

With so many new technologies, solutions, and projects sprouting daily, the graph database market is a bit like the wild, wild west.   Even with our 24 years of experience in the NoSQL database and Big Data space, we still have a hard time keeping track of it all. To combat the confusion in the market, and to educate our clients and prospects, we drafted a graph database comparison chart last year based on publicly available project/company and reference websites like Wikipedia, to explore the many different options and features within graph databases today.

We have since developed a publicly editable version of this graph database comparison chart located at  http://en.wikipedia.org/wiki/Graph_database and invite all community experts in graph database technologies to assist in maintaining the chart with the latest updates on features, benefits and new technologies.   We hope this will become a valuable, unbiased, reference to anyone looking for information on understanding and deploying a graph database solution.  

What Facebook’s Graph Search Means To The Graph Database Space


While the world may have been disappointed Facebook didn’t announce a phone, InfiniteGraph is head over heels about the Graph Search announcement.  Over the years our Objectivity teams have had several conversations with companies like Facebook, Ebay and LinkedIn about the power of the graph database and leveraging the graph to recognize opportunities in Big Data.  We have shown our customers that InfiniteGraph can go beyond 7 degrees of relationships to enable complex, distributed, customized searches within Big Data, farther than most solutions can go today. Heck, a year ago, we even showed you how to build your own Facebook graph search free! “Get started w/ our free FB sample @ http://ow.ly/gQsn9”.   … But the gold is in this line here: “The graph we’re talking about includes a billion people, 240 billion photos, and 1 trillion connections” Zuckerberg said according to Venturebeat .  InfiniteGraph is already analyzing connections between petabytes and exabytes of data in real-time. Objectivity’s solutions are able to analyze up to the equivalent of the Library of Congress in hours. 

 It’s Time for the Graph to Get Serious

A light has been shed on the power of the graph to move the Big Data space beyond management and slow analysis.  We have long known of the graph databases’ ability to manage larger volumes of complex data and provide real-time insight that is truly important – the discovery and understanding of the connections between people, places and content within data. And while InfiniteGraph recognized exponential sales and growth in 2012, with this single announcement the graph database just became a household name overnight.

 Now it’s time for this space to make accessing the graph simple for the world by establishing a single graph language that can help customers and the graph reach its true potential.  So graph database companies, are you ready?  Then let’s talk.

 

Visualizer as an Eclipse RCP application

Visualizer as an Eclipse RCP application

Contributed by Kevin Moody, Development Support Engineer For those that aren’t aware, InfiniteGraph’s Visualizer is an Eclipse RCP application. Why is this useful information, you ask? Well, this is helpful when you are having problems running the application in a particular environment. So, I’ll be going over how to: Configure the Visualizer runtime Specify the JVM that the Visualizer is run in Configure the Visualizer runtime First, let’s talk about configuration. I have multiple JRE and JDK version/bitness combinations of installs on my machine. So, how do I know which one the Visualizer will use? Also, how can I limit or increase the resources used by the Visualizer application? In order to modify these runtime properties, you must pass the appropriate parameters to the executable either via the command line or by editing its ini file. For this article, we will assume that we want to persist these changes for this machine, so we want to edit the ini file. The ini file can be found in the visualizer sub-directory of your installation: installdir/visualizer/IGVisualizer.ini You can find a list of the JVM properties available to put in this file at Eclipsepedia.  For instance, to pass arguments to the JVM (i.e. limit the maximum memory allowed, etc.), you should use the “-vmargs” option.  I won’t dive into all of the options available.  I am just going to go over the most important option,  “-vm”… Specify the JVM that the Visualizer is run in Being a native executable, the Visualizer must be run with the appropriate JRE bitness and version (i.e. the IG x64 requires a 64-bit JRE to run the Visualizer and...
InfiniteGraph: getNeighbors or getEdges?

InfiniteGraph: getNeighbors or getEdges?

Contributed by Asher Moody, Development Support Engineer When writing an application using IG you will likely run into a situation where you want to see who or what is connected to a particular vertex. For example, you could have a social network and want to see who a person’s friends are. When looking at the Vertex API you will see a few options: List<EdgeHandle> findEdgesToNeighbor(long neighborId) Retrieves a list of all edges that connect this vertex to a vertex with the given id. Iterable<EdgeHandle> getEdges() Retrieves an iterator for all edges connected to this vertex. Iterable<EdgeHandle> getEdges(Qualifier edgeQualifier) Retrieves an iterator for all edges connected to this vertex that satisfy the provided Qualifier. Iterable<Hop> getNeighborHops() Retrieves an iterator for all neighboring hops (edge-vertex pairs). Iterable<Hop> getNeighborHops(Qualifier qualifier) Retrieves an iterator for all neighboring hops (edge-vertex pairs) that satisfy the supplied Qualifier. Iterable<VertexHandle> getNeighbors() Retrieves an iterator for all neighboring (or adjacent) vertices. Iterable<VertexHandle> getNeighbors(Qualifier qualifier) Retrieves an iterator for all neighboring (or adjacent) vertices that satisfy the provided qualifier. boolean isNeighbor(long neighborId) Indicates whether a vertex with the given id is a neighbor of (or adjacent to) this vertex. The easiest choice would be to call getNeighbors to retrieve an iterator of the person’s neighbors. But what if they are also connected to groups, books, places, employers, schools, music, and movies? You aren’t interested in all that other stuff if you are just looking for their friends. You could pass in a Qualifier when you call getNeighbors to only search for neighbors of class Friend. It turns out that this might not always be the best solution. It all comes down to vertices and edges. Everything in IG is...
Everything Goes Better With Bacon

Everything Goes Better With Bacon

Contributed by Nick Quinn, Senior Software Developer, InfiniteGraph

Email: nquinn@objectivity.com

 

Whenever someone considers a large movie database like Internet Movie Database, or IMDB, inevitably the classic six degrees of Kevin Bacon problem comes up.  It is a famous problem posed like this, “…any individual involved in the Hollywood, California film industry can be linked through his or her film roles to actor Kevin Bacon within six steps” [http://en.wikipedia.org/wiki/Six_Degrees_of_Kevin_Bacon].  This problem even helped Kevin Bacon begin his own social charity organization called SixDegrees.org linking people with charities that they might be interested in.

Below is an example of how InfiniteGraph can be used to store and navigate through large sets of connected data like the IMDB.  In the example, I will show how to both find the links between various actors and Kevin Bacon, but also how to output the navigation results in various formats including JSON and GraphML.  Note: Custom navigator plugins and custom formatter plugins (including the default JSON/GraphML formatters) can be created and used in any InfiniteGraph (2.1) graph database instance.  See the InfiniteGraph developer wiki for more details and examples of how to write and use custom plugins (http://wiki.infinitegraph.com).

Here is a visualization of the actors connected to Kevin Bacon within just two degrees of separation (up to 1500 connections).

 

 

As you can see it can be rather tricky to find all of the connections, but if you go up to even 4 degrees, you may be overwhelmed with the results which is why the navigational features that InfiniteGraph offers are so powerful!

To create a navigator plugin that finds all paths between two actors. I first wrote a path and result qualifier which qualifies the paths based on certain given criteria. By using the navigator plugin, I can reuse this code and dynamically set field values (using the Parameter annotation) at runtime. Below is an example of the path qualifier, set using the PathQualifier annotation, which filters out all paths that are longer than the degree value.

package com.ig.samples.bacon;

import com.infinitegraph.navigation.Path;
import com.infinitegraph.navigation.Qualifier;
import com.infinitegraph.plugins.Parameter;
import com.infinitegraph.plugins.PathQualifier;

@PathQualifier
public class BaconPQ implements Qualifier
{
@Parameter(required=true)
public int degree = 3;

public boolean qualify(Path path)
{
if(path.size() <= degree)
return true;
else
return false;
    }
}

 

Below is an example of the result qualifier which uses the ResultQualifier annotation and filters out all paths that don’t have target vertex id as a final destination of the navigation. Notice that unless the targetId field value is set, the result qualifier will never qualify any results.

package com.ig.samples.bacon;

import com.infinitegraph.Vertex;
import com.infinitegraph.navigation.Path;
import com.infinitegraph.navigation.Qualifier;
import com.infinitegraph.plugins.ElementId;
import com.infinitegraph.plugins.ResultQualifier;

@ResultQualifier
public class BaconRQ implements Qualifier
{
@ElementId(required=true)
public long targetId;

public boolean qualify(Path path)
{
Vertex currentV = path.getFinalHop().getVertex();

if(currentV.getId() == targetId)
                return true;
else
                return false;    
    }
} 

 
If I jar up these two classes and import them into the InfiniteGraph application, I can use them to navigate through my data.  I call my navigator plugin jar, “BaconNavigator.jar”.

 
Here is how I begin to write the application to access and use my navigator plugin.  I connect to my IG instance of the IMDB.  I execute my navigator given a few different targets: Tom Cruise, Tom Hanks, and Emma Stone.

public static void main(String[] args) throws Exception
{
BaconSample sample = new BaconSample();
GraphDatabase database = null;
Map&#60String,String&#62 overrideMap = null;
try
{
overrideMap = new HashMap&#60String,String&#62();
overrideMap.put("IG.BootFilePath", "../");
//Get IMDB Connection
database = GraphFactory.open("Samples.IMDBGraphDB", "../Samples.properties", overrideMap);

//Output the navigations to json/graphml formats
sample.executeBaconNavigator(database, "Cruise, Tom", "Hanks, Tom", "Stone, Emma (III)");
}
finally
{
if(overrideMap != null)
overrideMap.clear();

logger.info("Closing connection.");
if(database != null)
database.close();
}
} 

 
Continuing the example, here is the code which pulls the vertex references for Kevin Bacon and all of my target actors from the manual index called “Person_names_index”. Also, it imports the navigator plugin, retrieves an instance of the navigator bundle from the plugin manager and sets the field value “targetId” with the value for a single target vertex id.  Finally, I can output the results of each navigation from Kevin Bacon to a given target vertex in JSON and GraphML format.

package com.ig.samples;

import java.io.FileOutputStream;[…]

public class BaconSample
{
public static final Logger logger = LoggerFactory.getLogger(BaconSample.class);

public void executeBaconNavigator(GraphDatabase database, String... targets) throws Exception
{
Transaction tx = null;
try
{
tx = database.beginTransaction();
// Get Kevin Bacon Vertex
GenericIndex&#60?&#62 actorsIndex = IndexManager.getGenericIndexByName("Person_names_index");
Vertex baconVertex = (Vertex) actorsIndex.getSingleResult("name", "Bacon, Kevin (I)");
Assert.assertNotNull("Unable to find Kevin Bacon.", baconVertex);

PluginManagementFactory factory = database.getPluginManagementFactory();
//Import Navigator Plugin
PluginManager&#60NavigatorBundle&#62 navManager = factory.getManager(NavigatorBundle.class);
boolean success = navManager.importPlugin("../BaconNavigator.jar", true);
if (!success)
{
logger.error("Unable to import navigator plugin");
return;
}
NavigatorBundle bundle = navManager.getBundle("BaconNavigator");
for(String target:targets)
{
//Get Target Vertex
Vertex targetVertex = (Vertex) actorsIndex.getSingleResult("name", target);
Assert.assertNotNull("Unable to find target vertex for "+target+".",targetVertex);
//Set target id as field value
bundle.setFieldValue(ResultQualifier.class, "targetId", targetVertex.getId());
//Output to JSON/GraphML file
String lastName = target.substring(0, target.indexOf(","));
if (bundle.isValid())
{
logger.info("Outputting navigation results to file.");
output(factory, baconVertex, bundle, "Bacon2" + lastName + ".txt", FormatterBundle.DEFAULT_JSON);
output(factory, baconVertex, bundle, "Bacon2" + lastName + ".xml", FormatterBundle.DEFAULT_GRAPHML);
}
}
}
finally
{
if (tx != null && !tx.isComplete())
{
tx.complete();
}
}
}
\\…
}

 
Finally, I am able to write the method which takes my navigator bundle, executes the navigator plugin on a start vertex (Kevin Bacon) and outputs the results of the navigation to file.  Because of the default formatter plugins packaged with the IG core, I can output the navigation results via standard JSON or GraphML.  Note: An output stream instance must be set in the format handler for the formatter to write. The output stream does not have to be to a file, but if not defined, an exception may be thrown.   The FormatterBridge class allows you to wrap a FormatHandler instance as a NavigationResultHandler.

public void output(PluginManagementFactory factory, Vertex startVertex, NavigatorBundle bundle, String fileName, String formatterPluginName) throws Exception
{
FileOutputStream fstream = null;
try
{
fstream = new FileOutputStream(fileName);
// Get Formatter Bundle
PluginManager&#60FormatterBundle&#62 formatManager = factory.getManager(FormatterBundle.class);
FormatterBundle formatter = formatManager.getBundle(formatterPluginName);
//Set output to file
formatter.getFormatHandler().setOutputStream(fstream);

//Run Navigator to output results to formatted file
Navigator navigator = startVertex.navigate(bundle.getGuide(), bundle.getPathQualifier(), bundle.getResultQualifier(), new FormatterBridge(formatter.getFormatHandler()));
navigator.start();
}
finally
{
if (fstream != null)
{
fstream.close();
}
}
}

Here is a snippet of the JSON and GraphML results from the Kevin Bacon to Tom Hanks navigation.

{"_type":"vertex","_id":"1970337852817561","name":{"value":"Bacon, Kevin (I)","type":"string"}}
{"_type":"vertex","_id":"1970337754251476","name":{"value":"Going to Pieces: The Rise and Fall of the Slasher Film","type":"string"},"year":{"value":2006,"type":"int"}}
{"_type":"edge","_weight":"0","_style":"undirected","_id":"1688862783242314","_outV":"1970337852817561","role":{"value":"Actor","type":"string"},"_inV":"1970337754251476"}
{"_type":"vertex","_id":"1970355046514947","name":{"value":"Hanks, Tom","type":"string"}}
{"_type":"edge","_weight":"0","_style":"undirected","_id":"1688875681841358","_outV":"1970355046514947","role":{"value":"Actor","type":"string"},"_inV":"1970337754251476"}
{"_type":"vertex","_id":"1970337728233639","name":{"value":"Boffo! Tinseltown's Bombs and Blockbusters","type":"string"},"year":{"value":2006,"type":"int"}}
Bacon, Kevin (I)Going to Pieces: The Rise and Fall of the Slasher Film2006ActorHanks, TomActorBoffo! Tinseltown's Bombs and Blockbusters2006ActorActorBeyond All Boundaries2009ActorProducerActorApollo 131995ActorActor

 

Here are the rest of the navigation results in both JSON and GraphML formats: baconbaked.zip

Enjoy your bacon!

 

Information courtesy of

The Internet Movie Database

(http://www.imdb.com).

Used with permission.

Tom Sawyer integration into InfiniteGraph

Tom Sawyer integration into InfiniteGraph

Contributed by Dan Hall, Systems Engineer

The Tom Sawyer visualization model integrates easily with the InfiniteGraph data model and APIs.

Developing applications to query InfiniteGraph databases and then display the results using Tom Sawyer is pretty straightforward. A simple approach to building an application would include the following steps:

1. Build a Java Swing user interface with all of the desired query capabilities needed to support querying the data in your InfiniteGraph database.

2. Leave room in your Swing interface for a JPanel that will serve as the home for the Tom Sawyer visualization.

3. Use the Tom Sawyer Perspectives Designer to define the visualization.

4. Modify the Swing user interface program to include a Tom Sawyer visualization object in the JPanel defined in step 2.

5. Modify your query results handling code to populate the Tom Sawyer visualization model with the results that come back from queries.

The mapping between the InfiniteGraph query results and the Tom Sawyer visualization model is the magic that renders the graph on the screen for users.

The Tom Sawyer API has a tremendous number of capabilities that can be used to create different types of visualizations. It supports multiple user-defined event handlers which allow you to write custom code to handle user interactions with the graph. For example, you can write a custom node expander and register it with the Tom Sawyer graph engine. When the user selects one or more nodes and clicks an expand icon within the Tom Sawyer panel, your nodeExpander method will get called and you can invoke the necessary InfiniteGraph operations to query those nodes to be expanded and add them to the Tom Sawyer model. Adding them to the model makes them appear in the graph.

Tom Sawyer integration into InfiniteGraph