
Grakn – The Database for AI - nikolay
https://grakn.ai/
======
dreamcompiler
Or you could just use prolog and then you wouldn't need to invent yet another
graph query language.

~~~
zmonx
Prolog indeed seems eminently suitable for this use case.

For example, let us consider the first use case shown on the page:

    
    
        graql>>
        match
        $x isa movie;
        $y isa person;
        $z isa movie value "Avatar";
        ($x, $y) isa directorship;
        ($y, $z) isa directorship;
        select $x;
    

This finds movies directed by the director of _Avatar_.

Here are a few relations in Prolog that we can use for this example:

    
    
        movie('Avatar').
        movie('Titanic').
        movie('Aliens').
        movie('Terminator 2: Judgement Day').
    
        person('James Cameron').
    
        directorship(X, Y) :- movie_director(X, Y).
        directorship(X, Y) :- movie_director(Y, X).
    
        movie_director('Avatar', 'James Cameron').
        movie_director('Titanic', 'James Cameron').
        movie_director('Aliens', 'James Cameron').
        movie_director('Terminator 2: Judgement Day', 'James Cameron').
    

These are Prolog _facts_ and _rules_ that suffice to illustrate this use case.

In Prolog, we can _query_ this database as follows:

    
    
        ?- findall(X, (movie(X),
                       person(Y),
                       movie(Z), Z = 'Avatar',
                       directorship(X, Y),
                       directorship(Y, Z)), Xs).
    

Note how closely this query corresponds to the initial example!

Prolog answers with:

    
    
        Xs = ['Avatar', 'Titanic', 'Aliens', 'Terminator 2: Judgement Day'].
    

Note that this is in fact more complete than what the example shows:

    
    
        results>>
        [
          {"isa": "movie", "value": "Titanic"},
          {"isa": "movie", "value": "Aliens"},
          {"isa": "movie", "value": "Terminator 2: Judgement Day"}
        ]
    

Interestingly, this _misses_ _Avatar_!

~~~
doctormiko
Hi, Grakn developer here. In fact you have just caught a mistake in our
website! If you run that query on a live system, it will return Avatar: we
missed a line in the example query specifying that we want movies _different_
from Avatar. We will fix the website asap

------
rspeer
Does "distributed" mean it _can_ run efficiently on multiple computers, or
that it _requires_ multiple computers to run efficiently?

I've seen too many graph databases that say "oh no, you need a cluster" when
presented with graphs that fit easily on a disk but not in RAM.

If I have 30 million annotated edges on one computer, will this be faster or
slower than PostgreSQL at importing and querying the data?

~~~
domenico_c
Grakn developer here. That's interesting, do you have any particular graph
database in mind?

Grakn runs fine on a single machine. One of the core architectural points is
that the engine should not be too tightly bound to the storage layer.
Currently we rely on Cassandra for storage but we are experimenting with other
solutions.

The answer to your last question depends on what query you are performing. If
the domain you are modelling is represented naturally as a graph, then you can
expect much better performance than PostgreSQL (we'll publish some benchmark
results soon).

