RESTful writable APIs for the web of Linked Data using relational storage solutions

2,190 views

Published on

LDOW2011 slides

Published in: Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
2,190
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
14
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

RESTful writable APIs for the web of Linked Data using relational storage solutions

  1. 1. RESTful writable APIsfor the web of Linked Data using relational storage solutions Antonio Garrote María N.Moreno García
  2. 2. Outline1. Introduction2. SPARQL to SQL mapping using R2RML3. RESTful API4. Conclusions
  3. 3. Web APIs OAuth Key ValueMobile App. Store HTTP API JS. App JSON MVCNative App. Dynamic Relational Web App. DB
  4. 4. Linked data APIs?• RDF data model vs JSON objects• Object IDs vs URIs• Properties identified by URIs vs plain strings• URIs linking data in different services
  5. 5. Transition path• Translation of SPARQL update queries into SQL queries• RDF graphs encoded in JSON objects• RESTful protocol to manipulate RDF graphs
  6. 6. SPARQL to SQL translation• R2RML starting point Relational RDF quads TableMappings Data R2RML Document
  7. 7. SPARQL to SQL translation• inverse transformation R2RML Document SPARQL QueryQuadPatterns QuadMatchers SQL
  8. 8. SPARQL to SQL translation Constant MappingsR2RMLMapping (Table, Subject, Property, Object, Graph) Variable Mappings Quad Matchers
  9. 9. SPARQL to SQL translation(Table, Subject, Property, Object, Graph) Constant Terms Compatible? SPARQL Quad Pattern Variables +BNode IDs
  10. 10. SPARQL to SQL translationSELECT SPARQL Quad Pattern Quad Quad Quad Matcher Matcher Matcher σπ σπ σπ ∪ ∪ SPARQL Relational Algebra
  11. 11. SPARQL to SQL translationInsert SPARQL Quad Pattern Quad Quad Quad Matcher Matcher Matcher Min. Insertion Cost metric Insert / Update SQL DM Query
  12. 12. SPARQL to SQL translation• Different compatibility functions: data types, language tags in literals• R2RML extensions to generate IDs from URIs• Limitations: auto increment columns and database constraints
  13. 13. RESTful API• Starting point: “SPARQL 1.1 Uniform HTTP Protocol for Managing RDF graphs”• Granularity: RDF named graph• HTTP uniform interface semantics
  14. 14. RESTful API• Declarative definition of APIs (RDFS vocabulary) - URI templates - Mapping of templates to SPARQL endpoints
  15. 15. RESTful API• Minting of resource URIs HTTP POST Request HTTP GET Response graph_uri [ <p1> <o1> ; <uri> graph_uri#self <p1> <o1> ; <p2> <o2>; <p2> <o2>; ... ... ] RDF RDF 200 201 New resource URI
  16. 16. RESTful API• Extensions (linked-data-api): - JSON-LD as the primary media type - Method overloading - JSONP support - Format URL parameter - Pagination parameters
  17. 17. Sample Application• Library• Prototype - JavaScript client - RESTful API - FOAF+SSL auth - Relational backend http://github.com/antoniogarrote/clj-r2rml http://antoniogarrote.com/cvbuilder
  18. 18. Conclusions• Linked data and sem. web technologies can help us to build better web APIs• Huge opportunity to increase the amount of linked data available in the web• Real benefits for end users• Easy transition path for web developers must be provided

×