Tutorials for Using IBM System G Native Store on Bluemix

IBM System G Native Store provides various ways for users to explore property graphs. The following four links offer tutorials for users of different background/perspectives. Basically, 1) for regular users who want to take a glance at Native Store, go and enjoy the System G Lite tutorial; 2) for the users who plan to interactively try out the native store and understand its capabilities, he/she may want to go with the Interactive Tutorial; 3) for application users who plan to utilize Native Store in their applications/packages through REST APIs, the Application Tutorial is your choice; 4) for Gremlin users who want to explore native store through Gremlin/Groovy commands and scripts, go ahead to try the Gremlin Tutorial.






IBM System G Lite provides a GUI with graph visualization for regular users to feel IBM System G’s capability. An IBM ID (not internal IBM ID) is required for authentication. If you don't already have one, you can sign up here at no time. The Lite GUI consists of a control panel on the left hand side and a visualization area on the right. To come up with a simple solution using the System G Lite, a user can proceed as follows:

  1. Click the drop-down box of Dataset Selection to select a dataset, or upload your own dataset. Once a dataset is selected/uploaded, the graph topology appears in the visualization area.
  2. To create a new graph dataset, select “Create new” after clicking “Dataset selection”. There are 4 steps. Follow them one by one to select data file names. The data file should be in CSV format. Multiple CSV files can be used if the vertices/edges have different properties.
  3. More control items may be activated after the visualization of a graph, such as the Graph Query. Current version provides Query by Node Property, Query by Edge Property, and Query by Node Id.
  4. A user may click the Graph Query to select a query and receive more conditions applicable to the graph. Just following the drop down box to choose whatever you like to try. For example, we can build a rule by selecting “Degree” and “>” and inputing argument 2. Then, click the “Query” button to filter the graph by only keep the vertices with degree greater than 2. Multiple rules can be created and concatenated by “AND” or “OR” after clicking “Add rule”, or clicking “Add group” to have n nested rule.
  5. Hover the mouse onto the visualization area to see further property information on the vertices and edges.
  6. Click the drop-down menu on the top right of the visualization area to alter the visualization effects, such as applying node images, node border color, or link thickness.





Interactive Tutorial is for users who want to understand the capability of System G Native Store. It organizes a set of Native Store commands, basically following the sequence on normal graph operations, from graph creating, to graph data populating, and to graph queries. These commands can be interactive used for System G Native Store on a single machine, or in Server/Client mode across machines. The commands in the interactive tutorial is highly consistent with the REST APIs in the Application Tutorial and they can be well mapped to the Blueprints APIs. The interactive Tutorial consists of Graph Creation, Graph Queries. The former shows how to create a graph, populate graph data, and modify a graph; the latter allows users to performance various queries and perform graph analytics. There is the step-by-step tutorial on using the interactive tutorial.

  1. The tutorial is highly self-explained. Following the command one by one to see the command description, the command format, and the usage information.
  2. Click the green right triangle after each command to show a text window, where an example of the command has been typed in. Feel free to change the parameters or even the command, if necessary, and then click the submit button.
  3. The result from the Native Store is returned and shown after the command submission, which is in JSON format by default. Add an argument “—format plain” to display the messages in a more user friendly format.
  4. The command can be alternated and re-submit again, so that a user can observe the changes. Note that the result of re-submission depends on the previous executions. For example, if a graph has been created earlier, then an error message will be shown as a reminder.
  5. The commands are put in such an order in normal graph application use, from graph creation to data population and to query. Therefore, it is suggested that a user should go through the commands one by one. Otherwise, for example, if a user skip the steps of graph data population, then performing the query may simply get a warning that the queried vertex does not exist.





Application Developer APIs is for application developers who may want to invoke graph operations through REST APIs, which is language free. Therefore, regardless the programming language a user uses, he/she can leverage functionality in the native store.

Native store supports REST API in two forms: (1) the Tinkerpop Rexster format and (2) the native gShell format. The Tinkerpop Rexster is a third party component available in the open source community. The native gShell format is highly consistent with the commands shown in the Interactive Tutorial. Basically, the REST APIs are like this:

http://<server_name>?cmd=get_num_vertices&graph=<graph> 

for gShell, or for

http://<server_name>/graphs/<graph>/vertices?_cmd=count

To use the REST APIs, the user must be authenticated. Http basic access authentication is used to authenticate each REST API request. The content of the Http Authorization header that needs to be included in each REST API request is "Basic ", where

    <token> = BASE64_encode("<time>:<email>:<password>")
    <time> is Unix epoch time (Unix timestamp) in seconds
    <email> is the user's email address associated with the Bluemix account
    <password> is a user-specific secret key <key_user>

To get your own key_user, go to mybluemix.

The details of the REST APIs and their comparison against the gShell command in some tables list. The green fonts indicate our augmentation to the Basic REST API of Tinkerpop Rexster. For a POST or DELETE operation, the query string (i.e. the string after '?') must remain in the URI, while the body of the request can be empty.

All results are in JSON format. Note that not all command arguments described in gShell documentation are listed in the tables below. To add an additional argument --arg value, append &arg=value to the URI. Any single argument value containing space character(s) must be quoted.






Tinkerpop Gremlin Tutorial

Will be added soon..