rest, the internet as a database?
TRANSCRIPT
REST, het web als database?
Ron van WeverwijkAndrej Koelewijn
package com.sun.ws.rest.samples.helloworld.resources;
import javax.ws.rs.GET;import javax.ws.rs.Produces;import javax.ws.rs.Path;
// The Java class will be hosted at the URI path "/helloworld"@Path("/helloworld")public class HelloWorldResource {
// The Java method will process HTTP GET requests @GET // The Java method will produce content // identified by the MIME Media-type "text/plain" @Produces("text/plain") public String getClichedMessage() { // Return some cliched textual content return "Hello World"; }}
Wat is REST?
Rest Eigenschappen
1. Geef alles een ID
2. Link naar je afhankelijkheden
3. Gebruik de standaard HTTP Methoden
4. Stel je data in verschillende formaten beschikbaar
5. Communiceer zonder status
Architectuur Impact
LinkedData
<h2>About Dries</h2><div class="content"> <div about="#me" typeof="foaf:Person"> <a href="http://buytaert.net/images/blog/dries-buytaert-large-bw.jpg" rel="foaf:img"> <img src="http://buytaert.net/images/blog/dries-buytaert-small-bw.jpg" alt="Avatar of Dries Buytaert" style="display: block; margin-left: auto; margin-right: auto" /> </a> <p> <span property="foaf:name">Dries Buytaert</span>is passionate about the <span property="foaf:interest">web</span>, <span property="foaf:interest">open source</span>and <span property="foaf:interest">photography</span>. He is the original creator and project lead of <a href="http://drupal.org" rel="foaf:currentProject">Drupal</a>, an open source social publishing system. He is co-founder and chief technology officer of <a href="http://acquia.com" rel="foaf:workplaceHomepage">Acquia</a>, a venture-backed software company that offers products and services for Drupal. Dries is also working on <a href="http://mollom.com" rel="foaf:workplaceHomepage">Mollom</a>, a service that helps you identify content quality and that stops website spam. People often laugh at his hair but he is cool with that. <a href="/resume">More about Dries ...</a></p> </div></div>
<h2>About Dries</h2><div class="content"> <div about="#me" typeof="foaf:Person"> <a href="http://buytaert.net/images/blog/dries-buytaert-large-bw.jpg" rel="foaf:img"> <img src="http://buytaert.net/images/blog/dries-buytaert-small-bw.jpg" alt="Avatar of Dries Buytaert" style="display: block; margin-left: auto; margin-right: auto" /> </a> <p> <span property="foaf:name">Dries Buytaert</span>is passionate about the <span property="foaf:interest">web</span>, <span property="foaf:interest">open source</span>and <span property="foaf:interest">photography</span>. He is the original creator and project lead of <a href="http://drupal.org" rel="foaf:currentProject">Drupal</a>, an open source social publishing system. He is co-founder and chief technology officer of <a href="http://acquia.com" rel="foaf:workplaceHomepage">Acquia</a>, a venture-backed software company that offers products and services for Drupal. Dries is also working on <a href="http://mollom.com" rel="foaf:workplaceHomepage">Mollom</a>, a service that helps you identify content quality and that stops website spam. People often laugh at his hair but he is cool with that. <a href="/resume">More about Dries ...</a></p> </div></div>
Query Engines
let $images := doc("jdbc:mysql:localhost:localuser:images"),
$kw := doc("rdf.xml")
for $item in $rdf/triplets[relation = "locname"]
where
$item/value = "Tower of London"
and some $image in $images satisfies (
$image/uri = $item/uri
and $image/width = 1024 and $image/height = 768
)
return
$item/uri
REST, het web als database?
● http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
● http://www.infoq.com/articles/rest-anti-patterns
● http://www.infoq.com/articles/tilkov-rest-doubts
● http://www.infoq.com/articles/subbu-allamaraju-rest