end to end graph mapper - inria · 2017-11-14 · orientdb, graphql, redux, react-native ð a lot...

24
END-TO-END GRAPH MAPPER Benjamin Billet, Mickaël Jurret, Didier Parigot and Patrick Valduriez EPI ZENITH Inria Sophia Antipolis Méditerranée 33 ème conférence sur la Gestion de Données Principes, Technologies et Applications BDA 2017

Upload: others

Post on 23-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

END-TO-END GRAPH MAPPER Benjamin Billet, Mickaël Jurret, Didier Parigot and Patrick Valduriez

EPI ZENITH Inria Sophia Antipolis Méditerranée

33ème conférence sur la Gestion de Données Principes, Technologies et Applications BDA 2017

Page 2: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 2

! www.beepeers.com

ð Startup which develop/market mobile social networks for micro-communities

ð Cross-platform (Android, iOS, web), specific-purpose (event, activities)

Page 3: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 3

ð Current state: A software factory for building customized social networking servers and databases, according to customers’ requirements

ð  Configuration/specialization over development

ð  Rapid and adaptable production

ð  Scalability

Triton Goals

Page 4: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 4

ð Current state: A software factory for building customized social networking servers and databases, according to customers’ requirements

ð  Configuration/specialization over development

ð  Rapid and adaptable production

ð  Scalability

ð Next step: Building mobile clients as well and generalize the approach to various applications that manage linked data

Triton Goals

Page 5: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 5

Current Infrastructure

FRONT -

END

BACK -

END

OrientDB Neo4j TitanDB

Graph-specificlanguages

GraphAbstractionLayerTypehierarchy,constraintsandbehaviors

Caching

schemas

Querying DataflowEnginecachingpolicies

dataflowdescriptions

SocialServices RecommendationServices SocialNetworkingFramework

GraphManagementFramework

(1)

(2)

ObjectGraphMapperJSONobjects<=>JavaEntities<=>GraphDB

CipherOrientQL Gremlin

Page 6: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 6

Typical Web and Mobile applications ð Client-server ð CRUD on a set of connected data

Page 7: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 7

Typical Web and Mobile applications ð Client-server ð CRUD on a set of connected data

Page 8: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 8

Typical Web and Mobile applications ð Client-server ð CRUD on a set of connected data

Page 9: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 9

Graphs everywhere

followEvent

hasTalk hasSpeaker

Event User

Talk

Graph Database

Event attrs: {name, string}, {begin, date}, {end, date},

{location, string} links: {hasTalk, Talk, one-to-many} Talk attrs: {name, string}, {begin, date}, {end, date} links: {hasSpeaker, User, one-to-many} User attrs: {name, string} links: {followEvent, Event}

Page 10: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

followEvent

hasTalk hasSpeaker

Event User

Talk

- 10

Graphs everywhere

Event event = new Event();event.setId("zenithDay");event.setName("Zenith Day");event.setLocation("Saint Gely");event.setBeginDate(new Date(2016, 9, 13));event.setEndDate(new Date(2016, 9, 13)); User user = ...;user.getFollowedEvents().add(user.getId()); Talk talk = new Talk();talk.getSpeakers().add(user.getId());talk.setBegin(new Date(0, 0, 0, 11, 0));talk.setEnd(new Date(0, 0, 0, 11, 0)); event.getTalks().add(talk);...

Graph Database

Server Code (Java)

Page 11: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

followEvent

hasTalk hasSpeaker

Event User

Talk

Server Code (Java)

- 11

Graphs everywhere

Graph Database

JSON Serialization Event event = new Event();

event.setId("zenithDay");event.setName("Zenith Day");event.setLocation("Saint Gely");event.setBeginDate(new Date(2016, 9, 13));event.setEndDate(new Date(2016, 9, 13)); User user = ...;user.getFollowedEvents().add(user.getId()); Talk talk = new Talk();talk.getSpeakers().add(user.getId());talk.setBegin(new Date(0, 0, 0, 11, 0));talk.setEnd(new Date(0, 0, 0, 11, 0)); event.getTalks().add(talk);...

{ "users": [{ "id": "bbillet", "firstname": "Benjamin", "lastname": "Billet", "followEvents": [ "zenithDay" ] }], "event": [{ "id": "zenithDay", "name": "Zenith Day", "location": "Saint Gely", "beginDate": 1473717600, "endDate": 1473717600, "talks": [{ "speakers": [ "bbillet" ], "begin": 36000, "end": 37800 }] }]}

Page 12: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

followEvent

hasTalk hasSpeaker

Event User

Talk

Server Code (Java)

- 12

Graphs everywhere

Graph Database

Client State

JSON Serialization Event event = new Event();

event.setId("zenithDay");event.setName("Zenith Day");event.setLocation("Saint Gely");event.setBeginDate(new Date(2016, 9, 13));event.setEndDate(new Date(2016, 9, 13)); User user = ...;user.getFollowedEvents().add(user.getId()); Talk talk = new Talk();talk.getSpeakers().add(user.getId());talk.setBegin(new Date(0, 0, 0, 11, 0));talk.setEnd(new Date(0, 0, 0, 11, 0)); event.getTalks().add(talk);...

