Hello Sparksee

If have reached this chapter you should now have Sparksee correctly installed in your computer and be ready to work in your development framework.

You have previously been introduced to Sparksee APIs and you should have chosen the language with which you feel most familiar. Here we will explain the complete construction of the HelloSparksee application, including the building of the database plus your first queries. For each step in the development we will show an example using all the available Sparksee programming languages; just focus on your chosen language.

Let’s say Hello to Sparksee!

Setting up

The first step is the creation of a directory for this project and the new sample application in your development environment. We will come later in the compile and run chapter with certain modifications in the project in order to be able to run Sparksee.

As part of the setup, you could create a text file with the name “sparksee.cfg” (or any other name, if you explicitly load it) in the same folder where the executable file will be. This configuration file will establish the default Sparksee settings. This is not a required task, because you can modify these settings directly in the source code using the SparkseeConfig class methods.

These are the most common settings that you may want to set in this file:

A sparksee.cfg file could, for instance, look like this one:

sparksee.clientId=Your-client-id
sparksee.licenseId=Your-license-id
sparksee.io.cache.maxsize=2048
sparksee.log.file=HelloSparksee.log

Where Your-client-id and Your-license-id are the client UUID and license UUID provided by Sparsity Technologies when you acquired a license, the cache assigned for Sparksee is 2GB and the log file name is changed for HelloSparksee.log.

Following this guide we will construct the HelloSparksee example step by step, if you want to go faster, once you are done with the set up you can download the complete application, copy it in your sample application and jump to the compile and run chapter. However we recommend following the guide for a complete understanding of each of the steps of creating a graph database and querying it.

Let’s now finish the set up by moving from the directories to your development framework and start coding. Before starting to create your database you should first include references to Sparksee: this is mandatory.

[Java]
import com.sparsity.sparksee.gdb.*;
[C#]
using com.sparsity.sparksee.gdb;
[C++]
#include "gdb/Sparksee.h"
#include "gdb/Database.h"
#include "gdb/Session.h"
#include "gdb/Graph.h"
#include "gdb/Objects.h"
#include "gdb/ObjectsIterator.h"
[Python]
import sparksee
[Objective-C]
#import <Sparksee/Sparksee.h>
Back to Index