SlideShare une entreprise Scribd logo
1  sur  32
REST meets 
Semantic Web 
by Steve Speicher @sspeiche 
©Steve Speicher @sspeiche. All rights reserved. REST meets Semantic Web
Areas to explore… 
RESTperts 
Case Study 
Semantic 
What? 
BEvERages
Look at a real cases 
Case Study 
(show me) 
“Without data you’re just another person with 
an opinion” 
W. Edwards Deming
Case Study 
Problem: 
From some known issues, find out how 
long they have been open per assignee. 
Oh, based on GitHub issues.
GitHub Issues 
Case Study 
There’s an API for that… 
GET /repos/:owner/:repo/issues/:number
Case Study 
$curl https://api.github.com/repos/w3c/ldp-testsuite/issues/17 
{ "created_at": "2014-05-27T20:06:49Z", 
"updated_at": "2014-06-30T01:37:00Z", 
"closed_at": "2014-06-30T01:37:00Z", 
"state": "closed", 
"assignee": { 
"login": "sspeiche", 
"id": 727196, 
"avatar_url": "https://avatars.githubusercontent.com/u/727196?v=2", 
"url": "https://api.github.com/users/sspeiche", 
"followers_url": "https://api.github.com/users/sspeiche/followers", 
"following_url": "https://api.github.com/users/sspeiche/following{/other_user}", 
"gists_url": "https://api.github.com/users/sspeiche/gists{/gist_id}” 
}, 
}
Case Study 
if (val.state == "closed” && val.assignee.login == assignee) { 
computeCloseTime(assignee, val.closed_at, val.created_at); 
} 
Simple enough code, right?
Case Study
Case Study 
$curl https://issues.apache.org/jira/rest/api/2/issue/IO-147 
{ "created": "2007-12-18T13:04:55.320+0000”, 
"updated": "2008-08-22T07:36:50.877+0000", 
"resolutiondate": "2008-01-04T12:32:51.403+0000”, 
"customfield_12310220": "2007-12-18 18:19:12.648", 
"status": { 
"self": "https://issues.apache.org/jira/rest/api/2/status/6", 
"name": "Closed", 
"id": "6", 
}, 
"assignee": { 
"self": "https://issues.apache.org/jira/rest/api/2/user?username=steves", 
"name": ”steves", 
"emailAddress": ”steves at apache dot org", 
"displayName": ”Steve S” 
}, 
}
Case Study 
if (val.state == "closed” && val.assignee.login == assignee) { 
computeCloseTime(assignee, val.closed_at, val.created_at); 
} else if (val.status.name == "Closed” && val.assignee.name == assignee) { 
computeCloseTime(assignee, val.resolutiondate, val.created); 
} 
Code becomes this…. 
…not so simple anymore, but wait!
Case Study
Case Study 
©Steve Speicher @sspeiche. All rights reserved. REST meets Semantic Web
Case Study 
if (val.state == "closed” && val.assignee.login == assignee) { 
computeCloseTime(assignee, val.closed_at, val.created_at); 
} else if (val.status.name == "Closed” && val.assignee.name == assignee) { 
computeCloseTime(assignee, val.resolutiondate, val.created); 
} else if (val.issueState != “Opened” && val.owner.login.id == assignee) { 
computeCloseTime(assignee, convertDateTime(val.end.date, val.end.time), 
convertDateTime(val.start.date, val.start.time)); 
} else if (val.status != “Opened” && 
val.status != “InProgress” && 
val.status != “InReview” && 
matchAssignee(val.assignee.mbox, assignee)) { 
computeCloseTime(assignee, val.lastUpdated, val.creationDate); 
} 
THEN code becomes this….
Case Study 
$curl https://magical.unicorns.org/nonissue4 
Link: </issue.jsonld>; rel=“context” 
{ "created": "2008-08-18T13:04:55.320+0000”, 
"updated": "2008-09-04T12:32:51.403+0000", 
”closed” : "2008-09-04T12:32:51.403+0000”, 
“status” : “closed”, 
"assignee": { 
”@id” : "https://stevespeicher.me", 
”login” : ”sspeiche", 
”mbox” : ”steves@unicorns.org", 
”title": ”Steve S” 
}, 
} 
Ideal
Case Study 
This initial code sample could be the 
var issue = parseIssue(val); 
if (issue.status == “closed” && 
issue.assignee.login == assignee) { 
computeCloseTime(assignee, issue.closed, issue.created); 
} 
complex case too…
Case Study 
var issue = parseIssue(val); 
if (issue.closed && issue.assignee.login == assignee) { 
computeCloseTime(assignee, issue.closed, issue.created); 
} 
…and even simpler
PRACTICAL APPLICATIONS 
OF SEMANTICS IN RETAIL 
A YEAR OF EXPERIMENTATION 
Jay Myers, Best Buy @jaymyers
COMMON DATA FLOW INTO CMS/ PIM 
Data Source(s) PIM/ CMS 
with 
schema 
Accepted 
data 
Discarded 
data 
RDBMS
COMPLETE DATA + SEMANTICS = DISCOVERY 
+ +
CONVERSION 
11x 9x 5x 
“Stocking Stuffers” Valentine’s Day St Patrick’s Day 
* vs. standard site conversion
(web services) 
What is REST? 
Ask the… 
REST 
RESTafarians, RESTperts, …
REST 
(web services) 
Resource GET POST PUT DELETE 
Collection URI 
fetch create 
http://ex.com/resources 
element 
create / 
replace 
rm * 
Element URI 
http://ex.com/resources/item17 
fetch open create / 
replace 
rm
Create and add 
POST /container1 HTTP/1.1 
Host: example.org 
Content-length: 324 
Link: <http://schema.org/context.jsonld>; rel=“context” 
{ 
”@type" : ”http://schema.org/Product", 
”name" : ”White microwave", 
”productId" : ”w2134" 
} 
HTTP/1.1 201 CREATED 
Content-Location: http://example.org/container1/member4 
Response Request 
POST 
container1 
member1 
member2 
member3 
+member4 
http://example.org
Fetch updated collection 
GET /container1 HTTP/1.1 
Host: example.org 
Accept: application/ld+json, application/json, */*;q=0.1 
Request 
GET 
container1 
member1 
member2 
member3 
member4 
http://example.org 
Removed HTTP headers to save some space 
Link: </cat.jsonld>; rel=“context” 
{ 
"@id" : "http://example.org/container1", 
"@type" : ”http://www.w3c.org/ns/ldp#Container", 
"title" : ”Product catalog", 
"member" : [ "member2", "member1", "member3", "member4" ] 
} 
Response
Semantics 
(understanding) 
Semantics 
So I have some representation, now 
what?
hypermedia 
REST 
+ =
<a href=“/item47” type=“product”>Product A</a> 
or 
“productId” : “w2134” 
“name” : “Product B” 
REST 
What about the hypermedia?
Semantics 
Are we talking about the same thing? 
“productId” : “w2134” 
or 
“product” : “http://ex.com/resources/item47”
Semantics 
What are we talking about? 
“productId” : “w2134” 
or 
“@type” : “http://schema.org/Product” 
“isCatalog” : true 
or 
“@type” : “http://www.w3.org/ns/ldp#Container”
Did a small part of Roy T. Fielding die? 
What went wrong? 
Wrap it up
Discovery Docs 
Wrap it up 
URL templates - https://tools.ietf.org/html/rfc6570 
JSON-Home - http://tools.ietf.org/html/draft-nottingham-json-home-03 
stacker.io - http://petstore.swagger.wordnik.com/
© your company name. All rights reserved. Title of your presentation

Contenu connexe

Tendances

WWW2014 Overview of W3C Linked Data Platform 20140410
WWW2014 Overview of W3C Linked Data Platform 20140410WWW2014 Overview of W3C Linked Data Platform 20140410
WWW2014 Overview of W3C Linked Data Platform 20140410Arnaud Le Hors
 
Slug: A Semantic Web Crawler
Slug: A Semantic Web CrawlerSlug: A Semantic Web Crawler
Slug: A Semantic Web CrawlerLeigh Dodds
 
Approaching Join Index: Presented by Mikhail Khludnev, Grid Dynamics
Approaching Join Index: Presented by Mikhail Khludnev, Grid DynamicsApproaching Join Index: Presented by Mikhail Khludnev, Grid Dynamics
Approaching Join Index: Presented by Mikhail Khludnev, Grid DynamicsLucidworks
 
Inverted textindexing
Inverted textindexingInverted textindexing
Inverted textindexingKhwaja Aamer
 
Towards a common deposit api (the dataverse example) Elizabeth Quigley + Phil...
Towards a common deposit api (the dataverse example) Elizabeth Quigley + Phil...Towards a common deposit api (the dataverse example) Elizabeth Quigley + Phil...
Towards a common deposit api (the dataverse example) Elizabeth Quigley + Phil...datascienceiqss
 
Approaching Join Index - Lucene/Solr Revolution 2014
Approaching Join Index - Lucene/Solr Revolution 2014Approaching Join Index - Lucene/Solr Revolution 2014
Approaching Join Index - Lucene/Solr Revolution 2014Grid Dynamics
 
Open for Business Open Archives, OpenURL, RSS and the Dublin Core
Open for Business  Open Archives, OpenURL, RSS and the Dublin CoreOpen for Business  Open Archives, OpenURL, RSS and the Dublin Core
Open for Business Open Archives, OpenURL, RSS and the Dublin CoreAndy Powell
 
Open for Business - Open Archives, OpenURL, RSS and the Dublin Core
Open for Business - Open Archives, OpenURL, RSS and the Dublin CoreOpen for Business - Open Archives, OpenURL, RSS and the Dublin Core
Open for Business - Open Archives, OpenURL, RSS and the Dublin CoreAndy Powell
 
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey IntroductionseyCwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey Introductionseyelliando dias
 
The Web of data and web data commons
The Web of data and web data commonsThe Web of data and web data commons
The Web of data and web data commonsJesse Wang
 
Making Java REST with JAX-RS 2.0
Making Java REST with JAX-RS 2.0Making Java REST with JAX-RS 2.0
Making Java REST with JAX-RS 2.0Dmytro Chyzhykov
 
Content extraction with apache tika
Content extraction with apache tikaContent extraction with apache tika
Content extraction with apache tikaJukka Zitting
 
Mikhail khludnev: approaching-join index for lucene
Mikhail khludnev:  approaching-join index for luceneMikhail khludnev:  approaching-join index for lucene
Mikhail khludnev: approaching-join index for luceneGrid Dynamics
 
Grouping and Joining in Lucene/Solr
Grouping and Joining in Lucene/SolrGrouping and Joining in Lucene/Solr
Grouping and Joining in Lucene/Solrlucenerevolution
 
Poster GraphQL-LD: Linked Data Querying with GraphQL
Poster GraphQL-LD: Linked Data Querying with GraphQLPoster GraphQL-LD: Linked Data Querying with GraphQL
Poster GraphQL-LD: Linked Data Querying with GraphQLRuben Taelman
 
Querying federations 
of Triple Pattern Fragments
Querying federations 
of Triple Pattern FragmentsQuerying federations 
of Triple Pattern Fragments
Querying federations 
of Triple Pattern FragmentsRuben Verborgh
 
SWIB14 Weaving repository contents into the Semantic Web
SWIB14 Weaving repository contents into the Semantic WebSWIB14 Weaving repository contents into the Semantic Web
SWIB14 Weaving repository contents into the Semantic WebPascal-Nicolas Becker
 
Describing configurations of software experiments as Linked Data
Describing configurations of software experiments as Linked DataDescribing configurations of software experiments as Linked Data
Describing configurations of software experiments as Linked DataJoachim Van Herwegen
 

Tendances (20)

WWW2014 Overview of W3C Linked Data Platform 20140410
WWW2014 Overview of W3C Linked Data Platform 20140410WWW2014 Overview of W3C Linked Data Platform 20140410
WWW2014 Overview of W3C Linked Data Platform 20140410
 
Slug: A Semantic Web Crawler
Slug: A Semantic Web CrawlerSlug: A Semantic Web Crawler
Slug: A Semantic Web Crawler
 
Approaching Join Index: Presented by Mikhail Khludnev, Grid Dynamics
Approaching Join Index: Presented by Mikhail Khludnev, Grid DynamicsApproaching Join Index: Presented by Mikhail Khludnev, Grid Dynamics
Approaching Join Index: Presented by Mikhail Khludnev, Grid Dynamics
 
Sword v2 at UKCoRR
Sword v2 at UKCoRRSword v2 at UKCoRR
Sword v2 at UKCoRR
 
Inverted textindexing
Inverted textindexingInverted textindexing
Inverted textindexing
 
Towards a common deposit api (the dataverse example) Elizabeth Quigley + Phil...
Towards a common deposit api (the dataverse example) Elizabeth Quigley + Phil...Towards a common deposit api (the dataverse example) Elizabeth Quigley + Phil...
Towards a common deposit api (the dataverse example) Elizabeth Quigley + Phil...
 
Approaching Join Index - Lucene/Solr Revolution 2014
Approaching Join Index - Lucene/Solr Revolution 2014Approaching Join Index - Lucene/Solr Revolution 2014
Approaching Join Index - Lucene/Solr Revolution 2014
 
Open for Business Open Archives, OpenURL, RSS and the Dublin Core
Open for Business  Open Archives, OpenURL, RSS and the Dublin CoreOpen for Business  Open Archives, OpenURL, RSS and the Dublin Core
Open for Business Open Archives, OpenURL, RSS and the Dublin Core
 
Open for Business - Open Archives, OpenURL, RSS and the Dublin Core
Open for Business - Open Archives, OpenURL, RSS and the Dublin CoreOpen for Business - Open Archives, OpenURL, RSS and the Dublin Core
Open for Business - Open Archives, OpenURL, RSS and the Dublin Core
 
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey IntroductionseyCwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
 
The Web of data and web data commons
The Web of data and web data commonsThe Web of data and web data commons
The Web of data and web data commons
 
Making Java REST with JAX-RS 2.0
Making Java REST with JAX-RS 2.0Making Java REST with JAX-RS 2.0
Making Java REST with JAX-RS 2.0
 
Content extraction with apache tika
Content extraction with apache tikaContent extraction with apache tika
Content extraction with apache tika
 
Mikhail khludnev: approaching-join index for lucene
Mikhail khludnev:  approaching-join index for luceneMikhail khludnev:  approaching-join index for lucene
Mikhail khludnev: approaching-join index for lucene
 
Grouping and Joining in Lucene/Solr
Grouping and Joining in Lucene/SolrGrouping and Joining in Lucene/Solr
Grouping and Joining in Lucene/Solr
 
Poster GraphQL-LD: Linked Data Querying with GraphQL
Poster GraphQL-LD: Linked Data Querying with GraphQLPoster GraphQL-LD: Linked Data Querying with GraphQL
Poster GraphQL-LD: Linked Data Querying with GraphQL
 
Querying federations 
of Triple Pattern Fragments
Querying federations 
of Triple Pattern FragmentsQuerying federations 
of Triple Pattern Fragments
Querying federations 
of Triple Pattern Fragments
 
How we build Vox
How we build VoxHow we build Vox
How we build Vox
 
SWIB14 Weaving repository contents into the Semantic Web
SWIB14 Weaving repository contents into the Semantic WebSWIB14 Weaving repository contents into the Semantic Web
SWIB14 Weaving repository contents into the Semantic Web
 
Describing configurations of software experiments as Linked Data
Describing configurations of software experiments as Linked DataDescribing configurations of software experiments as Linked Data
Describing configurations of software experiments as Linked Data
 

En vedette

Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesSteve Speicher
 
Innovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsInnovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsSteve Speicher
 
JavaOne2013 Leveraging Linked Data and OSLC
JavaOne2013 Leveraging Linked Data and OSLCJavaOne2013 Leveraging Linked Data and OSLC
JavaOne2013 Leveraging Linked Data and OSLCSteve Speicher
 
Innovate2011 DevOps TSRM RTC
Innovate2011 DevOps TSRM RTCInnovate2011 DevOps TSRM RTC
Innovate2011 DevOps TSRM RTCSteve Speicher
 
OSLC (Open Services for Lifecycle Collaboration): open standard for interoper...
OSLC (Open Services for Lifecycle Collaboration): open standard for interoper...OSLC (Open Services for Lifecycle Collaboration): open standard for interoper...
OSLC (Open Services for Lifecycle Collaboration): open standard for interoper...olberger
 
Innovate 2012 ls 1439 linked data oslc
Innovate 2012 ls 1439 linked data oslcInnovate 2012 ls 1439 linked data oslc
Innovate 2012 ls 1439 linked data oslcSteve Speicher
 
Better integrations through open interfaces
Better integrations through open interfacesBetter integrations through open interfaces
Better integrations through open interfacesSteve Speicher
 
Oslc for owf think tank on open forges
Oslc for owf think tank on open forgesOslc for owf think tank on open forges
Oslc for owf think tank on open forgesSteve Speicher
 
Innovate2014 Panel - Best Practices on Implementing Integrations
Innovate2014 Panel - Best Practices on Implementing IntegrationsInnovate2014 Panel - Best Practices on Implementing Integrations
Innovate2014 Panel - Best Practices on Implementing IntegrationsSteve Speicher
 
DevOps in Cloud OSLC Integration
DevOps in Cloud OSLC IntegrationDevOps in Cloud OSLC Integration
DevOps in Cloud OSLC IntegrationSteve Speicher
 
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at FlickrJohn Allspaw
 

En vedette (11)

Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open Interfaces
 
Innovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsInnovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC Integrations
 
JavaOne2013 Leveraging Linked Data and OSLC
JavaOne2013 Leveraging Linked Data and OSLCJavaOne2013 Leveraging Linked Data and OSLC
JavaOne2013 Leveraging Linked Data and OSLC
 
Innovate2011 DevOps TSRM RTC
Innovate2011 DevOps TSRM RTCInnovate2011 DevOps TSRM RTC
Innovate2011 DevOps TSRM RTC
 
OSLC (Open Services for Lifecycle Collaboration): open standard for interoper...
OSLC (Open Services for Lifecycle Collaboration): open standard for interoper...OSLC (Open Services for Lifecycle Collaboration): open standard for interoper...
OSLC (Open Services for Lifecycle Collaboration): open standard for interoper...
 
Innovate 2012 ls 1439 linked data oslc
Innovate 2012 ls 1439 linked data oslcInnovate 2012 ls 1439 linked data oslc
Innovate 2012 ls 1439 linked data oslc
 
Better integrations through open interfaces
Better integrations through open interfacesBetter integrations through open interfaces
Better integrations through open interfaces
 
Oslc for owf think tank on open forges
Oslc for owf think tank on open forgesOslc for owf think tank on open forges
Oslc for owf think tank on open forges
 
Innovate2014 Panel - Best Practices on Implementing Integrations
Innovate2014 Panel - Best Practices on Implementing IntegrationsInnovate2014 Panel - Best Practices on Implementing Integrations
Innovate2014 Panel - Best Practices on Implementing Integrations
 
DevOps in Cloud OSLC Integration
DevOps in Cloud OSLC IntegrationDevOps in Cloud OSLC Integration
DevOps in Cloud OSLC Integration
 
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
 

Similaire à REST meets Semantic Web

Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responsesdarrelmiller71
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSam Brannen
 
12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocratJonathan Linowes
 
Get Real: Adventures in realtime web apps
Get Real: Adventures in realtime web appsGet Real: Adventures in realtime web apps
Get Real: Adventures in realtime web appsdaviddemello
 
API Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationAPI Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
 
Top 10 F5 iRules to migrate to a modern load balancing platform
Top 10 F5 iRules to migrate to a modern load balancing platformTop 10 F5 iRules to migrate to a modern load balancing platform
Top 10 F5 iRules to migrate to a modern load balancing platformAvi Networks
 
Build a Node.js Client for Your REST+JSON API
Build a Node.js Client for Your REST+JSON APIBuild a Node.js Client for Your REST+JSON API
Build a Node.js Client for Your REST+JSON APIStormpath
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...SPTechCon
 
Efficient HTTP Apis
Efficient HTTP ApisEfficient HTTP Apis
Efficient HTTP ApisAdrian Cole
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
 
Full Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQLFull Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQLAll Things Open
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to TornadoGavin Roy
 
Scalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSScalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSCosmin Mereuta
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 
03 form-data
03 form-data03 form-data
03 form-datasnopteck
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemdelagoya
 

Similaire à REST meets Semantic Web (20)

Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responses
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat
 
Get Real: Adventures in realtime web apps
Get Real: Adventures in realtime web appsGet Real: Adventures in realtime web apps
Get Real: Adventures in realtime web apps
 
API Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationAPI Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API Documentation
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
Top 10 F5 iRules to migrate to a modern load balancing platform
Top 10 F5 iRules to migrate to a modern load balancing platformTop 10 F5 iRules to migrate to a modern load balancing platform
Top 10 F5 iRules to migrate to a modern load balancing platform
 
Pushing the Web: Interesting things to Know
Pushing the Web: Interesting things to KnowPushing the Web: Interesting things to Know
Pushing the Web: Interesting things to Know
 
Build a Node.js Client for Your REST+JSON API
Build a Node.js Client for Your REST+JSON APIBuild a Node.js Client for Your REST+JSON API
Build a Node.js Client for Your REST+JSON API
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
 
Efficient HTTP Apis
Efficient HTTP ApisEfficient HTTP Apis
Efficient HTTP Apis
 
servlets
servletsservlets
servlets
 
Fake My Party
Fake My PartyFake My Party
Fake My Party
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
Full Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQLFull Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQL
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Scalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSScalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JS
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API Documentation
 
03 form-data
03 form-data03 form-data
03 form-data
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problem
 

REST meets Semantic Web

  • 1. REST meets Semantic Web by Steve Speicher @sspeiche ©Steve Speicher @sspeiche. All rights reserved. REST meets Semantic Web
  • 2. Areas to explore… RESTperts Case Study Semantic What? BEvERages
  • 3. Look at a real cases Case Study (show me) “Without data you’re just another person with an opinion” W. Edwards Deming
  • 4. Case Study Problem: From some known issues, find out how long they have been open per assignee. Oh, based on GitHub issues.
  • 5. GitHub Issues Case Study There’s an API for that… GET /repos/:owner/:repo/issues/:number
  • 6. Case Study $curl https://api.github.com/repos/w3c/ldp-testsuite/issues/17 { "created_at": "2014-05-27T20:06:49Z", "updated_at": "2014-06-30T01:37:00Z", "closed_at": "2014-06-30T01:37:00Z", "state": "closed", "assignee": { "login": "sspeiche", "id": 727196, "avatar_url": "https://avatars.githubusercontent.com/u/727196?v=2", "url": "https://api.github.com/users/sspeiche", "followers_url": "https://api.github.com/users/sspeiche/followers", "following_url": "https://api.github.com/users/sspeiche/following{/other_user}", "gists_url": "https://api.github.com/users/sspeiche/gists{/gist_id}” }, }
  • 7. Case Study if (val.state == "closed” && val.assignee.login == assignee) { computeCloseTime(assignee, val.closed_at, val.created_at); } Simple enough code, right?
  • 9. Case Study $curl https://issues.apache.org/jira/rest/api/2/issue/IO-147 { "created": "2007-12-18T13:04:55.320+0000”, "updated": "2008-08-22T07:36:50.877+0000", "resolutiondate": "2008-01-04T12:32:51.403+0000”, "customfield_12310220": "2007-12-18 18:19:12.648", "status": { "self": "https://issues.apache.org/jira/rest/api/2/status/6", "name": "Closed", "id": "6", }, "assignee": { "self": "https://issues.apache.org/jira/rest/api/2/user?username=steves", "name": ”steves", "emailAddress": ”steves at apache dot org", "displayName": ”Steve S” }, }
  • 10. Case Study if (val.state == "closed” && val.assignee.login == assignee) { computeCloseTime(assignee, val.closed_at, val.created_at); } else if (val.status.name == "Closed” && val.assignee.name == assignee) { computeCloseTime(assignee, val.resolutiondate, val.created); } Code becomes this…. …not so simple anymore, but wait!
  • 12. Case Study ©Steve Speicher @sspeiche. All rights reserved. REST meets Semantic Web
  • 13. Case Study if (val.state == "closed” && val.assignee.login == assignee) { computeCloseTime(assignee, val.closed_at, val.created_at); } else if (val.status.name == "Closed” && val.assignee.name == assignee) { computeCloseTime(assignee, val.resolutiondate, val.created); } else if (val.issueState != “Opened” && val.owner.login.id == assignee) { computeCloseTime(assignee, convertDateTime(val.end.date, val.end.time), convertDateTime(val.start.date, val.start.time)); } else if (val.status != “Opened” && val.status != “InProgress” && val.status != “InReview” && matchAssignee(val.assignee.mbox, assignee)) { computeCloseTime(assignee, val.lastUpdated, val.creationDate); } THEN code becomes this….
  • 14. Case Study $curl https://magical.unicorns.org/nonissue4 Link: </issue.jsonld>; rel=“context” { "created": "2008-08-18T13:04:55.320+0000”, "updated": "2008-09-04T12:32:51.403+0000", ”closed” : "2008-09-04T12:32:51.403+0000”, “status” : “closed”, "assignee": { ”@id” : "https://stevespeicher.me", ”login” : ”sspeiche", ”mbox” : ”steves@unicorns.org", ”title": ”Steve S” }, } Ideal
  • 15. Case Study This initial code sample could be the var issue = parseIssue(val); if (issue.status == “closed” && issue.assignee.login == assignee) { computeCloseTime(assignee, issue.closed, issue.created); } complex case too…
  • 16. Case Study var issue = parseIssue(val); if (issue.closed && issue.assignee.login == assignee) { computeCloseTime(assignee, issue.closed, issue.created); } …and even simpler
  • 17. PRACTICAL APPLICATIONS OF SEMANTICS IN RETAIL A YEAR OF EXPERIMENTATION Jay Myers, Best Buy @jaymyers
  • 18. COMMON DATA FLOW INTO CMS/ PIM Data Source(s) PIM/ CMS with schema Accepted data Discarded data RDBMS
  • 19. COMPLETE DATA + SEMANTICS = DISCOVERY + +
  • 20. CONVERSION 11x 9x 5x “Stocking Stuffers” Valentine’s Day St Patrick’s Day * vs. standard site conversion
  • 21. (web services) What is REST? Ask the… REST RESTafarians, RESTperts, …
  • 22. REST (web services) Resource GET POST PUT DELETE Collection URI fetch create http://ex.com/resources element create / replace rm * Element URI http://ex.com/resources/item17 fetch open create / replace rm
  • 23. Create and add POST /container1 HTTP/1.1 Host: example.org Content-length: 324 Link: <http://schema.org/context.jsonld>; rel=“context” { ”@type" : ”http://schema.org/Product", ”name" : ”White microwave", ”productId" : ”w2134" } HTTP/1.1 201 CREATED Content-Location: http://example.org/container1/member4 Response Request POST container1 member1 member2 member3 +member4 http://example.org
  • 24. Fetch updated collection GET /container1 HTTP/1.1 Host: example.org Accept: application/ld+json, application/json, */*;q=0.1 Request GET container1 member1 member2 member3 member4 http://example.org Removed HTTP headers to save some space Link: </cat.jsonld>; rel=“context” { "@id" : "http://example.org/container1", "@type" : ”http://www.w3c.org/ns/ldp#Container", "title" : ”Product catalog", "member" : [ "member2", "member1", "member3", "member4" ] } Response
  • 25. Semantics (understanding) Semantics So I have some representation, now what?
  • 27. <a href=“/item47” type=“product”>Product A</a> or “productId” : “w2134” “name” : “Product B” REST What about the hypermedia?
  • 28. Semantics Are we talking about the same thing? “productId” : “w2134” or “product” : “http://ex.com/resources/item47”
  • 29. Semantics What are we talking about? “productId” : “w2134” or “@type” : “http://schema.org/Product” “isCatalog” : true or “@type” : “http://www.w3.org/ns/ldp#Container”
  • 30. Did a small part of Roy T. Fielding die? What went wrong? Wrap it up
  • 31. Discovery Docs Wrap it up URL templates - https://tools.ietf.org/html/rfc6570 JSON-Home - http://tools.ietf.org/html/draft-nottingham-json-home-03 stacker.io - http://petstore.swagger.wordnik.com/
  • 32. © your company name. All rights reserved. Title of your presentation

Notes de l'éditeur

  1. Inter status “closed” by the existence of the issue.closed property having a value
  2. Source: http://www.slideshare.net/jaymmyers/practical-applications-of-semantic-web-in-retail-semtech-2014