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
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
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/