graphcoql
play

GraphCoQL A mechanized formalization of GraphQL in Coq Toms Daz - PowerPoint PPT Presentation

GraphCoQL A mechanized formalization of GraphQL in Coq Toms Daz Federico Olmedo ric Tanter Millennium Institute Foundational Research on Data Certified Programs and Proofs New Orleans, USA January 2020 GraphQL Clases de ctedra


  1. GraphCoQL A mechanized formalization of GraphQL in Coq Tomás Díaz Federico Olmedo Éric Tanter Millennium Institute Foundational Research on Data Certified Programs and Proofs New Orleans, USA — January 2020

  2. GraphQL Clases de cátedra Language for specifying the interfaces of web data services and their query mechanism 2

  3. GraphQL Clases de cátedra Language for specifying the interfaces of web data services and their query mechanism HTTP GET 2

  4. GraphQL Clases de cátedra Language for specifying the interfaces of web data services and their query mechanism query { artist(id:1000) { name artworks(role: ACTOR) { title } } } HTTP GET 2

  5. GraphQL Clases de cátedra Language for specifying the interfaces of web data services and their query mechanism query { artist(id:1000) { name artworks(role: ACTOR) { title } } } HTTP GET 2

  6. GraphQL Clases de cátedra Language for specifying the interfaces of web data services and their query mechanism query { artist(id:1000) { name artworks(role: ACTOR) { title } } } HTTP GET 2

  7. GraphQL Clases de cátedra Language for specifying the interfaces of web data services and their query mechanism query { artist(id:1000) { name artworks(role: ACTOR) { title } } } HTTP GET 2

  8. GraphQL Clases de cátedra Language for specifying the interfaces of web data services and their query mechanism query { artist(id:1000) { name artworks(role: ACTOR) { title } } } HTTP GET { “artist” : { “name” : “Tom Hanks”, “artworks” : [ { “title” : “Toy Story”, }, { “title” : “Forrest Gump”, }, … ] } } 2

  9. GraphQL Clases de cátedra Language for specifying the interfaces of web data services and their query mechanism query { artist(id:1000) { name artworks(role: ACTOR) { title } } } HTTP GET { “artist” : { “name” : “Tom Hanks”, “artworks” : [ { “title” : “Toy Story”, }, { “title” : “Forrest Gump”, }, … ] } } 2

  10. GraphQL Clases de cátedra Language for specifying the interfaces of web data services and their query mechanism query { artist(id:1000) { name artworks(role: ACTOR) { title } } } HTTP GET { “artist” : { “name” : “Tom Hanks”, “artworks” : [ { “title” : “Toy Story”, }, { “title” : “Forrest Gump”, }, … ] } } 2

  11. Industry involvement with GraphQL Clases de cátedra 2012 2015+ 3

  12. First language formalization [Hartig & Pérez, WWW’18] Clases de cátedra Paper & pencil formalization to study complexity properties. ( f : � ( u , f [ � ] ) if ( u , f [ � ] ) 2 dom ( � ) J f [ � ] K u G = else. f : null ( ` : � ( u , f [ � ] ) if ( u , f [ � ] ) 2 dom ( � ) J ` : f [ � ] K u G = ` : null else. f :[{ J � K � 1 G } · · · { J � K � k  G }] if type S ( f ) 2 L T and { � 1 , ... , � k } = { � i | ( u , f [ � ] , � i ) 2 E }    J f [ � ] { � } K u f :{ J � K � G } if type S ( f ) < L T and ( u , f [ � ] , � ) 2 E G =   f : null if type S ( f ) < L T and there is no � 2 N s.t. ( u , f [ � ] , � ) 2 E  ` :[{ J � K � 1 G } · · · { J � K � k  G }] if type S ( f ) 2 L T and { � 1 , ... , � k } = { � i | ( u , f [ � ] , � i ) 2 E }   J ` : f [ � ] { � } K u  ` :{ J � K � G } if type S ( f ) < L T and ( u , f [ � ] , � ) 2 E G =   ` : null if type S ( f ) < L T and there is no � 2 N s.t. ( u , f [ � ] , � ) 2 E  J � K u  if t 2 O T and � ( u ) = t , or t 2 I T and � ( u ) 2 implementation S ( t ) , or   G  J on t { � } K u t 2 U T and � ( u ) 2 union S ( t ) G =   � in other case.  J � 1 · · · � k K u G = collect ( J � 1 K u G · · · J � k K u G ) Figure 5: Semantics of a GraphQL query. 4

  13. First language formalization [Hartig & Pérez, WWW’18] Clases de cátedra Paper & pencil formalization to study complexity properties. Missing proofs about fundamental properties ( f : � ( u , f [ � ] ) if ( u , f [ � ] ) 2 dom ( � ) J f [ � ] K u G = else. f : null ( ` : � ( u , f [ � ] ) if ( u , f [ � ] ) 2 dom ( � ) J ` : f [ � ] K u G = ` : null else. f :[{ J � K � 1 G } · · · { J � K � k  G }] if type S ( f ) 2 L T and { � 1 , ... , � k } = { � i | ( u , f [ � ] , � i ) 2 E }    J f [ � ] { � } K u f :{ J � K � G } if type S ( f ) < L T and ( u , f [ � ] , � ) 2 E G =   f : null if type S ( f ) < L T and there is no � 2 N s.t. ( u , f [ � ] , � ) 2 E  ` :[{ J � K � 1 G } · · · { J � K � k  G }] if type S ( f ) 2 L T and { � 1 , ... , � k } = { � i | ( u , f [ � ] , � i ) 2 E }   J ` : f [ � ] { � } K u  ` :{ J � K � G } if type S ( f ) < L T and ( u , f [ � ] , � ) 2 E G =   ` : null if type S ( f ) < L T and there is no � 2 N s.t. ( u , f [ � ] , � ) 2 E  J � K u  if t 2 O T and � ( u ) = t , or t 2 I T and � ( u ) 2 implementation S ( t ) , or   G  J on t { � } K u t 2 U T and � ( u ) 2 union S ( t ) G =   � in other case.  J � 1 · · · � k K u G = collect ( J � 1 K u G · · · J � k K u G ) Figure 5: Semantics of a GraphQL query. 4

  14. Our contribution Clases de cátedra GraphCoQL First mechanized formalization of GraphQL in the Coq proof assistant 5

  15. Schema Clases de cátedra Describes how data is structured and queried enum Role { type Artist { ACTOR id: ID DIRECTOR name: String WRITER artworks(role:Role): [Artwork] } } interface Movie { union Artwork = Fiction id: ID | Animation title: String | Book year: Int cast: [Artist] } type Book { … } type Fiction implements Movie { … type Query { } artist(id:ID): Artist movie(id:ID): Movie type Animation implements Movie { } … style: Style } 6

  16. Schema Clases de cátedra Describes how data is structured and queried enum Role { type Artist { ACTOR id: ID DIRECTOR object name: String WRITER type artworks(role:Role): [Artwork] } } interface Movie { union Artwork = Fiction id: ID | Animation title: String | Book year: Int cast: [Artist] } type Book { … } type Fiction implements Movie { … type Query { } artist(id:ID): Artist movie(id:ID): Movie type Animation implements Movie { } … style: Style } 6

  17. Schema Clases de cátedra Describes how data is structured and queried enum Role { type Artist { ACTOR id: ID DIRECTOR object name: String WRITER type artworks(role:Role): [Artwork] } } interface Movie { union Artwork = Fiction id: ID | Animation title: String interface | Book year: Int type cast: [Artist] } type Book { … } type Fiction implements Movie { … type Query { } artist(id:ID): Artist movie(id:ID): Movie type Animation implements Movie { } … style: Style } 6

  18. Schema Clases de cátedra Describes how data is structured and queried enum Role { type Artist { ACTOR id: ID DIRECTOR object name: String WRITER type artworks(role:Role): [Artwork] } } interface Movie { union Artwork = Fiction id: ID | Animation title: String interface | Book year: Int type cast: [Artist] } type Book { … } type Fiction implements Movie { … type Query { } artist(id:ID): Artist movie(id:ID): Movie type Animation implements Movie { } … style: Style } 6

  19. Schema Clases de cátedra Describes how data is structured and queried enum Role { type Artist { enumeration ACTOR id: ID type DIRECTOR object name: String WRITER type artworks(role:Role): [Artwork] } } interface Movie { union Artwork = Fiction id: ID | Animation title: String interface | Book year: Int type cast: [Artist] } type Book { … } type Fiction implements Movie { … type Query { } artist(id:ID): Artist movie(id:ID): Movie type Animation implements Movie { } … style: Style } 6

  20. Schema Clases de cátedra Describes how data is structured and queried enum Role { type Artist { enumeration ACTOR id: ID type DIRECTOR object name: String WRITER type artworks(role:Role): [Artwork] } } interface Movie { union Artwork = Fiction union type id: ID | Animation title: String interface | Book year: Int type cast: [Artist] } type Book { … } type Fiction implements Movie { … type Query { } artist(id:ID): Artist movie(id:ID): Movie type Animation implements Movie { } … style: Style } 6

  21. Schema Clases de cátedra Describes how data is structured and queried enum Role { type Artist { enumeration ACTOR id: ID type DIRECTOR object name: String WRITER type artworks(role:Role): [Artwork] } } interface Movie { union Artwork = Fiction union type id: ID | Animation title: String interface | Book year: Int type cast: [Artist] } type Book { … } type Fiction implements Movie { … type Query { entry points } artist(id:ID): Artist for querying movie(id:ID): Movie type Animation implements Movie { the dataset } … style: Style } 6

  22. Schema Clases de cátedra Describes how data is structured and queried 7

  23. Graph data model Clases de cátedra Datasets are modeled as directed property graphs, with labeled edges and typed nodes. 8

  24. Graph data model Clases de cátedra Datasets are modeled as directed property graphs, with labeled edges and typed nodes. Artist id : 1000 name : “Tom Hanks” 8

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