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 construction 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!
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:
sparksee.license : This option is used to set your commercial license key. By default you do not need to provide a license key.
sparksee.io.cache.maxsize : Sets the maximum size for the cache (all pools) in megabytes. By default Sparksee uses all the available memory, leaving enough memory for other needs. If you are running several memory consuming applications at the same time you must consider adjusting this parameter.
sparksee.log.file : Changes the log file path. The default value is
sparksee.log.level : The level of detail provided by the log file can be modified with this option. Valid values are:
Debug. The default level is
Info. For HelloSparksee you will not need to change this level.
sparksee.cfg file could, for instance, look like this one:
sparksee.license=Your-license-key sparksee.io.cache.maxsize=2048 sparksee.log.file=HelloSparksee.log
Your-license-key is the alphanumeric key provided by Sparsity Technologies when you acquire a license, the cache assigned for Sparksee is 2GB and the log file name is changed for
Following this guide we will construct HelloSparksee 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.
#include "gdb/Sparksee.h" #include "gdb/Database.h" #include "gdb/Session.h" #include "gdb/Graph.h" #include "gdb/Objects.h" #include "gdb/ObjectsIterator.h"