<commit_before>---
title: Quickstart Tutorial
keywords: setup, getting started
tags: [getting-started, graql]
summary: "This document will work through a simple example using the Graql shell to show how to get started with GRAKN.AI."
sidebar: documentation_sidebar
permalink: /docs/get-started/quickstart-tutorial
folder: docs
---

## Summary

This example takes a simple genealogy dataset and briefly reviews its schema, then illustrates how to query, extend and visualise the knowledge graph, before demonstrating reasoning and analytics with Graql.

## Introduction

If you have not yet set up GRAKN.AI, please see the [Setup guide](./setup-guide). In this tutorial, we will load a simple schema and some data from a file, *basic-genealogy.gql* and use the Graql shell and Grakn visualiser to illustrate some key features of GRAKN.AI.

## The Graql Shell

The first few steps mirror those in the [Setup Guide](./setup-guide), and you can skip to [The Schema](#the-schema) if you have already run through that example. Start Grakn and load the example knowledge graph:

```bash
./grakn server start
./graql console -f ./examples/basic-genealogy.gql
```

{% include note.html content="Above, we are invoking the Graql shell and passing the -f flag to indicate the file to load into a knowledge graph. This starts the Graql shell in non-interactive mode, loading the specified file and exiting after the load is complete.
If you are interested, please see our documentation about other [flags supported by the Graql shell](./graql-console)." %}

Then start the Graql shell in its interactive (REPL) mode:

```bash
./graql console
```

You will see a `>>>` prompt. Type in a query to check that everything is working:

```graql   
match $x isa person, has identifier $n; get;
```

You should see a printout of a number of lines of text, each of which includes a name, such as "<NAME>" or "<NAME>".

### The Schema

You can find out much more about the Grakn schema in our documentation about the [Grakn knowledge model](../knowledge-model/model), which states that

> "The schema is a formal specification of all the relevant concepts and their meaningful associations in a given application domain. It allows objects and relationships to be categorised into distinct types, and for generic properties about those types to be expressed".

For the purposes of this guide, the schema describes items of data and defines how they relate to one another. You need to have a basic understanding of the schema to be able to make useful queries on the data, so let's review the chunks of it that are important for our initial demonstration:

```graql-test-ignore
define

# Entities

person sub entity
  plays parent
  plays child
  plays spouse1
  plays spouse2

  has identifier
  has firstname<commit_msg>Put the test back<commit_after>---
title: Quickstart Tutorial
keywords: setup, getting started
tags: [getting-started, graql]
summary: "This document will work through a simple example using the Graql shell to show how to get started with GRAKN.AI."
sidebar: documentation_sidebar
permalink: /docs/get-started/quickstart-tutorial
folder: docs
---

## Summary

This example takes a simple genealogy dataset and briefly reviews its schema, then illustrates how to query, extend and visualise the knowledge graph, before demonstrating reasoning and analytics with Graql.

## Introduction

If you have not yet set up GRAKN.AI, please see the [Setup guide](./setup-guide). In this tutorial, we will load a simple schema and some data from a file, *basic-genealogy.gql* and use the Graql shell and Grakn visualiser to illustrate some key features of GRAKN.AI.

## The Graql Shell

The first few steps mirror those in the [Setup Guide](./setup-guide), and you can skip to [The Schema](#the-schema) if you have already run through that example. Start Grakn and load the example knowledge graph:

```bash
./grakn server start
./graql console -f ./examples/basic-genealogy.gql
```

{% include note.html content="Above, we are invoking the Graql shell and passing the -f flag to indicate the file to load into a knowledge graph. This starts the Graql shell in non-interactive mode, loading the specified file and exiting after the load is complete.
If you are interested, please see our documentation about other [flags supported by the Graql shell](./graql-console)." %}

Then start the Graql shell in its interactive (REPL) mode:

```bash
./graql console
```

You will see a `>>>` prompt. Type in a query to check that everything is working:

```graql   
match $x isa person, has identifier $n; get;
```

You should see a printout of a number of lines of text, each of which includes a name, such as "<NAME>" or "<NAME>".

### The Schema

You can find out much more about the Grakn schema in our documentation about the [Grakn knowledge model](../knowledge-model/model), which states that

> "The schema is a formal specification of all the relevant concepts and their meaningful associations in a given application domain. It allows objects and relationships to be categorised into distinct types, and for generic properties about those types to be expressed".

For the purposes of this guide, the schema describes items of data and defines how they relate to one another. You need to have a basic understanding of the schema to be able to make useful queries on the data, so let's review the chunks of it that are important for our initial demonstration:

```graql
define

# Entities

person sub entity
  plays parent
  plays child
  plays spouse1
  plays spouse2

  has identifier
  has firstname
{'fraction_non_alphanumeric': 0.06513958482462419, 'fraction_numerical': 0.0007158196134574087, 'mean_word_length': 4.333015267175573, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3829374', 'n_tokens_mistral': 1478, 'n_tokens_neox': 1391, 'n_words': 828}