graph exploration w/ neo4j - github pages · graphexploration 3 efficiently extracting knowledge...

25
Graph Exploration w/ Neo4j 1 https://s3.amazonaws.com/dev.assets.neo4j.com/wp-content/uploads/graph-data-technologies-graph-databases-for-beginners.png

Upload: others

Post on 22-May-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Graph Exploration w/ Neo4j

1https://s3.amazonaws.com/dev.assets.neo4j.com/wp-content/uploads/graph-data-technologies-graph-databases-for-beginners.png

Page 2: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Our Project Partners

2

Page 3: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

3GRAPH EXPLORATION

Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for

Graph Exploration: From Users to Large Graphs. CIKM 2016, SIGMOD 2017, KDD 2018

Page 4: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Adaptive Databases

GRAPH EXPLORATION4

Graph Exploration Stack

Intuitive queries

Interactive algorithms

Users

Graph

Page 5: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Adaptive Databases

Intuitive queries

Interactive algorithms

GRAPH EXPLORATION5

Graph Exploration StackUsers

Graph

This project is about ...

Page 6: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

6

3,27 × 109

base pairs

Graph Exploration in Biology - Complex Graphs

http://jcs.biologists.org/content/joces/118/21/4947/F3.large.jpg

Page 7: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Graph Exploration in Biology - Status Quo

MATCH (p1:Phenotype)-[:HAS]-(a1:Association)-[:HAS]-(snp:Snp)-[:HAS]-(a2:Association)-[:HAS]-(p2:Phenotype)

WHERE p1.name = 'foo1‘ AND p2.name = 'foo2p‘ AND a1.p < 0.01 AND a2.p < 0.01

WITH DISTINCT snpORDER BY snp.sidRETURN collect(snp.sid)

7

MATCH

(p1:Phenotype)-[:HAS]-(a1:Association)-[:HAS]-(snp:Snp)-[:HAS]-(a2:Association)-[:HAS]-(p2:Phenotype

)WHERE p1.name = 'foo1'

AND p2.name = ‘foo2'

AND a1.p < 0.01 AND a2.p < 0.01

WITH DISTINCT snp

MATCH (snp)-[:IN]-(pw:PositionWindow)<-[:IN]-(l:Locus)--(g:Gene)

WHERE l.feature= 'gene'

RETURN collect(DISTINCT g.name)

MATCH (p1:Phenotype)-[:HAS]-(a1:Association)-[:HAS]-(snp:Snp)-[:HAS]-(a2:Association)-[:HAS]-(p2:Phenotype)WHEREp1.name = 'foo1'ANDp2.name = ‘foo2'ANDa1.p < 0.01 AND a2.p < 0.01WITH DISTINCT snpMATCH(snp)-[:IN]-(pw:PositionWindow)<-[:IN]-(l:Locus)--(g:Gene)WHERE l.feature= 'gene'WITH DISTINCT g ORDER BY g.nameMATCH(g)-[:CODES]-(:Transcript)-[:CODES]-(p:Protein)-[:MEMBER]-(go:Goterm)WHERE go.namespace= 'biological_process'WITH DISTINCT go,pRETURN go.name, count(p) ORDER BY count(p)DESCLIMIT 10

MATCH (p1:Phenotype)-[:HAS]-(a1:Association)-[:HAS]-(snp:Snp)-[:HAS]-(a2:Association)-[:HAS]-(p2:Phenotype)

WHERE p1.name = 'foo1'AND p2.name = ‘foo2'AND a1.p < 0.01 AND a2.p < 0.01WITH DISTINCT snpMATCH (snp)-[:IN]-(pw:PositionWindow)<-[:IN]-(l:Locus)--(g:Gene)

WHERE l.feature= 'gene'WITH DISTINCT gORDER BY g.nameMATCH (g)-[:CODES]-(:Transcript)-[:IS]-(ps:Probeset)-[:SIG]-(s:Sample)

WHERE s.name= 'mustafavi'RETURN DISTINCT g.name

Page 8: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Can we do better?

8

Page 9: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Problem● Given two node sets:

How similar are they in my understanding?

● Example→ Set of movies I like→ Set of movies I don’t know→ Will I like the movies I don’t know?

