Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

HyperGraphQL

182 views

Published on

Overview of HyperGraphQL - a GraphQL interface for querying and serving linked data on the Web (http://hypergraphql.org)

Published in: Software
  • Be the first to comment

HyperGraphQL

  1. 1. HyperGraphQL A GraphQL interface for querying and serving linked data
  2. 2. HyperGraphQL = linked data + GraphQL Linked Data: - A set of specifications and good practices developed and recommended by W3C for publishing (connected) data on the Web. - In a narrow sense, a graph data model (RDF) based on the use of URIs for identifying resources and describing them with subject-predicate-object triples. GraphQL: - A query language for APIs and a runtime environment for fulfilling data requests. - Originally developed by Facebook and released in 2015. - Predicted one of the most promising web development technologies for 2018.
  3. 3. Linked data Pros: - Very flexible and expressive open-world, schema-on-read, graph data model. - Accompanied by highly expressive query language SPARQL, along with a range of other dedicated tools and standards (OWL, SHACL, JSON-LD, RDFa). Cons: - The flexibility and the expressiveness of the stack makes it sometimes demanding to work with for developers (esp. front-end). - Querying data from multiple sources (federated querying) might easily get complex and unreliable.
  4. 4. Overview
  5. 5. Objectives - hiding the complexities of the Semantic Web stack behind GraphQL interface - enforcing a uniform, strict view over heterogeneous linked data sources residing in disconnected services - restricting access to RDF stores down to simple yet expressive (tree-shaped) GraphQL queries - facilitating construction of microservice-based linked data architectures in a “plug-and-play” fashion
  6. 6. Bridging the models dbr:Albert_Einstein dbo:Person dbr:Ulm dbr:Germanydbo:City dbo:Country “Albert Einstein” “Ulm” “Germany” rdf:type rdf:type rdf:type dbo:birthPlace dbo:country foaf:name rdfs:label rdfs:label
  7. 7. Bridging the models dbr:Albert_Einstein dbo:Person dbr:Ulm dbr:Germanydbo:City dbo:Country “Albert Einstein” “Ulm” “Germany” rdf:type rdf:type rdf:type dbo:birthPlace dbo:country foaf:name rdfs:label rdfs:label type __Context { Person: _@href(iri: "http://dbpedia.org/ontology/Person") City: _@href(iri: "http://dbpedia.org/ontology/City") Country: _@href(iri: "http://dbpedia.org/ontology/Country") name: _@href(iri: "http://xmlns.com/foaf/0.1/name") birthPlace: _@href(iri: "http://dbpedia.org/ontology/birthPlace") country: _@href(iri: "http://dbpedia.org/ontology/country") label: _@href(iri: "http://www.w3.org/2000/01/rdf-schema#label") } type Person @service(id:"dbpedia") { name: [String] @service(id:"dbpedia") birthPlace: City @service(id:"dbpedia") } type City @service(id:"dbpedia") { label: [String] @service(id:"dbpedia") country: Country @service(id:"dbpedia") } type Country @service(id:"dbpedia") { label: [String] @service(id:"dbpedia") }
  8. 8. Bridging the models { Person_GET { _id name birthPlace { label country { label } } } } dbr:Albert_Einstein dbo:Person dbr:Ulm dbr:Germanydbo:City dbo:Country “Albert Einstein” “Ulm” “Germany” rdf:type rdf:type rdf:type dbo:birthPlace dbo:country foaf:name rdfs:label rdfs:label
  9. 9. Bridging the models dbr:Albert_Einstein dbo:Person dbr:Ulm dbr:Germanydbo:City dbo:Country “Albert Einstein” “Ulm” “Germany” rdf:type rdf:type rdf:type dbo:birthPlace dbo:country foaf:name rdfs:label rdfs:label { Person_GET { _id name birthPlace { label country { label } } } }
  10. 10. Bridging the models dbr:Albert_Einstein dbo:Person dbr:Ulm dbr:Germanydbo:City dbo:Country “Albert Einstein” “Ulm” “Germany” rdf:type rdf:type rdf:type dbo:birthPlace dbo:country foaf:name rdfs:label rdfs:label { "Person_GET": [{ "_id": "dbr:Albert_Einstein", "name": "Albert Einstein", "birthPlace": { "label": "Ulm", "country": { "label": "Germany" } } }] "@context": { … } }
  11. 11. Querying SPARQL endpoint Live demo (http://bit.ly/2Dd8rVa) - Queries are rewritten to SPARQL and delegated to the remote endpoint, from where the relevant portion of data is fetched. - Configuration: { "id": "dbpedia-sparql", "type": "SPARQLEndpointService", "url": "http://dbpedia.org/sparql/", "graph": "http://dbpedia.org", "user": "", "password": "" }
  12. 12. Exposing data from local file Live demo (http://bit.ly/2DdeKIq) - Queries are rewritten to SPARQL and executed at the local in-memory triple store where the RDF data from the file resides. - Configuration: { "id": "agrovoc-local", "type": "LocalModelSPARQLService", "filepath": "agrovoc.ttl", "filetype": "TTL" }
  13. 13. Federated querying Live demo (http://bit.ly/2mx04si) - Query is partitioned into largest possible subqueries that can be handled via single request by each individual service within the federation. - Whenever possible such subqueries are executed concurrently.
  14. 14. Summary & outlook - HyperGraphQL is a lightweight, extensible GraphQL query interface for linked data services. - Currently, it supports access to and federation of SPARQL endpoints, local RDF data, other HyperGraphQL endpoints. - Setting up an instance requires providing a simple configuration and a schema. - Schema must be defined manually, but could be automated under certain data modelling assumptions. - It supports a number of response formats, including JSON-LD, RDF/XML, TURTLE, N-TRIPLE. Docs / demo / tutorial: http://hypergraphql.org Twitter: @HyperGraphQL

×