{ "users": [{ "id": "bbillet", "firstname": "Benjamin", "lastname": "Billet", "followEvents": [ "zenithDay" ] }], "event": [{ "id": "zenithDay", "name": "Zenith Day", "location": "Saint Gely", "beginDate": 1473717600, "endDate": 1473717600, "talks": [{ "speakers": [ "bbillet" ], "begin": 36000, "end": 37800 }] }]}

let store = { users: { bbillet: { id: 'bbillet', firstname: 'Benjamin', lastname: 'Billet', followEvents: [ 'zenithDay' ], }, }, event: { zenithDay: { id: 'zenithDay', name: 'Zenith Day', location: 'Saint Gely', beginDate: new Date(...), endDate: new Date(...), talks: [{ speakers: [ 'bbillet', ... ], begin: new Date(...), end: new Date(...), }, ... ], } }}

Page 13: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

followEvent

hasTalk hasSpeaker

Event User

Talk

Server Code (Java)

- 13

Graphs everywhere

Graph Database

Client State

JSON Serialization

Client UI (JSX)

Event event = new Event();event.setId("zenithDay");event.setName("Zenith Day");event.setLocation("Saint Gely");event.setBeginDate(new Date(2016, 9, 13));event.setEndDate(new Date(2016, 9, 13)); User user = ...;user.getFollowedEvents().add(user.getId()); Talk talk = new Talk();talk.getSpeakers().add(user.getId());talk.setBegin(new Date(0, 0, 0, 11, 0));talk.setEnd(new Date(0, 0, 0, 11, 0)); event.getTalks().add(talk);...

{ "users": [{ "id": "bbillet", "firstname": "Benjamin", "lastname": "Billet", "followEvents": [ "zenithDay" ] }], "event": [{ "id": "zenithDay", "name": "Zenith Day", "location": "Saint Gely", "beginDate": 1473717600, "endDate": 1473717600, "talks": [{ "speakers": [ "bbillet" ], "begin": 36000, "end": 37800 }] }]}

let store = { users: { bbillet: { id: 'bbillet', firstname: 'Benjamin', lastname: 'Billet', followEvents: [ 'zenithDay' ], }, }, event: { zenithDay: { id: 'zenithDay', name: 'Zenith Day', location: 'Saint Gely', beginDate: new Date(...), endDate: new Date(...), talks: [{ speakers: [ 'bbillet', ... ], begin: new Date(...), end: new Date(...), }, ... ], } }}

<View style={styles.container}> <View style={styles.row}> <Text>User name: </Text> <Text> {this.props.user.firstname} {this.props.user.lastname} </Text> </View> ...</View>

Page 14: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 14

Zoom in 𝒪OGM

followEvent

hasTalk hasSpeaker

Event User

Talk

Graph Database

Event attrs: {name, string}, {begin, date}, {end, date},

{location, string} links: {hasTalk, Talk, one-to-many} Talk attrs: {name, string}, {begin, date}, {end, date} links: {hasSpeaker, User, one-to-many} User attrs: {name, string} links: {followEvent, Event}

Page 15: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 15

Zoom in 𝒪OGM : Mappings

Event.class gType: Event attrs: {title, name}, {beginDate, begin},

{endDate, end}, … links: {talks, out(hasTalk)} Talk.class gType: Talk attrs: {title, name}, {beginDate, begin},

{endDate, end} links: {speakers, out(hasSpeaker)}, {event, in(Event)} User.class gType: User attrs: {name, name} links: {followedEvents, out(followEvent)},

{followedTalks, out(hasTalk, out(followEvent))}

derived attributes

followEvent

hasTalk hasSpeaker

Event User

Talk

Graph Database

Page 16: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 16

Zoom in 𝒪OGM : Mappings

Event.class gType: Event attrs: {title, name}, {beginDate, begin},

{endDate, end}, … links: {talks, out(hasTalk)} Talk.class gType: Talk attrs: {title, name}, {beginDate, begin},

{endDate, end} links: {speakers, out(hasSpeaker)}, {event, in(Event)} User.class gType: User attrs: {name, name} links: {followedEvents, out(followEvent)},

{followedTalks, out(hasTalk, out(followEvent))}

class User { private String name; private Set<Event> followedEvents; private Set<Talk> followedTalks; }

Server Code (Java)

Page 17: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 17

ð Current state: Prototypal implementation based on OrientDB, GraphQL, redux, react-native ð  A lot of custom code for the client-side ð  Technical problems: graph databases heterogeneity and instability

Current State & Problems

Page 18: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

- 18

ð Current state: Prototypal implementation based on OrientDB, GraphQL, redux, react-native ð  A lot of custom code for the client-side ð  Technical problems: graph databases heterogeneity and instability

ð Ongoing research problems: ð  Complex mappings, identifying common mapping patterns in actual applications ð  Horizontal concerns: access control, transactions ð  Common query language for each layer (SPARQL?) ð  Distributed systems? Non-graph databases?

Current State & Problems

Page 19: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

www.inria.fr

Page 20: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

Zoom in 𝒪CNM and 𝒪SNM : Network

- 20

Page 21: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

Zoom in 𝒪CNM and 𝒪SNM : Network

- 21

Page 22: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

Full Graph Schema: Root Types

- 22

Page 23: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

Full Graph Schema: Social Entity Types

- 23

Page 24: END TO END GRAPH MAPPER - Inria · 2017-11-14 · OrientDB, GraphQL, redux, react-native ð A lot of custom code for the client-side ð Technical problems: graph databases heterogeneity

Full Graph Schema: Interaction Types

- 24