9

As Good As It Gets

Hell or High

Water

Pulp Fiction

The Matrix Skyfall

Avatar

?

Page 10: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

What is a Knowledge Graph?

● (directed) graph G : ⟨V, E, φ, ψ⟩, where ○ V is a set of nodes,○ E ⊆ V × V is a set of edges,○ φ : V → LV is an edge labeling function

and○ ψ : E → LE is a node labeling function

We refer to the elements of LV and LE as node labels and edge labels

10

Page 11: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

What are Meta-Paths?

Graph Path

Graph Schema Meta-Path

A meta-path for a path ⟨n1 , ..., nt ⟩, ni ∈ V , 1 ≤ i ≤ t is a sequence P : ⟨φ(n1 ),ψ (n1 , n2 ), ..., ψ (nt−1 , nt ), φ(nt)⟩ that alternates node- and edge-types along the path. 

11

Page 12: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Motivating ExampleQ: How famous is Diane Kruger in America?

MATCH(n:Person)WHERE n.name = “Diane Kruger”RETURN n

MATCH(m:Movie)WHERE m.location = “America”RETURN m

Diane Kruger

As Good As It Gets

Stand By MeTop

Gun

Pulp Fiction A Few

Good Men

The Matrix

Up

12

Page 13: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

How similar are they?● Similarity depends on

○ expert knowledge○ connections among nodes

13

Page 14: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Individualized explorationExtract ratingsCompute Meta-Paths

What does the System do and how?Overview

✓✗◎

Learn representation for meta-paths

Calculate similarity

14

Page 15: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Approximate Meta-PathsProblem: How to compute all meta-paths fast?Approx. Solution: Mine meta-paths using the graph’s schema and learn classifier on real meta-paths

Meta-Paths Computation

Compute schema

15

Page 16: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Learning a Meta-Path EmbeddingProblem: Vector representation required for active learning and preference prediction.

Meta-Paths Embedding

?

(3 5 1)T

16

Page 17: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Learning a Meta-Path EmbeddingProblem: Vector representation required for active learning and preference prediction.

Solution: Embed meta-paths→ Similar meta-paths should have similar vectors.

Our method: Transfer text embedding method to meta-paths.

Meta-Paths Embedding

(3 5 1)T

17

Page 18: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Learn the Domain Value of all Meta-Paths

- Problem: Users don’t want to rate all meta-paths→ too many→ time-consuming→ tedious and boring

- Solution: Label only a few, but very informative paths

Active Learning

✓✗◎

18

Page 19: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Use Learned Preferences for Graph Exploration Result Explanation

Icons made by Eucalyp from www.flaticon.com is licensed by CC 3.0 BY

Graph (with meta-paths)

Domain Knowledge

What is important in the graph?

Personalized Exploration Tool

Similarity Measure

Related Nodes

Stats

19

Page 20: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Personalized Node EmbeddingResult Explanation

Transform Nodes to Vectors

(Graph-Embedding)

Adapt Vectors Using Domain-Knowledge

Personalized Vector Space

precomputed

20

Page 21: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Personalized Exploration Tool Applications

What nodes are close to

my selection?How close are my sets?

Find clusters!What are outliers?Personalized Vector

Space

21

Page 22: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

System Architecture - How does it work with Neo4j?

Neo4j Graph Database

Neo4j Graph Algorithm ProceduresContaining Meta-Paths Computation

Python Backend Server

ReactJS Frontend

Meta-Path Embedding Active Learning Explanation

Node selection Meta-Path ordering

Result visualization

22

Page 23: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

● Easy to get your code running in neo4j.● Neo4j-graph-algorithms: efficiency vs convenience.● Sometimes no stack-trace when an error occurs.● Great support and community. Always available.● Cypher: Easy to begin with, hard to master.

(hpi)-[:LIKES]->(neo4j)

What about neo4j?Meta-Paths Computation

23

Page 24: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Trending: #tweetyourthesis

24

Page 25: Graph Exploration w/ Neo4j - GitHub Pages · GRAPHEXPLORATION 3 Efficiently extracting knowledge from graph data even if we do not know exactly what we are looking for Graph Exploration:

Trending: #tweetyourthesis

25