linked data and rest

35
Linked Data and REST How can we finally get some REST?

Upload: eric-moritz

Post on 28-Jun-2015

259 views

Category:

Technology


3 download

DESCRIPTION

Meeting the requirements of REST with Linked Data Text: https://github.com/ericmoritz/linked-data-and-rest/blob/master/linked-data-outline.org

TRANSCRIPT

Page 1: Linked Data and REST

Linked Data and RESTHow can we finally get some REST?

Page 2: Linked Data and REST

A Journey through time and space...

Page 3: Linked Data and REST

4.1 WWW Application Domain Requirements

● Low Entry-barrier● Extensibility● Distributed Hypermedia● Internet-scale

○ Anarchic Scalability○ Independent Deployment

Page 4: Linked Data and REST

Low barrier to entry

Page 5: Linked Data and REST

Extensibility

Page 6: Linked Data and REST

Free of user-perceived latency

5ms 150ms<95ms

5ms 150ms<95ms

Cached:

TTLs kinda suck; use client-side Conditional GETs

Page 7: Linked Data and REST

“The Web is intended to be an Internet-scale distributed hypermedia system”

○ Anarchic Scalability○ Independent Deployment

Internet Scale

LINKS

Page 8: Linked Data and REST

4.1 WWW Application Domain RequirementsRequirements of a Web Application

Can we drive the state transitions of multiple user-agents? Is it easy to author?

Can the service evolve?

Is the UI responsive?

Is it web scale?Can we share data effortlessly and deploy the client and server independently?

Page 9: Linked Data and REST

A true web application: HTML

Life Section

OMG Katy Perry

Page 10: Linked Data and REST

<a href=”....”>

“Computer says no.”

<a href=”....”>

Page 11: Linked Data and REST

Browsing Homepage

id=</>url=</>name=”USA Today”section=</news/>section=</sports/>section=</life/>section=</money/>…

id=</life/>label=”Life”type=”Section”type=”Link”

<section>

Browsing a Section

id=</life/>url=</life/>name=”Life”story=</story/5868609/>type=”Section”

id=</story/5868609/>url=</story/life/people/2014/02/27/katy-perry-helps-deliver-baby-in-living-room/5868609/>title=”Katy Perry helps deliver baby in living room”type=”Story”

id=</story/life/people/2014/02/27/katy-perry-helps-deliver-baby-in-living-room/5868609/>type=”Link”

View Source...

<story>

Reading Story

id=</story/5868609/>url=</story/life/people/2014/02/27/katy-perry-helps-deliver-baby-in-living-room/5868609/>title=”Katy Perry helps deliver baby in living room”body=”...”

id=</story/life/people/2014/02/27/katy-perry-helps-deliver-baby-in-living-room/5868609/>type=”Link”

Page 12: Linked Data and REST

4.1 WWW Application Domain RequirementsIf these are the requirements?

Can we drive the state transitions of multiple user-agents? Is it easy to author?

Can the service evolve?

Is the UI responsive?

Is it web scale?Can we share data effortlessly and deploy the client and server independently?

Page 13: Linked Data and REST

Browsing Homepage

id=</>url=</>name=”USA Today”section=</news/>section=</sports/>section=</life/>section=</money/>…

id=</life/>label=”Life”type=”Section”type=”Link”

<section>

Browsing a Section

id=</life/>url=</life/>name=”Life”story=</story/5868609/>type=”Section”

id=</story/5868609/>url=</story/life/people/2014/02/27/katy-perry-helps-deliver-baby-in-living-room/5868609/>title=”Katy Perry helps deliver baby in living room”type=”Story”

id=</story/life/people/2014/02/27/katy-perry-helps-deliver-baby-in-living-room/5868609/>type=”Link”

What is state?

<story>

Reading Story

id=</story/5868609/>url=</story/life/people/2014/02/27/katy-perry-helps-deliver-baby-in-living-room/5868609/>title=”Katy Perry helps deliver baby in living room”body=”...”

id=</story/life/people/2014/02/27/katy-perry-helps-deliver-baby-in-living-room/5868609/>type=”Link”

Page 14: Linked Data and REST

Wrong Data Model for Raw Data

Page 15: Linked Data and REST

4.1 WWW Application Domain RequirementsWhat can let us REST?

Can we drive the state transitions of multiple user-agents? Is it easy to author?

