This document will teach you how to set up a Grakn environment, start it up and load a simple example.
Edit me

First: Download Grakn

download

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.

Install GRAKN.AI

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.

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.

./bin/graql.sh

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.

Visualising a graph

Further information about the visualiser can be found in Visualising a Graph.

Troubleshooting

If you do not see the above message, please check our FAQ page. If you have any questions, please ask a question on our discussion forum, or on Stack Overflow.

Where next?

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!

Comments

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.