defjning property graph schemas using the graphql schema
play

Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon - PowerPoint PPT Presentation

Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language Olaf Hartjg @olafiartjg What is GraphQL? State-of-the art approach to create Web APIs to retrieve data for Web and mobile applications Alternative to the


  1. Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language Olaf Hartjg @olafiartjg

  2. What is GraphQL? ● State-of-the art approach to create Web APIs to retrieve data for Web and mobile applications ● Alternative to the notion of REST-based Web APIs ● Developed and used by Facebook since 2012 ● Made available to the public (open source) in 2015 – Spec and reference implementation ● Based on a simple, JSON-like query language Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 2

  3. GraphQL Schema Defjnitjon Language (SDL) ● Language to define GraphQL schema ● Specifies the types of objects that can be queried when accessing a specific GraphQL Web API Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 3

  4. GraphQL SDL Example declaration of an interface type declaration of an object type declaration of an object type and an implementation with its fields and their types with its fields and their types argument declaration of declaration of a union type a union type declaration of the query type (possible root fields of queries) Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 4

  5. Can we use this language to defjne schemas for Property Graphs?

  6. Property Graph Schemas with GraphQL SDL Example Property Graph schema defined using the GraphQL SDL type person { name: String! Image source: http://tinkerpop.apache.org/docs/3.4.0/tutorials/getting-started/ age: Int knows(weight:Float!): [person] @distinct @noloops created(weight:Float!): [software] @distinct @requiredForTarget } type software { name: String! lang: Language } enum Language { java javascript python } Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 6

  7. Node Types and Node Propertjes type UserSession { id: ID! user: User! startTime: Time endTime: Time } scalar Time type User { id: ID! loginName: String! name: String } Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 7

  8. (Outgoing) Edges type A { type B { name: String! favoriteA: A! favoriteB: B otherA: [A!] relatedA: [A] } } type C { otherC: [C!] @distinct @noloops b: [B] @distinct } type D { a: [A] @uniqueForTarget b: [B] @requiredForTarget c: [C] @uniqueForTarget @requiredForTarget } Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 8

  9. Cardinality Restrictjons ● 1:1 relationship rel: B @uniqueForTarget ● 1:N relationship rel: B ● N:1 relationship rel: [B] @uniqueForTarget ● N:M relationship rel: [B] Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 9

  10. Multjple Types of Target Nodes 1/2 type Person { id: ID! name: String! favoriteVehicle: Vehicle } union Vehicle = Car | Motorcycle type Car { brand: String! color: String } type Motorcycle { brand: String! } Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 10

  11. Multjple Types of Target Nodes 2/2 type Person { id: ID! name: String! favoriteVehicle: Vehicle } interface Vehicle { brand: String! } type Car implements Vehicle { brand: String! color: String } type Motorcycle implements Vehicle { brand: String! } Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 11

  12. Multjple Types of Source Nodes type Car { brand: String! color: String owner: Person } type Motorcycle { brand: String! owner: Person } type Person { name: String! } Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 12

  13. Edge Propertjes type UserSession { id: ID! user(certainty:Float! comment:String): User! startTime: Time endTime: Time } Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language 13

  14. www.liu.se

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend