+ All Categories
Home > Technology > Building a recommendation engine with tinker pop

Building a recommendation engine with tinker pop

Date post: 28-Jan-2018
Category:
Upload: otavio-goncalves-de-santana
View: 461 times
Download: 1 times
Share this document with a friend
32
Building a recommendation engine with TinkerPop Otávio Santana @otaviojava [email protected] [email protected]
Transcript

Building a recommendation engine with TinkerPop

Otávio Santana@[email protected]@apache.org

NoSQL● Database● Doesn't use structure● Not Transaction● BASE● Types

Graph

● Neo4j● InfoGrid● Sones● HyperGraphDB

Apollo Ares

Kratoswas killed by was killed by

Is brother

killed killed

SQL Key-value Document Column Graph

Table Bucket Collection Column Family

Vertex and Edge

Row Key/value pair

Document Column Vertex

Column Key/value pair

Key/value pair

Vertex and Edge property

Relationship Link Edge

Scalability vs Complexity

Scalability

Complexity

Scalability vs Complexity

Scalability

Complexity

key-value

Column

Document

Graph

Graph

Grace Hopper

label Person

id ada

name Ada Lovelace

occupation scientist

Ada Lovelace

label Person

id grace

name Grace Hopper

occupation scientist

Knows

Vertex Vertex

Edge

Graph

Radioactive

label Person

id marie_curie

name Marie Curie

occupation scientist

Marie Curie

label nature

id radioactive

name Radioactive

discovers

when 1867

where Europe

Graph Database

TinkerPop

TinkerPop

Grace Hopper

label Person

id grace

name Grace Hopper

occupation scientist

Vertex

grace = graph.addVertex( T.label, "person", "id", "grace", "name", "Grace Hopper", "occupation", "scientist");

TinkerPop

Grace Hopper

Ada Lovelace

Knows

grace.addEdge("knows", ada);

Edges

Out ->

In <-

Both

Marketing Campaign● Engineer● Salary 3000● Age between 20 and 25 years ● Man

SQLId name Occupation Salary age gender

... ... ... ... ... ...

SELECT * FROM Person WHERE

occupation = "Engineer" AND

salary > 3000 and age BETWEEN 20

AND 25

TinkerPopGrace Hopper

Ada Lovelace

Knows

g.V().has("occupation","Engineer").has("salary", gt(3000)).has("age", between(20, 25));

SQLId name Occupation Salary age gender

... ... ... ... ... ...

SELECT name FROM Person WHERE

occupation = "Engineer" AND

salary > 3000 and age BETWEEN 20

AND 25

TinkerPopGrace Hopper

Ada Lovelace

Knows

g.V().has("occupation","Engineer").has("salary", gt(3000)).has("age", between(20, 25)).values("name");

SQLId name Occupation Salary age gender

... ... ... ... ... ...

SELECT count(*) FROM Person WHERE

occupation = "Engineer" AND

salary > 3000 and age BETWEEN 20

AND 25

TinkerPopGrace Hopper

Ada Lovelace

Knows

g.V().has("occupation","Engineer").has("salary", gt(3000)).has("age", between(20, 25)).count();

TinkerPopGrace Hopper

Ada Lovelace

Knows

g.V().has("occupation","Engineer").has("salary", gt(3000)).has("age", between(20, 25)).groupCount().by(“city”);

Their Friends

SQLId name Occupation Salary age gender

... ... ... ... ... ...

SELECT * FROM Person WHERE

occupation = "Engineer" AND

salary > 3000 and age BETWEEN 20

AND 25//...joins

Id know

... ...

TinkerPopGrace Hopper

Ada Lovelace

Knows

g.V().has("occupation","Engineer").has("salary", gt(3000)).has("age", between(20, 25)).out("knows");

Falling in love

SQLId name Occupation Salary age gender

... ... ... ... ... ...

SELECT * FROM Person WHERE

occupation = "Engineer" AND

salary > 3000 and age BETWEEN 20

AND 25//...joins

Id know

... ...

Id love

... ...

TinkerPopGrace Hopper

Ada Lovelace

Knows

g.V().has("occupation","Engineer").has("salary", gt(3000)).has("age", between(20, 25)).outE("knows").has("feel", "love").bothV();

g.V().repeat(out("eats")).times(3);

g.V().repeat(out("eats")).until(has("name", "grass"));

//path().by("name");

TinkerPop

Our database is too slow and not big enough!

We need NoSql!

Thank You

Otávio Santana@[email protected]@apache.org


Recommended