Can the service evolve?

Is the UI responsive?

Is it web scale?Can we share data effortlessly and deploy the client and server independently?

Page 16: Linked Data and REST

Can JSON let us REST?4.1 WWW Application Domain Requirements

Can we drive the state transitions of multiple user-agents? Is it easy to author?

Can the service evolve?

Is the UI responsive?

Is it web scale?Can we share data effortlessly and deploy the client and server independently?

Page 17: Linked Data and REST

Can CSV let us REST?4.1 WWW Application Domain Requirements

Can we drive the state transitions of multiple user-agents? Is it easy to author?

Can the service evolve?

Is the UI responsive?

Is it web scale?Can we share data effortlessly and deploy the client and server independently?

Page 18: Linked Data and REST

Can Plain ol’ XML let us REST?

Can we drive the state transitions of multiple user-agents? Is it easy to author?

Can the service evolve?

Is the UI responsive?

Is it web scale?Can we share data effortlessly and deploy the client and server independently?

Page 19: Linked Data and REST

Can HTML5 let us REST?4.1 WWW Application Domain Requirements4.1 WWW Application Domain Requirements

Can we drive the state transitions of multiple user-agents? Is it easy to author?

Can the service evolve?

Is the UI responsive?

Is it web scale?Can we share data effortlessly and deploy the client and server independently?

Page 20: Linked Data and REST

Can RDFa+HTML5 let us REST?4.1 WWW Application Domain Requirements4.1 WWW Application Domain Requirements

Can we drive the state transitions of multiple user-agents? Is it easy to author?

Can the service evolve?

Is the UI responsive?

Is it web scale?Can we share data effortlessly and deploy the client and server independently?

Page 21: Linked Data and REST

Can RDF let us REST?4.1 WWW Application Domain Requirements4.1 WWW Application Domain Requirements

Can we drive the state transitions of multiple user-agents? Is it easy to author?

Can the service evolve?

Is the UI responsive?

Is it web scale?Can we share data effortlessly and deploy the client and server independently?

Page 22: Linked Data and REST

RDF as Distributed Hypermedia

@prefix hydra: <http://www.w3.org/ns/hydra/core#> .

Hydra +1 stars

Page 23: Linked Data and REST

Not XML; please God no!

Page 24: Linked Data and REST

Triples?

</story/43> gannett:author </author/54> .

subject predicate object

Eric has a bike.

subject predicate object

English:

RDF:

</author/54> gannett:firstName “Eric” .

subject predicate object

Page 25: Linked Data and REST

RDF is a graph

gannett:author

/story/43

/people/54

Eric

Moritz

gannett:firstName

gannett:lastName

Page 26: Linked Data and REST

RDF is a graph

/story/43

/people/54

Ericgannett:author

Moritz

gannett:firstName

gannett:lastName

/state/va

gannett:name

Virginia

gannett:state

Page 27: Linked Data and REST

Can we finally get some REST?4.1 WWW Application Domain Requirements4.1 WWW Application Domain Requirements

Can we drive the state transitions of multiple user-agents? Is it easy to author?

Can the service evolve?

Is the UI responsive?

Is it web scale?Can we share data effortlessly and deploy the client and server independently?

Page 28: Linked Data and REST

JSON-LD

Page 29: Linked Data and REST

Linked Data (2006) constraints

http://www.w3.org/DesignIssues/LinkedData.html

http://www.ted.com/talks/tim_berners_lee_on_the_next_web.html

Page 30: Linked Data and REST

Shared Vocabulary

<http://memegenerator.net/topText>

<http://memegenerator.net/bottomText>

<http://schema.org/url>

<http://memegenerator.net/Meme>

<http://schema.org/image>

<http://schema.org/Thing>

Page 31: Linked Data and REST

Shared Vocabulary

<http://memegenerator.net/topText>

<http://memegenerator.net/bottomText>

<http://schema.org/url>

<http://memegenerator.net/Meme>

<http://schema.org/image>

<http://schema.org/Thing>

Page 32: Linked Data and REST

Shared Vocabulary

Linked Open Vocabularies (LOV)

Page 34: Linked Data and REST

● Clarity of meaning● Flexibility of data modeling● Generality of user interfaces

With Linked Data

Page 35: Linked Data and REST

We can finally get some REST