First: Download Grakn
For more information on how to download older versions of GRAKN.AI, compile from source code, or import the Grakn Java API library as a development dependency, please visit our Downloads page.
GRAKN.AI requires Java 8 (Standard Edition) with the
$JAVA_HOMEset accordingly. If you don’t already have this installed, you can find it here.
If you intend to build Grakn, you will also need Maven 3.
Unzip the download into your preferred location and run the following in the terminal to start Grakn:
cd [your Grakn install directory] ./bin/grakn.sh start
This will start an instance of Cassandra, which serves as the supported backend for Grakn. It starts also Grakn Engine, which is an HTTP server providing batch loading, monitoring and the browser dashboard.
To start Grakn, run
To stop Grakn, run
grakn.sh stop. To remove all graphs from Grakn, run
Test the Graql Shell
Graql is our knowledge-oriented query language, which allows you to interface with Grakn. To test that the installation is working correctly, here we will start the Graql shell and enter a few lines of code.
The Graql shell starts and you see a
>>> prompt. Type in the following, but don’t worry too much about what it means right now. We will go through it further in the Quickstart Tutorial.
insert person sub entity; insert name sub resource, datatype string; insert person has-resource name; insert isa person, has name "Topsy"; insert isa person, has name "Tim"; commit match $x isa person, has name $n; select $x, $n;
Then, you should see the following (although the long strings of numbers will be different):
$x id "ENTITY-person-89b823a0-606d-434d-a533-1e172b90c7bc" isa person; $n value "Topsy" isa name; $x id "ENTITY-person-afd29319-ff33-4b0c-b7e3-63d04ac81dcf" isa person; $n value "Tim" isa name;
If you do see the above output then congratulations! You have set up Grakn.
You can now open localhost:4567 in your browser to start the visualiser, which provides a graphical dashboard on a graph.
Further information about the visualiser can be found in Visualising a Graph.
Our Quickstart Tutorial will show you how to load populate and query Grakn using Graql.
You can find additional example code and documentation on this portal. We are always adding more and welcome ideas and improvement suggestions. Please get in touch!
Want to leave a comment? Visit the issues on Github for this page (you’ll need a GitHub account). You are also welcome to contribute to our documentation directly via the “Edit me” button at the top of the page.