Cognitive/AI systems process knowledge that is far too complex for current databases. They require an expressive data model and an intelligent query language to perform knowledge engineering over complex datasets.
In this talk, we will discuss how Grakn, a database to organise complex networks of data and make it queryable, provides the knowledge graph foundation for intelligent systems to manage complex data.
We will discuss how Graql, Grakn's reasoning (through OLTP) and analytics (through OLAP) query language, provides the tools required to do the job: a knowledge schema, a logical inference language, a distributed analytics framework.
And finally, we will discuss how Graql’s language serves as unified data representation of data for cognitive systems.
Introduction to Knowledge Graphs with Grakn and Graql
1. Tomás Sabat Stöfsel
Introductionto Knowledge Graphs with
Grakn and Graql
Welcome everyone! Please leave your name and where you’re calling in from in
the chat.
2.
3.
4. Civilization advances by extending the
number of important operations we can
perform without thinking about them.
-- Alfred North Whitehead
Author of Principia Mathematica
7. Inspiration
𝑖𝑛𝑠𝑡𝑎𝑛𝑐𝑒 𝑎, 𝑋 ⇒ 𝑎 ∈ 𝑋
Mammal
Human Cat
Alice Bob
sub sub
instance instance
𝑖𝑛𝑠𝑡𝑎𝑛𝑐𝑒 𝐴𝑙𝑖𝑐𝑒, 𝐻𝑢𝑚𝑎𝑛 ⇒ 𝐴𝑙𝑖𝑐𝑒 ∈ 𝑀𝑎𝑚𝑚𝑎𝑙
𝑖𝑛𝑠𝑡𝑎𝑛𝑐𝑒 𝐵𝑜𝑏, 𝐶𝑎𝑡 ⇒ 𝐵𝑜𝑏 ∈ 𝑀𝑎𝑚𝑚𝑎𝑙
𝑠𝑢𝑏 𝑋, 𝑌 ⇒ 𝑋 ⊆ 𝑌
Knowledge Representation (KR): a system to encode domain knowledge consistently, for
logical interpretation, potentially by a computer
8. Inspiration
𝑖𝑛𝑠𝑡𝑎𝑛𝑐𝑒 𝑆𝑜𝑐𝑟𝑎𝑡𝑒𝑠, 𝑀𝑎𝑛 ⇒ 𝑆𝑜𝑐𝑟𝑎𝑡𝑒𝑠 ∈ 𝑀𝑎𝑛
𝑆𝑜𝑐𝑟𝑎𝑡𝑒𝑠 ∈ 𝑀𝑜𝑟𝑡𝑎𝑙
𝑠𝑢𝑏 𝑀𝑎𝑛, 𝑀𝑜𝑟𝑡𝑎𝑙 ⇒ 𝑀𝑎𝑛 ⊆ 𝑀𝑜𝑟𝑡𝑎𝑙
Automated Reasoning (AR): a system to derive logical conclusions from two or more
propositions that are believed to be true
Man
“Socrates”
sub
instance
Mortal
16. Inspiration Problem
Type Hierarchies
Animal
Mammal Reptile
sub sub
Human Cat
sub sub
Crocodile
sub
Employment
Temporary
Employment
Permanent
Employment
sub sub
Entity Type Hierarchies Relation Type Hierarchies
25. Inspiration Problem
Which movies and actors in the same network (cluster)?
Titanic
Kate
Leonardo
Scarface
Al Pacino
The Godfather
cast
cast
cast cast
26. Inspiration Problem
Which movies and actors in the same network (cluster)?
Titanic
Kate
Leonardo
Scarface
Al Pacino
The Godfather
cast
cast
cast cast
”Connected-Component” (Clustering) Pregel
Algorithm
Reference
implementatio
n is 200+ lines
of Java code
27. Inspiration Problem
BSP (MapReduce & Pregel) algorithms become hard to reuse
Titanic
Kate
Leonardo
Scarface
Al Pacino
The Godfather
cast
cast
cast cast
32. Inspiration Problem Cause
Current database languages are too low-level
to handle complexity
Could not model complex domains
Could not simplify verbose queries
Could not reuse analytics algorithms
35. Inspiration Problem Cause Solution
Grakn & Graql
A Knowledge Representation System and Language
A 5th Generation Language
A [query] language to declare logic & constraints to the computer, rather
than to instruct algorithms
36. Inspiration Problem Cause Solution
The Knowledge Model
A knowledge schema needs to represent:
type hierarchies, hyper-relations and rules
Thing
Entity Attribute Relation Role
sub sub subhas plays
relates
sub sub sub sub
Rule
38. Inspiration Problem Cause Solution
company person
employment
name
has has
employer employee
startup customer
sub sub
39. Inspiration Problem Cause Solution
company person
employment
name
has has
employer employee
startup customer
sub sub
has
sub
has
sub
40. Inspiration Problem Cause Solution
company person
employment
name
has has
employer employee
startup customer
sub sub marriage
husband
wife
41. Inspiration Problem Cause Solution
person: Alice customer: Bob
company: IBM
startup: Grakn
e
e
m
employer
employer
employee
employee
wife husband
commit: success
56. The difference is the number of important operations
we can perform without thinking about them
57. Inspiration Problem Cause Solution
Which movies and actors in the same network (cluster)?
Titanic
Kate
Leonardo
Scarface
Al Pacino
The Godfather
cast
cast
cast cast
”Connected-Component” (Clustering) Pregel
Algorithm
Reference
implementatio
n is 200+ lines
of Java code
58. Inspiration Problem Cause Solution
Which movies and actors in the same network (cluster)?
Titanic
Kate
Leonardo
Scarface
Al Pacino
The Godfather
cast
cast
cast cast
”Connected-Component” (Clustering) Pregel
Algorithm
59. Inspiration Problem Cause Solution
BSP (MapReduce & Pregel) algorithms as native Graql OLAP queries
Titanic
Kate
Leonardo
Scarface
Al Pacino
The Godfather
cast
cast
cast cast
More to come:
PageRank, Triangle
Count, Density,
Cliques, and so on
60. Inspiration Problem Cause Solution
What makes Grakn a Knowledge Base (aka. Knowledge Graph)
Knowledge schema
Flexible Entity-Relationship
concept-level schema to build
build knowledge model
Automated Reasoning
Automated deductive reasoning
Distributed Analytics
Automated distributed algorithms
algorithms (BSP) as a language
language (OLAP)
Higher-Level Language
Strong abstraction over low-level
level constructs and
complex relationships
62. Inspiration Problem Cause Solution
What’s our progress?
Schema: expressive constructs to build knowledge models
63. Inspiration Problem Cause Solution
What’s our progress?
Schema: expressive constructs to build knowledge models
Language: simple language to write expressive queries
64. Inspiration Problem Cause Solution
What’s our progress?
Schema: expressive constructs to build knowledge models
Language: simple language to write expressive queries
Reasoning: deductive logic to eliminate permutative queries
65. Inspiration Problem Cause Solution
What’s our progress?
Schema: expressive constructs to build knowledge models
Language: simple language to write expressive queries
Reasoning: deductive logic to eliminate permutative queries
Architecture: distributed server and multi-language clients
66. Inspiration Problem Cause Solution
What’s our progress?
Schema: expressive constructs to build knowledge models
Language: simple language to write expressive queries
Reasoning: deductive logic to eliminate permutative queries
Architecture: distributed server and multi-language clients
Build: multi-repo build-test-release automation system
67. Inspiration Problem Cause Solution
What’s our progress?
Schema: expressive constructs to build knowledge models
Language: simple language to write expressive queries
Reasoning: deductive logic to eliminate permutative queries
Architecture: distributed server and multi-language clients
Build: multi-repo build-test-release automation system
Performance: query throughput and execution at scale
68. Inspiration Problem Cause Solution
What’s our progress?
Schema: expressive constructs to build knowledge models
Language: simple language to write expressive queries
Reasoning: deductive logic to eliminate permutative queries
Architecture: distributed server and multi-language clients
Build: multi-repo build-test-release automation system
Performance: query throughput and execution at scale
Analytics: robust BSP (OLAP) algorithms at scale
70. Inspiration Problem Cause Solution Applications Future
“ForacomputertopassaTuringTest,itneedsto
possess:
- Natural LanguageProcessing,
- KnowledgeRepresentation,
- Automated Reasoning, and
- MachineLearning”
Peter Norvig (Research Director, Google) and Stuart J. Russell (CS
Professor, UCBerkeley),“Artificial Intelligence: A Modern
Approach”, 1994
71. Inspiration Problem Cause Solution Applications Future
Comprehension and production of
language: communication
Natural Language Processing
Reasoning, problem solving, logical
deduction, and decision making
Automated Reasoning
Expression, Conceptualisation, memory
and understanding
Knowledge Representation
Judgment and evaluation:
To adapt to new circumstances and
to detect and extrapolate
new patterns
Machine Learning
Information Retrieval, Natural
Language Understanding:
User data, Enterprise data,
Financial data, Web data, etc.
Knowledge Acquisition
72. Inspiration Problem Cause Solution Applications Future
Comprehension and production of
language: communication
Natural Language Processing
Storage of knowledge (i.e.
complex information), and
retrieval of explicitly stored data
and derive new conclusions.
Knowledge Base/Graph
Judgment and evaluation:
To adapt to new circumstances and
to detect and extrapolate
new patterns
Machine Learning
Information Retrieval, Natural
Language Understanding:
User data, Enterprise data,
Financial data, Web data, etc.
Knowledge Acquisition
73. Inspiration Problem Cause Solution Applications Future
Natural Language Processing
Knowledge Base/Graph Machine LearningKnowledge Acquisition
74. Inspiration Problem Cause Solution Applications Future
Natural Language Processing
Knowledge Base/Graph Machine LearningKnowledge Acquisition
75. Thank you for attending this webinar!
Follow us on:
@graknlabs @tasabat
Join our chatroom on:
https://discord.gg/graknlabs
Editor's Notes
Reflexive relation on set is a binary element in which every element is related to itself.
A symmetric relation is a type of binary relation. An example is the relation "is equal to", because if a = b is true then b = a is also true. Formally, a binary relation R over a set X is symmetric if and only if:
As a nonmathematical example, the relation "is an ancestor of" is transitive. For example, if Amy is an ancestor of Becky, and Becky is an ancestor of Carrie, then Amy, too, is an ancestor of Carrie.