Graql Get Queries

A get query will search the knowledge base for anything that matches the given match part, returning a result for each match found. To follow along, or experiment further, with the examples given below, please load the basic-genealogy.gql file, which can be found in the examples directory of the Grakn installation zip, or on Github.

./grakn server start
./graql console -f <relative-path-to-Grakn>/examples/basic-genealogy.gql
match $x isa person; get;

You can also provide as arguments to get the variables you wish to see:

match $x has name $xn; ($x, mother: $y); $y has name $yn; get $xn, $yn;

    var("x").has("name", var("xn")),
    var().rel("x").rel("mother", "y"),
    var("y").has("name", var("yn"))
).get("xn", "yn");

Tags: graql