If you have followed the Academy lessons up to this point, you should have loaded all the example dataset into a new knowledge base, which is now exactly the same as the one that came preloaded with the Grakn distribution in the VM.
First of all: well done!
But you are not done yet: we now need to start using this knowledge base and add a pinch of Grakn magic and turn what is essentially a powerful database into a true knowledge base ready for development of cognitive systems.
It is time for some logic inference.
Back to the query
Since from the beginning of module 2, you should have learned that the questions you have built your knowledge base around translate into Graql as
match $article isa article has subject "Italian Referendum"; $platform isa oil-platform has distance-from-coast <= 18; (location: $country, located: $platform) isa located-in; $country isa country has name "Italy"; (owner: $company, owned: $platform) isa owns; (issuer: $company, issued: $bond) isa issues; limit 3; get $bond, $article;
And if you run it into the graph visualiser you will notice that you do get the results expected (i.e. the articles about the Italian referendum and the bonds that might be affected by them), but they are not linked together.
In this module, we will use Grakn inference engine to make so that Grakn fixes this. All without actually modifying your data.
Introduction to logic inference
Let us start this section with a small puzzle:
In a small almost deserted island, there is one small hut on the beach. Alice is currently in the hut, while Bob is somewhere else on the island. There is nobody else.
Who is on the island? Notice that this is not a trick question.
The simple answer is, of course, Alice and Bob.
The problem is that the answer is simple only if you are a human.
Let us try to break the question in smaller steps:
There are two people, Alice and Bob
Alice is currently in a hut
Bob is on the island
The hut is on the island
This is all the information I gave you. What your brain did in answering the question is adding the information that if a person is somewhere that is on the island, then that person is on the island as well.
A computer would not know that, and if you asked the same question to a regular database, you would only get Bob as a response (because we know that Bob is on the island).
Unless you ask explicitly for all the people that are on the island OR somewhere which is on the island (but what happens if Charlie is in the kitchen of the hut then?).
Or unless you have a reasoner engine, like Grakn has.
In the course of this module, you will learn how to augment your knowledge base with reasoning rules that help you get more useful and smart answer to your questions, like the one above.
That is, you will learn to make your data more intelligent and knowledgable. Which is one of the reason why say that Grakn is the database for the knowledge engineering.
What have you learned?
This was a very brief introductory lesson, but you should have at this point understood what logic inference is about.
In the next lesson, we will learn how to add Graql inference rules to your knowledge base; as you will see, it is a very simple yet powerful process. If you are impatient and what to know everything immediately, you can learn more about Grakn Reasoner from the docs.