Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
Olaf Hartjg
@olafiartjg
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
@olafiartjg
2 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
– Spec and reference implementation
3 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
4 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
declaration of an object type with its fields and their types argument declaration of an object type with its fields and their types declaration of an interface type and an implementation declaration of a union type declaration of a union type declaration of the query type (possible root fields of queries)
6 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
Image source: http://tinkerpop.apache.org/docs/3.4.0/tutorials/getting-started/
Example Property Graph schema defined using the GraphQL SDL
type person { name: String! 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 }
7 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
type UserSession { id: ID! user: User! startTime: Time endTime: Time } scalar Time type User { id: ID! loginName: String! name: String }
8 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
type A { type B { name: String! favoriteA: A! favoriteB: B otherA: [A!] relatedA: [A] } } type C {
b: [B] @distinct } type D { a: [A] @uniqueForTarget b: [B] @requiredForTarget c: [C] @uniqueForTarget @requiredForTarget }
9 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
rel: B @uniqueForTarget rel: B rel: [B] @uniqueForTarget rel: [B]
10 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
type Person { id: ID! name: String! favoriteVehicle: Vehicle } union Vehicle = Car | Motorcycle type Car { brand: String! color: String } type Motorcycle { brand: String! }
11 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
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! }
12 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
type Car { brand: String! color: String
} type Motorcycle { brand: String!
} type Person { name: String! }
13 Olaf Hartjg - Defjning Property Graph Schemas using the GraphQL Schema Defjnitjon Language
type UserSession { id: ID! user(certainty:Float! comment:String): User! startTime: Time endTime: Time }