SlideShare ist ein Scribd-Unternehmen logo
1 von 99
Downloaden Sie, um offline zu lesen
Hypermedia in Practice 
1 © 2013 by Intellectual Reserve, Inc. All rights reserved.
The Goal 
2 © 2013 by Intellectual Reserve, Inc. All rights reserved.
The Goal 
Learn how to use hypermedia for better 
Web service APIs. 
3 © 2013 by Intellectual Reserve, Inc. All rights reserved.
The Goal 
Learn how to use hypermedia for better 
Web service APIs. 
Better? 
●More Adaptable 
●More Robust 
●More Maintainable 
● Less Pain 
4 © 2013 by Intellectual Reserve, Inc. All rights reserved.
A Review 
● Web service API 
– A set of digital services and/or resources 
made accessible over a computer network. 
● HTTP 
– Hypertext Transfer Protocol 
– Defines how to make requests and interpret 
responses.
A Review 
● Resources 
– The units of data making up the “matter” of 
the API. 
– The “subject” of HTTP operations. 
● Uniform Resource Identifier 
– The locator for a resource. 
– Includes a domain, path, query.
A Review 
● Resource Representations 
– How resources are serialized to a stream of 
bytes. 
– Often JSON and XML. 
– a.k.a. “media types” or “data formats” 
● See “Architecture of the World Wide Web” 
– http://www.w3.org/TR/webarch/
Client
WWW
API Server
Resource 
Store
URI
HTTP 
“GET /path/to/resource”
Resource 
HTTP 
“GET /path/to/resource”
“OK" 
Resource 
Representation 
<resource> 

 
</resource> 
{ 
“resource” : 
 
}
These change. 
Frequently.
What If...
What If... 
...a resource representation 
changes its property order? 
{ 

 
“names” : [ 
 ], 
“facts” : [ 
 ], 
“gender” : { 
 }, 

 
} 
{ 

 
“gender” : { 
 }, 
“names” : [ 
 ], 
“facts” : [ 
 ], 

 
}
What If... 
...a resource representation 
adds some whitespace? 
{“names”:[ 
 ],“facts”: 
[ 
 ],“gender”:{ 
 },
} 
{ 
“names” : [ 
 ], 
“facts” : [ 
 ], 
“gender” : { 
 }, 

 
} 
<person><name>...</name 
><fact>...</fact><gende 
r>...</gender></person> 
<person> 
<name>...</name> 
<fact>...</fact> 
<gender>...</gender> 
</person>
...an XML representation 
changes namespace prefixes? 
<person xmlns=”...”> 
<name>...</name> 
<fact>...</fact> 
<gender>...</gender> 
</person> 
<gx:person xmlns:gx=”...”> 
<gx:name>...</gx:name> 
<gx:fact>...</gx:fact> 
<gx:gender>...</gx:gender> 
</gx:person> 
What If...
What If... 
...a caching policy changes?
What If... 
...new resources become available? 
Available Resources 
● Person 
● Relationship 
● Person Search 
● ... 
Available Resources 
● Person 
● Relationship 
● Person Search 
● Records 
● Record 
● Record Search 
● ...
What If... 
...an API changes domains? 
https://familysearch.org/platform 
https://familysearch.io/platform
What If... 
...a resource moves? 
/platform/tree/persons/12345/matches 
/platform/tree/persons/12345/duplicates
What If... 
...subresources are included 
in their “parent” resource? 
/person/12345 
Person 
/person/12345/notes Person 
Person 
Notes 
Source 
References 
/person/12345/sources 
/person/12345 
Person 
+ 
Notes 
+ 
Source References
What If... 
● ...property order changes? 
● ...some whitespace is added? 
● ...XML changes namespace prefixes? 
● ...caching policy changes? 
● ...new resources are available? 
● ...a resource moves? 
● ...subresources are included in their 
"parent" resource?
What If... 
● ...property order changes? 
● ...some whitespace is added? 
● ...XML changes namespace prefixes? 
● ...caching policy changes? 
● ...new resources are available? 
● ...a resource moves? 
● ...subresources are included in their 
"parent" resource?
Speaks HTTP fluently. 
Understands the URI. 
Uses links to get stuff 
done.
...a resource representation 
changes its property order? 
<html> 
<head> 

 
<script src=”...”></script> 

 
</head> 
<body> 

 
</body> 
</html> 
What If...
...a resource representation 
changes its property order? 
<html> 
<head> 

 
<script src=”...”></script> 

 
</head> 
<body> 

 
</body> 
</html> 
What If... 
<html> 
<head> 

 
</head> 
<body> 

 
<script src=”...”></script> 

 
</body> 
</html>
...a resource representation 
changes its property order? 
<html> 
<head> 

 
<script src=”...”></script> 

 
</head> 
<body> 

 
</body> 
</html> 
What If... 
<html> 
<head> 

 
</head> 
<body> 

 
<script src=”...”></script> 

 
</body> 
</html> 
HTML says... 
“OK”
What If... 
...a resource representation 
changes its property order? 
{ 

 
“names” : [ 
 ], 
“facts” : [ 
 ], 
“gender” : { 
 }, 

 
} 
{ 

 
“gender” : { 
 }, 
“names” : [ 
 ], 
“facts” : [ 
 ], 

 
}
What If... 
...a resource representation 
changes its property order? 
{ 

 
“names” : [ 
 ], 
“facts” : [ 
 ], 
“gender” : { 
 }, 

 
} 
{ 

 
“gender” : { 
 }, 
“names” : [ 
 ], 
“facts” : [ 
 ], 

 
} 
GEDCOM X says... 
“OK”
What If... 
...a resource representation 
adds some whitespace? 
<html><head>
</head><body>
 
</body></html>
What If... 
...a resource representation 
adds some whitespace? 
<html><head>
</head><body>
 
</body></html> 
<html> 
<head> 

 
</head> 
<body> 

 
</body> 
</html>
What If... 
...a resource representation 
adds some whitespace? 
<html><head>
</head><body>
 
</body></html> 
<html> 
<head> 

 
</head> 
<body> 

 
</body> 
</html> 
HTML says... 
“OK”
What If... 
...a resource representation 
adds some whitespace? 
{“names”:[ 
 ],“facts”: 
[ 
 ],“gender”:{ 
 },
} 
{ 
“names” : [ 
 ], 
“facts” : [ 
 ], 
“gender” : { 
 }, 

 
} 
<person><name>...</name 
><fact>...</fact><gende 
r>...</gender></person> 
<person> 
<name>...</name> 
<fact>...</fact> 
<gender>...</gender> 
</person>
What If... 
...a resource representation 
adds some whitespace? 
{ 
“names” : [ 
 ], 
“facts” : [ 
 ], 
“gender” : { 
 }, 

 
} 
<person><name>...</name 
><fact>...</fact><gende 
r>...</gender></person> 
<person> 
<name>...</name> 
<fact>...</fact> 
<gender>...</gender> 
</person> 
{“names”:[ 
 ],“facts”: 
[ 
 ],“gender”:{ 
 },
} 
JSON says... 
“OK”
What If... 
...a resource representation 
adds some whitespace? 
{ 
“names” : [ 
 ], 
“facts” : [ 
 ], 
“gender” : { 
 }, 

 
} 
<person><name>...</name 
><fact>...</fact><gende 
r>...</gender></person> 
<person> 
<name>...</name> 
<fact>...</fact> 
<gender>...</gender> 
</person> 
{“names”:[ 
 ],“facts”: 
[ 
 ],“gender”:{ 
 },
} 
XML says... 
“OK”
...an XML representation 
changes namespace prefixes? 
<person xmlns=”...”> 
<name>...</name> 
<fact>...</fact> 
<gender>...</gender> 
</person> 
<gx:person xmlns:gx=”...”> 
<gx:name>...</gx:name> 
<gx:fact>...</gx:fact> 
<gx:gender>...</gx:gender> 
</gx:person> 
What If...
...an XML representation 
changes namespace prefixes? 
<person xmlns=”...”> 
<name>...</name> 
<fact>...</fact> 
<gender>...</gender> 
</person> 
<gx:person xmlns:gx=”...”> 
<gx:name>...</gx:name> 
<gx:fact>...</gx:fact> 
<gx:gender>...</gx:gender> 
</gx:person> 
What If...XML says... 
“OK”
What If... 
...a caching policy changes? 
HTTP/1.1 200 OK 

 
Cache-Control: no-store 


What If... 
...a caching policy changes? 
HTTP/1.1 200 OK 

 
Cache-Control: no-store 

 
HTTP/1.1 200 OK 

 
Cache-Control: public, max-age=3600 
ETag: 1234567890 


What If... 
HTTP says... 
“OK” 
...a caching policy changes? 
HTTP/1.1 200 OK 

 
Cache-Control: no-store 

 
HTTP/1.1 200 OK 

 
Cache-Control: public, max-age=3600 
ETag: 1234567890 


What If... 
...a caching policy changes?
What If... 
...new resources become available?
What If... 
...new resources become available?
What If... 
...new resources become available? 
Available Resources 
● Person 
● Relationship 
● Person Search 
● ... 
Available Resources 
● Person 
● Relationship 
● Person Search 
● Records 
● Record 
● Record Search 
● ...
What If... 
...new resources become available? 
Available Resources 
● Person 
● Relationship 
● Person Search 
● ... 
Available Resources 
● Person 
● Relationship 
● Person Search 
● Records 
● Record 
● Record Search 
● ... 
Hypermedia
What If... 
...an API changes domains?
What If... 
HTTP says... 
“Moved” 
...an API changes domains? 
HTTP/1.1 301 Moved Permanently 

 
Location: http://www.facebook.com/ 


What If... 
...an API changes domains?
What If... 
...an API changes domains? 
HTTP/1.1 301 Moved Permanently 

 
Location: http://familysearch.io/ 


What If... 
...a resource moves? 
/platform/tree/persons/12345/matches 
/platform/tree/persons/12345/duplicates
What If... 
...a resource moves? 
<html> 
<body> 

 
<form action=”/path/to/resource”> 
<input 
/> 
</form> 
</body> 
</html>
What If... 
...a resource moves? 
<html> 
<body> 

 
<form action=”/path/to/resource”> 
<input 
/> 
</form> 
</body> 
</html> 
<html> 
<body> 

 
<form action=”/NEW/resource/PATH”> 
<input 
/> 
</form> 
</body> 
</html>
What If... 
...a resource moves? 
<html> 
<body> 

 
<form action=”/path/to/resource”> 
<input 
/> 
</form> 
</body> 
</html> 
<html> 
<body> 

 
<form action=”/NEW/resource/PATH”> 
<input 
/> 
</form> 
</body> 
</html> 
Hypermedia
What If... 
...a resource moves? 
<gedcomx> 
<person id=”12345”> 

 
<link rel=”matches” 
href=”/persons/12345/matches”/> 

 
</person> 
</gedcomx>
What If... 
...a resource moves? 
<gedcomx> 
<person id=”12345”> 

 
<link rel=”matches” 
href=”/persons/12345/matches”/> 

 
</person> 
</gedcomx> 
<gedcomx> 
<person id=”12345”> 

 
<link rel=”matches” 
href=”/persons/12345/duplicates”/> 

 
</person> 
</gedcomx>
What If... 
...a resource moves? 
<gedcomx> 
<person id=”12345”> 

 
<link rel=”matches” 
href=”/persons/12345/matches”/> 

 
</person> 
</gedcomx> 
<gedcomx> 
<person id=”12345”> 

 
<link rel=”matches” 
href=”/persons/12345/duplicates”/> 

 
</person> 
</gedcomx> 
Hypermedia
What If... 
...subresources are included 
in their “parent” resource? 
/person/12345 
Person 
/person/12345/notes Person 
Person 
Notes 
Source 
References 
/person/12345/sources 
/person/12345 
Person 
+ 
Notes 
+ 
Source References
What If... 
...subresources are included 
in their “parent” resource? 
<html> 
<head> 

 
<link rel=”stylesheet” href=”...”/> 
<script src=”...”></script> 

 
</head> 
<body> 

 
</body> 
</html>
What If... 
...subresources are included 
in their “parent” resource? 
<html> 
<head> 

 
<link rel=”stylesheet” href=”...”/> 
<script src=”...”></script> 

 
</head> 
<body> 

 
</body> 
</html> 
Embedded Links 
(Hypermedia)
What If... 
...subresources are included 
in their “parent” resource? 
<html> 
<head> 

 
<link rel=”stylesheet” href=”...”/> 
<script src=”...”></script> 

 
</head> 
<body> 

 
</body> 
</html> 
<html> 
<head> 

 
<style> 

 
</style> 
<script> 

 
</script> 

 
</head> 
<body> 

 
</body> 
</html>
What If... 
...subresources are included 
in their “parent” resource? 
<html> 
<head> 

 
<link rel=”stylesheet” href=”...”/> 
<script src=”...”></script> 

 
</head> 
<body> 

 
</body> 
</html> 
<html> 
<head> 

 
<style> 

 
</style> 
<script> 

 
</script> 

 
</head> 
<body> 

 
</body> 
</html> 
HTML says... 
“OK”
What If... 
...subresources are included 
in their “parent” resource? 
<gedcomx> 
<person id=”12345”> 

 
<link rel=”source-references” 
href=”/persons/12345/sources”/> 
<link rel=”notes” 
href=”/persons/12345/notes”/> 

 
</person> 
</gedcomx>
What If... 
...subresources are included 
in their “parent” resource? 
<gedcomx> 
<person id=”12345”> 

 
<link rel=”source-references” 
href=”/persons/12345/sources”/> 
<link rel=”notes” 
href=”/persons/12345/notes”/> 

 
</person> 
</gedcomx> 
Embedded Links 
(Hypermedia)
What If... 
...subresources are included 
in their “parent” resource? 
<gedcomx> 
<person id=”12345”> 

 
<link rel=”source-references” 
href=”/persons/12345/sources”/> 
<link rel=”notes” 
href=”/persons/12345/notes”/> 

 
</person> 
</gedcomx> 
<gedcomx> 
<person id=”12345”> 

 
<source description=”...”/> 
<note id=”...”> 

 
</note> 
</person> 
</gedcomx>
What If... 
...subresources are included 
in their “parent” resource? 
<gedcomx> 
<person id=”12345”> 

 
<link rel=”source-references” 
href=”/persons/12345/sources”/> 
<link rel=”notes” 
href=”/persons/12345/notes”/> 

 
</person> 
</gedcomx> 
<gedcomx> 
<person id=”12345”> 

 
<source description=”...”/> 
<note id=”...”> 

 
</note> 
</person> 
</gedcomx> 
GEDCOM X says... 
“OK”
So.
So. 
● Speak HTTP fluently. 
●Understand the URI. 
●Use links to get stuff done.
So. 
● Speak HTTP fluently. 
● Understand the URI. 
● Use links to get stuff done. 
Yeah. Like a screen scraper.
links
What do 
links 
look like?
What do 
links 
look like? 
Depends on the 
media type.
<a href=”...”/> 
<link rel=”” href=””/> 
links 
<img src=”...”/> 
<script src=”...”/>
Why use 
links 
? 
So APIs can change 
without breaking clients.
How To...
How To... 
● Add a person to a collection. 
● Search a collection for persons. 
● Do a “full” person read. 
● Upload an artifact to a collection. 
● Edit the birth date of a person. 
● Read the list of photos on a person. 
● Delete a person.
How To... 
Add a person to a collection. 
● Read the collection. 
● Find the link to the “persons” of the 
collection. 
● POST the new person to that URI.
How To... 
Add a person to a collection. 
● Read the collection. 
● Find the link to the “persons” of the 
collection. 
● POST the new person to that URI.
How To... 
Add a person to a collection. 
GET /platform/collections/tree 
<gedcomx xmlns=”http://gedcomx.org/v1”> 
<collection> 
<title>FamilySearch Family Tree</title> 
... 
<link rel=”persons” href=”/path/to/persons/resource”/> 
... 
</collection> 
</gedcomx>
How To... 
Search a collection for persons. 
● Read the collection. 
● Find the link to the “person-search” of the 
collection. 
● Fill in the parameters and issue the 
request.
How To... 
GET /platform/collections/tree 
<gedcomx xmlns=”http://gedcomx.org/v1”> 
<collection> 
<title>FamilySearch Family Tree</title> 
... 
<link rel=”person-search” 
template=”/path/to/person/search{?q}”/> 
... 
</collection> 
</gedcomx> 
Search a collection for persons.
How To... 
Do a “full” person read. 
● Read the person. 
● For each “embedded” link, get the 
resource and embed it. 
– Source references 
– Discussion references 
– Notes 
– Relationships
How To... 
Do a “full” person read. 
<gedcomx xmlns=”http://gedcomx.org/v1”> 
<person id=”P2”> 
<name>...</name> 
... 
<link rel=”source-references” href=”/path/to/refs”/> 
<link rel=”notes” href=”/path/to/notes”/> 
<link rel=”child-relationships” href=”/path/to/rels”/> 
<link rel=”parent-relationships” href=”/path/to/rels”/> 
<link rel=”spouse-relationships” href=”/path/to/rels”/> 
... 
</person> 
</gedcomx>
How To... 
Upload an artifact to a collection. 
● Read the collection. 
● Find the link to the “artifacts”. 
● POST the artifact.
How To... 
Upload an artifact to a collection. 
GET /platform/collections/tree 
<gedcomx xmlns=”http://gedcomx.org/v1”> 
<collection> 
<title>FamilySearch Family Tree</title> 
... 
<link rel=”artifacts” href=”/path/to/artifacts/resource”/> 
... 
</collection> 
</gedcomx>
How To... 
Edit the birth date of a person. 
● Read the person. 
● Find the link to the “conclusions” of the 
person. 
● POST the changes.
How To... 
Edit the birth date of a person. 
<gedcomx xmlns=”http://gedcomx.org/v1”> 
<person id=”P2”> 
<name>...</name> 
... 
<link rel=”conclusions” href=”/path/to/conclusions”/> 
... 
</person> 
</gedcomx>
How To... 
Read the list of photos on a person. 
● Read the person. 
● Find the link to the “artifacts” of the 
person.
How To... 
Read the list of photos on a person. 
<gedcomx xmlns=”http://gedcomx.org/v1”> 
<person id=”P2”> 
<name>...</name> 
... 
<link rel=”artifacts” href=”/path/to/artifacts”/> 
... 
</person> 
</gedcomx>
How To... 
Delete a person. 
● Read the person. 
● Find the “self” link. 
● Apply the DELETE.
How To... 
Delete a person. 
<gedcomx xmlns=”http://gedcomx.org/v1”> 
<person id=”P2”> 
<name>...</name> 
... 
<link rel=”person” href=”/path/to/self”/> 
... 
</person> 
</gedcomx>
Tools 
97 © 2013 by Intellectual Reserve, Inc. All rights reserved.
Do I have to? 
98 © 2013 by Intellectual Reserve, Inc. All rights reserved.
The Goal 
99 © 2013 by Intellectual Reserve, Inc. All rights reserved.
The Goal 
Learn how to use hypermedia for better 
Web service APIs. 
Better? 
●More Adaptable 
●More Robust 
●More Maintainable 
● Less Pain 
100 © 2013 by Intellectual Reserve, Inc. All rights reserved.

Weitere Àhnliche Inhalte

Was ist angesagt?

Hydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIsHydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIsMarkus Lanthaler
 
Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...
Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...
Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...André Ricardo Barreto de Oliveira
 
JSON-LD: JSON for the Social Web
JSON-LD: JSON for the Social WebJSON-LD: JSON for the Social Web
JSON-LD: JSON for the Social WebGregg Kellogg
 
ElasticSearch: НаĐčĐŽĐ”Ń‚ŃŃ ĐČсД... Đž Đ±Ń‹ŃŃ‚Ń€ĐŸ!
ElasticSearch: НаĐčĐŽĐ”Ń‚ŃŃ ĐČсД... Đž Đ±Ń‹ŃŃ‚Ń€ĐŸ!ElasticSearch: НаĐčĐŽĐ”Ń‚ŃŃ ĐČсД... Đž Đ±Ń‹ŃŃ‚Ń€ĐŸ!
ElasticSearch: НаĐčĐŽĐ”Ń‚ŃŃ ĐČсД... Đž Đ±Ń‹ŃŃ‚Ń€ĐŸ!Alexander Byndyu
 
Tom Critchlow - Data Feed SEO & Advanced Site Architecture
Tom Critchlow - Data Feed SEO & Advanced Site ArchitectureTom Critchlow - Data Feed SEO & Advanced Site Architecture
Tom Critchlow - Data Feed SEO & Advanced Site Architectureauexpo Conference
 
JSON-LD for RESTful services
JSON-LD for RESTful servicesJSON-LD for RESTful services
JSON-LD for RESTful servicesMarkus Lanthaler
 
YQL:: Select * from Internet
YQL:: Select * from InternetYQL:: Select * from Internet
YQL:: Select * from Internetdrgath
 
01 ElasticSearch : Getting Started
01 ElasticSearch : Getting Started01 ElasticSearch : Getting Started
01 ElasticSearch : Getting StartedOpenThink Labs
 
Interactive Visualization With Bokeh (SF Python Meetup)
Interactive Visualization With Bokeh (SF Python Meetup)Interactive Visualization With Bokeh (SF Python Meetup)
Interactive Visualization With Bokeh (SF Python Meetup)Peter Wang
 
apidays LIVE LONDON - Data Retrieval via APIs - Showdown of GraphQL vs ODATA ...
apidays LIVE LONDON - Data Retrieval via APIs - Showdown of GraphQL vs ODATA ...apidays LIVE LONDON - Data Retrieval via APIs - Showdown of GraphQL vs ODATA ...
apidays LIVE LONDON - Data Retrieval via APIs - Showdown of GraphQL vs ODATA ...apidays
 
Bokeh Tutorial - PyData @ Strata San Jose 2015
Bokeh Tutorial - PyData @ Strata San Jose 2015Bokeh Tutorial - PyData @ Strata San Jose 2015
Bokeh Tutorial - PyData @ Strata San Jose 2015Peter Wang
 
Create Graph and Grid Using D3 Library
Create Graph and Grid Using D3 LibraryCreate Graph and Grid Using D3 Library
Create Graph and Grid Using D3 LibraryYanliang Bao (Beryl)
 
Quality, quantity, web and semantics
Quality, quantity, web and semanticsQuality, quantity, web and semantics
Quality, quantity, web and semanticsAndraz Tori
 
REST and AJAX Reconciled
REST and AJAX ReconciledREST and AJAX Reconciled
REST and AJAX ReconciledLars Trieloff
 
Coding for marketers
Coding for marketersCoding for marketers
Coding for marketersRobin Lord
 
03. ElasticSearch : Data In, Data Out
03. ElasticSearch : Data In, Data Out03. ElasticSearch : Data In, Data Out
03. ElasticSearch : Data In, Data OutOpenThink Labs
 
Leveraging Lucene/Solr as a Knowledge Graph and Intent Engine
Leveraging Lucene/Solr as a Knowledge Graph and Intent EngineLeveraging Lucene/Solr as a Knowledge Graph and Intent Engine
Leveraging Lucene/Solr as a Knowledge Graph and Intent EngineTrey Grainger
 
Bioschemas: Using Schema.org for describing scientific information
Bioschemas: Using Schema.org for describing scientific information Bioschemas: Using Schema.org for describing scientific information
Bioschemas: Using Schema.org for describing scientific information Bioschemas
 
Data Sharing and Caring In HealthCare - MedYear's experience building Big Dat...
Data Sharing and Caring In HealthCare - MedYear's experience building Big Dat...Data Sharing and Caring In HealthCare - MedYear's experience building Big Dat...
Data Sharing and Caring In HealthCare - MedYear's experience building Big Dat...Mark Scrimshire
 

Was ist angesagt? (19)

Hydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIsHydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIs
 
Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...
Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...
Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...
 
JSON-LD: JSON for the Social Web
JSON-LD: JSON for the Social WebJSON-LD: JSON for the Social Web
JSON-LD: JSON for the Social Web
 
ElasticSearch: НаĐčĐŽĐ”Ń‚ŃŃ ĐČсД... Đž Đ±Ń‹ŃŃ‚Ń€ĐŸ!
ElasticSearch: НаĐčĐŽĐ”Ń‚ŃŃ ĐČсД... Đž Đ±Ń‹ŃŃ‚Ń€ĐŸ!ElasticSearch: НаĐčĐŽĐ”Ń‚ŃŃ ĐČсД... Đž Đ±Ń‹ŃŃ‚Ń€ĐŸ!
ElasticSearch: НаĐčĐŽĐ”Ń‚ŃŃ ĐČсД... Đž Đ±Ń‹ŃŃ‚Ń€ĐŸ!
 
Tom Critchlow - Data Feed SEO & Advanced Site Architecture
Tom Critchlow - Data Feed SEO & Advanced Site ArchitectureTom Critchlow - Data Feed SEO & Advanced Site Architecture
Tom Critchlow - Data Feed SEO & Advanced Site Architecture
 
JSON-LD for RESTful services
JSON-LD for RESTful servicesJSON-LD for RESTful services
JSON-LD for RESTful services
 
YQL:: Select * from Internet
YQL:: Select * from InternetYQL:: Select * from Internet
YQL:: Select * from Internet
 
01 ElasticSearch : Getting Started
01 ElasticSearch : Getting Started01 ElasticSearch : Getting Started
01 ElasticSearch : Getting Started
 
Interactive Visualization With Bokeh (SF Python Meetup)
Interactive Visualization With Bokeh (SF Python Meetup)Interactive Visualization With Bokeh (SF Python Meetup)
Interactive Visualization With Bokeh (SF Python Meetup)
 
apidays LIVE LONDON - Data Retrieval via APIs - Showdown of GraphQL vs ODATA ...
apidays LIVE LONDON - Data Retrieval via APIs - Showdown of GraphQL vs ODATA ...apidays LIVE LONDON - Data Retrieval via APIs - Showdown of GraphQL vs ODATA ...
apidays LIVE LONDON - Data Retrieval via APIs - Showdown of GraphQL vs ODATA ...
 
Bokeh Tutorial - PyData @ Strata San Jose 2015
Bokeh Tutorial - PyData @ Strata San Jose 2015Bokeh Tutorial - PyData @ Strata San Jose 2015
Bokeh Tutorial - PyData @ Strata San Jose 2015
 
Create Graph and Grid Using D3 Library
Create Graph and Grid Using D3 LibraryCreate Graph and Grid Using D3 Library
Create Graph and Grid Using D3 Library
 
Quality, quantity, web and semantics
Quality, quantity, web and semanticsQuality, quantity, web and semantics
Quality, quantity, web and semantics
 
REST and AJAX Reconciled
REST and AJAX ReconciledREST and AJAX Reconciled
REST and AJAX Reconciled
 
Coding for marketers
Coding for marketersCoding for marketers
Coding for marketers
 
03. ElasticSearch : Data In, Data Out
03. ElasticSearch : Data In, Data Out03. ElasticSearch : Data In, Data Out
03. ElasticSearch : Data In, Data Out
 
Leveraging Lucene/Solr as a Knowledge Graph and Intent Engine
Leveraging Lucene/Solr as a Knowledge Graph and Intent EngineLeveraging Lucene/Solr as a Knowledge Graph and Intent Engine
Leveraging Lucene/Solr as a Knowledge Graph and Intent Engine
 
Bioschemas: Using Schema.org for describing scientific information
Bioschemas: Using Schema.org for describing scientific information Bioschemas: Using Schema.org for describing scientific information
Bioschemas: Using Schema.org for describing scientific information
 
Data Sharing and Caring In HealthCare - MedYear's experience building Big Dat...
Data Sharing and Caring In HealthCare - MedYear's experience building Big Dat...Data Sharing and Caring In HealthCare - MedYear's experience building Big Dat...
Data Sharing and Caring In HealthCare - MedYear's experience building Big Dat...
 

Ähnlich wie Hypermedia In Practice - FamilySearch Developers Conference 2014

Build Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaBuild Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaRavi Mynampaty
 
The Django Web Application Framework
The Django Web Application FrameworkThe Django Web Application Framework
The Django Web Application FrameworkSimon Willison
 
Microdata semantic-extend
Microdata semantic-extendMicrodata semantic-extend
Microdata semantic-extendSeek Tan
 
Integrating Government Data New
Integrating Government Data NewIntegrating Government Data New
Integrating Government Data Newguest4543bb
 
Schemas >> Schema.org >> Take Your Website to a New Level with Schema Markup
Schemas >> Schema.org >> Take Your Website to a New Level with Schema Markup Schemas >> Schema.org >> Take Your Website to a New Level with Schema Markup
Schemas >> Schema.org >> Take Your Website to a New Level with Schema Markup Sante J. Achille
 
Semantic Web in the browser. From a blind Web to
Semantic Web in the browser. From a blind Web toSemantic Web in the browser. From a blind Web to
Semantic Web in the browser. From a blind Web toSabin Buraga
 
Semantic HTML
Semantic HTMLSemantic HTML
Semantic HTMLhchen1
 
Uso di Schema.org per il tuo sito web
Uso di Schema.org per il tuo sito webUso di Schema.org per il tuo sito web
Uso di Schema.org per il tuo sito websemrush_webinars
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5Steven Chipman
 
Your Content, Your Search, Your Decision
Your Content, Your Search, Your DecisionYour Content, Your Search, Your Decision
Your Content, Your Search, Your DecisionAgnes Molnar
 
Semantics In Declarative Systems
Semantics In Declarative SystemsSemantics In Declarative Systems
Semantics In Declarative SystemsOptum
 
Linked Data Presentation at TDWI Mpls
Linked Data Presentation at TDWI MplsLinked Data Presentation at TDWI Mpls
Linked Data Presentation at TDWI MplsJay Myers
 
Mark Logic StrangeLoop 2010
Mark Logic StrangeLoop 2010Mark Logic StrangeLoop 2010
Mark Logic StrangeLoop 2010Christopher Biow
 
CrossLanguageSpotter: A Library for Detecting Relations in Polyglot Frameworks
CrossLanguageSpotter: A Library for Detecting Relations in Polyglot FrameworksCrossLanguageSpotter: A Library for Detecting Relations in Polyglot Frameworks
CrossLanguageSpotter: A Library for Detecting Relations in Polyglot FrameworksGiuseppe Rizzo
 
GEDCOM X - FamilySearch Developers Conference 2014
GEDCOM X - FamilySearch Developers Conference 2014GEDCOM X - FamilySearch Developers Conference 2014
GEDCOM X - FamilySearch Developers Conference 2014Ryan Heaton
 
Semantic Web: A web that is not the Web
Semantic Web: A web that is not the WebSemantic Web: A web that is not the Web
Semantic Web: A web that is not the WebBruce Esrig
 
Xhtml Basics
Xhtml BasicsXhtml Basics
Xhtml BasicsAkramWaseem
 

Ähnlich wie Hypermedia In Practice - FamilySearch Developers Conference 2014 (20)

Build Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaBuild Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to Omega
 
The Django Web Application Framework
The Django Web Application FrameworkThe Django Web Application Framework
The Django Web Application Framework
 
Microdata semantic-extend
Microdata semantic-extendMicrodata semantic-extend
Microdata semantic-extend
 
Integrating Government Data New
Integrating Government Data NewIntegrating Government Data New
Integrating Government Data New
 
Schemas >> Schema.org >> Take Your Website to a New Level with Schema Markup
Schemas >> Schema.org >> Take Your Website to a New Level with Schema Markup Schemas >> Schema.org >> Take Your Website to a New Level with Schema Markup
Schemas >> Schema.org >> Take Your Website to a New Level with Schema Markup
 
Semantic Web in the browser. From a blind Web to
Semantic Web in the browser. From a blind Web toSemantic Web in the browser. From a blind Web to
Semantic Web in the browser. From a blind Web to
 
Semantic HTML
Semantic HTMLSemantic HTML
Semantic HTML
 
Uso di Schema.org per il tuo sito web
Uso di Schema.org per il tuo sito webUso di Schema.org per il tuo sito web
Uso di Schema.org per il tuo sito web
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
Your Content, Your Search, Your Decision
Your Content, Your Search, Your DecisionYour Content, Your Search, Your Decision
Your Content, Your Search, Your Decision
 
Semantics In Declarative Systems
Semantics In Declarative SystemsSemantics In Declarative Systems
Semantics In Declarative Systems
 
Linked Data Presentation at TDWI Mpls
Linked Data Presentation at TDWI MplsLinked Data Presentation at TDWI Mpls
Linked Data Presentation at TDWI Mpls
 
Mark Logic StrangeLoop 2010
Mark Logic StrangeLoop 2010Mark Logic StrangeLoop 2010
Mark Logic StrangeLoop 2010
 
CrossLanguageSpotter: A Library for Detecting Relations in Polyglot Frameworks
CrossLanguageSpotter: A Library for Detecting Relations in Polyglot FrameworksCrossLanguageSpotter: A Library for Detecting Relations in Polyglot Frameworks
CrossLanguageSpotter: A Library for Detecting Relations in Polyglot Frameworks
 
GEDCOM X - FamilySearch Developers Conference 2014
GEDCOM X - FamilySearch Developers Conference 2014GEDCOM X - FamilySearch Developers Conference 2014
GEDCOM X - FamilySearch Developers Conference 2014
 
Web 3 0
Web 3 0Web 3 0
Web 3 0
 
REST dojo Comet
REST dojo CometREST dojo Comet
REST dojo Comet
 
Semantic Web: A web that is not the Web
Semantic Web: A web that is not the WebSemantic Web: A web that is not the Web
Semantic Web: A web that is not the Web
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
Xhtml Basics
Xhtml BasicsXhtml Basics
Xhtml Basics
 

KĂŒrzlich hochgeladen

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

KĂŒrzlich hochgeladen (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Hypermedia In Practice - FamilySearch Developers Conference 2014

  • 1. Hypermedia in Practice 1 © 2013 by Intellectual Reserve, Inc. All rights reserved.
  • 2. The Goal 2 © 2013 by Intellectual Reserve, Inc. All rights reserved.
  • 3. The Goal Learn how to use hypermedia for better Web service APIs. 3 © 2013 by Intellectual Reserve, Inc. All rights reserved.
  • 4. The Goal Learn how to use hypermedia for better Web service APIs. Better? ●More Adaptable ●More Robust ●More Maintainable ● Less Pain 4 © 2013 by Intellectual Reserve, Inc. All rights reserved.
  • 5. A Review ● Web service API – A set of digital services and/or resources made accessible over a computer network. ● HTTP – Hypertext Transfer Protocol – Defines how to make requests and interpret responses.
  • 6. A Review ● Resources – The units of data making up the “matter” of the API. – The “subject” of HTTP operations. ● Uniform Resource Identifier – The locator for a resource. – Includes a domain, path, query.
  • 7. A Review ● Resource Representations – How resources are serialized to a stream of bytes. – Often JSON and XML. – a.k.a. “media types” or “data formats” ● See “Architecture of the World Wide Web” – http://www.w3.org/TR/webarch/
  • 9. WWW
  • 12. URI
  • 14. Resource HTTP “GET /path/to/resource”
  • 15. “OK" Resource Representation <resource> 
 </resource> { “resource” : 
 }
  • 18. What If... ...a resource representation changes its property order? { 
 “names” : [ 
 ], “facts” : [ 
 ], “gender” : { 
 }, 
 } { 
 “gender” : { 
 }, “names” : [ 
 ], “facts” : [ 
 ], 
 }
  • 19. What If... ...a resource representation adds some whitespace? {“names”:[ 
 ],“facts”: [ 
 ],“gender”:{ 
 },
} { “names” : [ 
 ], “facts” : [ 
 ], “gender” : { 
 }, 
 } <person><name>...</name ><fact>...</fact><gende r>...</gender></person> <person> <name>...</name> <fact>...</fact> <gender>...</gender> </person>
  • 20. ...an XML representation changes namespace prefixes? <person xmlns=”...”> <name>...</name> <fact>...</fact> <gender>...</gender> </person> <gx:person xmlns:gx=”...”> <gx:name>...</gx:name> <gx:fact>...</gx:fact> <gx:gender>...</gx:gender> </gx:person> What If...
  • 21. What If... ...a caching policy changes?
  • 22. What If... ...new resources become available? Available Resources ● Person ● Relationship ● Person Search ● ... Available Resources ● Person ● Relationship ● Person Search ● Records ● Record ● Record Search ● ...
  • 23. What If... ...an API changes domains? https://familysearch.org/platform https://familysearch.io/platform
  • 24. What If... ...a resource moves? /platform/tree/persons/12345/matches /platform/tree/persons/12345/duplicates
  • 25. What If... ...subresources are included in their “parent” resource? /person/12345 Person /person/12345/notes Person Person Notes Source References /person/12345/sources /person/12345 Person + Notes + Source References
  • 26. What If... ● ...property order changes? ● ...some whitespace is added? ● ...XML changes namespace prefixes? ● ...caching policy changes? ● ...new resources are available? ● ...a resource moves? ● ...subresources are included in their "parent" resource?
  • 27. What If... ● ...property order changes? ● ...some whitespace is added? ● ...XML changes namespace prefixes? ● ...caching policy changes? ● ...new resources are available? ● ...a resource moves? ● ...subresources are included in their "parent" resource?
  • 28.
  • 29. Speaks HTTP fluently. Understands the URI. Uses links to get stuff done.
  • 30. ...a resource representation changes its property order? <html> <head> 
 <script src=”...”></script> 
 </head> <body> 
 </body> </html> What If...
  • 31. ...a resource representation changes its property order? <html> <head> 
 <script src=”...”></script> 
 </head> <body> 
 </body> </html> What If... <html> <head> 
 </head> <body> 
 <script src=”...”></script> 
 </body> </html>
  • 32. ...a resource representation changes its property order? <html> <head> 
 <script src=”...”></script> 
 </head> <body> 
 </body> </html> What If... <html> <head> 
 </head> <body> 
 <script src=”...”></script> 
 </body> </html> HTML says... “OK”
  • 33. What If... ...a resource representation changes its property order? { 
 “names” : [ 
 ], “facts” : [ 
 ], “gender” : { 
 }, 
 } { 
 “gender” : { 
 }, “names” : [ 
 ], “facts” : [ 
 ], 
 }
  • 34. What If... ...a resource representation changes its property order? { 
 “names” : [ 
 ], “facts” : [ 
 ], “gender” : { 
 }, 
 } { 
 “gender” : { 
 }, “names” : [ 
 ], “facts” : [ 
 ], 
 } GEDCOM X says... “OK”
  • 35. What If... ...a resource representation adds some whitespace? <html><head>
</head><body>
 </body></html>
  • 36. What If... ...a resource representation adds some whitespace? <html><head>
</head><body>
 </body></html> <html> <head> 
 </head> <body> 
 </body> </html>
  • 37. What If... ...a resource representation adds some whitespace? <html><head>
</head><body>
 </body></html> <html> <head> 
 </head> <body> 
 </body> </html> HTML says... “OK”
  • 38. What If... ...a resource representation adds some whitespace? {“names”:[ 
 ],“facts”: [ 
 ],“gender”:{ 
 },
} { “names” : [ 
 ], “facts” : [ 
 ], “gender” : { 
 }, 
 } <person><name>...</name ><fact>...</fact><gende r>...</gender></person> <person> <name>...</name> <fact>...</fact> <gender>...</gender> </person>
  • 39. What If... ...a resource representation adds some whitespace? { “names” : [ 
 ], “facts” : [ 
 ], “gender” : { 
 }, 
 } <person><name>...</name ><fact>...</fact><gende r>...</gender></person> <person> <name>...</name> <fact>...</fact> <gender>...</gender> </person> {“names”:[ 
 ],“facts”: [ 
 ],“gender”:{ 
 },
} JSON says... “OK”
  • 40. What If... ...a resource representation adds some whitespace? { “names” : [ 
 ], “facts” : [ 
 ], “gender” : { 
 }, 
 } <person><name>...</name ><fact>...</fact><gende r>...</gender></person> <person> <name>...</name> <fact>...</fact> <gender>...</gender> </person> {“names”:[ 
 ],“facts”: [ 
 ],“gender”:{ 
 },
} XML says... “OK”
  • 41. ...an XML representation changes namespace prefixes? <person xmlns=”...”> <name>...</name> <fact>...</fact> <gender>...</gender> </person> <gx:person xmlns:gx=”...”> <gx:name>...</gx:name> <gx:fact>...</gx:fact> <gx:gender>...</gx:gender> </gx:person> What If...
  • 42. ...an XML representation changes namespace prefixes? <person xmlns=”...”> <name>...</name> <fact>...</fact> <gender>...</gender> </person> <gx:person xmlns:gx=”...”> <gx:name>...</gx:name> <gx:fact>...</gx:fact> <gx:gender>...</gx:gender> </gx:person> What If...XML says... “OK”
  • 43. What If... ...a caching policy changes? HTTP/1.1 200 OK 
 Cache-Control: no-store 

  • 44. What If... ...a caching policy changes? HTTP/1.1 200 OK 
 Cache-Control: no-store 
 HTTP/1.1 200 OK 
 Cache-Control: public, max-age=3600 ETag: 1234567890 

  • 45. What If... HTTP says... “OK” ...a caching policy changes? HTTP/1.1 200 OK 
 Cache-Control: no-store 
 HTTP/1.1 200 OK 
 Cache-Control: public, max-age=3600 ETag: 1234567890 

  • 46. What If... ...a caching policy changes?
  • 47. What If... ...new resources become available?
  • 48. What If... ...new resources become available?
  • 49. What If... ...new resources become available? Available Resources ● Person ● Relationship ● Person Search ● ... Available Resources ● Person ● Relationship ● Person Search ● Records ● Record ● Record Search ● ...
  • 50. What If... ...new resources become available? Available Resources ● Person ● Relationship ● Person Search ● ... Available Resources ● Person ● Relationship ● Person Search ● Records ● Record ● Record Search ● ... Hypermedia
  • 51. What If... ...an API changes domains?
  • 52. What If... HTTP says... “Moved” ...an API changes domains? HTTP/1.1 301 Moved Permanently 
 Location: http://www.facebook.com/ 

  • 53. What If... ...an API changes domains?
  • 54. What If... ...an API changes domains? HTTP/1.1 301 Moved Permanently 
 Location: http://familysearch.io/ 

  • 55. What If... ...a resource moves? /platform/tree/persons/12345/matches /platform/tree/persons/12345/duplicates
  • 56. What If... ...a resource moves? <html> <body> 
 <form action=”/path/to/resource”> <input 
/> </form> </body> </html>
  • 57. What If... ...a resource moves? <html> <body> 
 <form action=”/path/to/resource”> <input 
/> </form> </body> </html> <html> <body> 
 <form action=”/NEW/resource/PATH”> <input 
/> </form> </body> </html>
  • 58. What If... ...a resource moves? <html> <body> 
 <form action=”/path/to/resource”> <input 
/> </form> </body> </html> <html> <body> 
 <form action=”/NEW/resource/PATH”> <input 
/> </form> </body> </html> Hypermedia
  • 59. What If... ...a resource moves? <gedcomx> <person id=”12345”> 
 <link rel=”matches” href=”/persons/12345/matches”/> 
 </person> </gedcomx>
  • 60. What If... ...a resource moves? <gedcomx> <person id=”12345”> 
 <link rel=”matches” href=”/persons/12345/matches”/> 
 </person> </gedcomx> <gedcomx> <person id=”12345”> 
 <link rel=”matches” href=”/persons/12345/duplicates”/> 
 </person> </gedcomx>
  • 61. What If... ...a resource moves? <gedcomx> <person id=”12345”> 
 <link rel=”matches” href=”/persons/12345/matches”/> 
 </person> </gedcomx> <gedcomx> <person id=”12345”> 
 <link rel=”matches” href=”/persons/12345/duplicates”/> 
 </person> </gedcomx> Hypermedia
  • 62. What If... ...subresources are included in their “parent” resource? /person/12345 Person /person/12345/notes Person Person Notes Source References /person/12345/sources /person/12345 Person + Notes + Source References
  • 63. What If... ...subresources are included in their “parent” resource? <html> <head> 
 <link rel=”stylesheet” href=”...”/> <script src=”...”></script> 
 </head> <body> 
 </body> </html>
  • 64. What If... ...subresources are included in their “parent” resource? <html> <head> 
 <link rel=”stylesheet” href=”...”/> <script src=”...”></script> 
 </head> <body> 
 </body> </html> Embedded Links (Hypermedia)
  • 65. What If... ...subresources are included in their “parent” resource? <html> <head> 
 <link rel=”stylesheet” href=”...”/> <script src=”...”></script> 
 </head> <body> 
 </body> </html> <html> <head> 
 <style> 
 </style> <script> 
 </script> 
 </head> <body> 
 </body> </html>
  • 66. What If... ...subresources are included in their “parent” resource? <html> <head> 
 <link rel=”stylesheet” href=”...”/> <script src=”...”></script> 
 </head> <body> 
 </body> </html> <html> <head> 
 <style> 
 </style> <script> 
 </script> 
 </head> <body> 
 </body> </html> HTML says... “OK”
  • 67. What If... ...subresources are included in their “parent” resource? <gedcomx> <person id=”12345”> 
 <link rel=”source-references” href=”/persons/12345/sources”/> <link rel=”notes” href=”/persons/12345/notes”/> 
 </person> </gedcomx>
  • 68. What If... ...subresources are included in their “parent” resource? <gedcomx> <person id=”12345”> 
 <link rel=”source-references” href=”/persons/12345/sources”/> <link rel=”notes” href=”/persons/12345/notes”/> 
 </person> </gedcomx> Embedded Links (Hypermedia)
  • 69. What If... ...subresources are included in their “parent” resource? <gedcomx> <person id=”12345”> 
 <link rel=”source-references” href=”/persons/12345/sources”/> <link rel=”notes” href=”/persons/12345/notes”/> 
 </person> </gedcomx> <gedcomx> <person id=”12345”> 
 <source description=”...”/> <note id=”...”> 
 </note> </person> </gedcomx>
  • 70. What If... ...subresources are included in their “parent” resource? <gedcomx> <person id=”12345”> 
 <link rel=”source-references” href=”/persons/12345/sources”/> <link rel=”notes” href=”/persons/12345/notes”/> 
 </person> </gedcomx> <gedcomx> <person id=”12345”> 
 <source description=”...”/> <note id=”...”> 
 </note> </person> </gedcomx> GEDCOM X says... “OK”
  • 71. So.
  • 72. So. ● Speak HTTP fluently. ●Understand the URI. ●Use links to get stuff done.
  • 73. So. ● Speak HTTP fluently. ● Understand the URI. ● Use links to get stuff done. Yeah. Like a screen scraper.
  • 74. links
  • 75. What do links look like?
  • 76. What do links look like? Depends on the media type.
  • 77. <a href=”...”/> <link rel=”” href=””/> links <img src=”...”/> <script src=”...”/>
  • 78. Why use links ? So APIs can change without breaking clients.
  • 80. How To... ● Add a person to a collection. ● Search a collection for persons. ● Do a “full” person read. ● Upload an artifact to a collection. ● Edit the birth date of a person. ● Read the list of photos on a person. ● Delete a person.
  • 81. How To... Add a person to a collection. ● Read the collection. ● Find the link to the “persons” of the collection. ● POST the new person to that URI.
  • 82. How To... Add a person to a collection. ● Read the collection. ● Find the link to the “persons” of the collection. ● POST the new person to that URI.
  • 83. How To... Add a person to a collection. GET /platform/collections/tree <gedcomx xmlns=”http://gedcomx.org/v1”> <collection> <title>FamilySearch Family Tree</title> ... <link rel=”persons” href=”/path/to/persons/resource”/> ... </collection> </gedcomx>
  • 84. How To... Search a collection for persons. ● Read the collection. ● Find the link to the “person-search” of the collection. ● Fill in the parameters and issue the request.
  • 85. How To... GET /platform/collections/tree <gedcomx xmlns=”http://gedcomx.org/v1”> <collection> <title>FamilySearch Family Tree</title> ... <link rel=”person-search” template=”/path/to/person/search{?q}”/> ... </collection> </gedcomx> Search a collection for persons.
  • 86. How To... Do a “full” person read. ● Read the person. ● For each “embedded” link, get the resource and embed it. – Source references – Discussion references – Notes – Relationships
  • 87. How To... Do a “full” person read. <gedcomx xmlns=”http://gedcomx.org/v1”> <person id=”P2”> <name>...</name> ... <link rel=”source-references” href=”/path/to/refs”/> <link rel=”notes” href=”/path/to/notes”/> <link rel=”child-relationships” href=”/path/to/rels”/> <link rel=”parent-relationships” href=”/path/to/rels”/> <link rel=”spouse-relationships” href=”/path/to/rels”/> ... </person> </gedcomx>
  • 88. How To... Upload an artifact to a collection. ● Read the collection. ● Find the link to the “artifacts”. ● POST the artifact.
  • 89. How To... Upload an artifact to a collection. GET /platform/collections/tree <gedcomx xmlns=”http://gedcomx.org/v1”> <collection> <title>FamilySearch Family Tree</title> ... <link rel=”artifacts” href=”/path/to/artifacts/resource”/> ... </collection> </gedcomx>
  • 90. How To... Edit the birth date of a person. ● Read the person. ● Find the link to the “conclusions” of the person. ● POST the changes.
  • 91. How To... Edit the birth date of a person. <gedcomx xmlns=”http://gedcomx.org/v1”> <person id=”P2”> <name>...</name> ... <link rel=”conclusions” href=”/path/to/conclusions”/> ... </person> </gedcomx>
  • 92. How To... Read the list of photos on a person. ● Read the person. ● Find the link to the “artifacts” of the person.
  • 93. How To... Read the list of photos on a person. <gedcomx xmlns=”http://gedcomx.org/v1”> <person id=”P2”> <name>...</name> ... <link rel=”artifacts” href=”/path/to/artifacts”/> ... </person> </gedcomx>
  • 94. How To... Delete a person. ● Read the person. ● Find the “self” link. ● Apply the DELETE.
  • 95. How To... Delete a person. <gedcomx xmlns=”http://gedcomx.org/v1”> <person id=”P2”> <name>...</name> ... <link rel=”person” href=”/path/to/self”/> ... </person> </gedcomx>
  • 96. Tools 97 © 2013 by Intellectual Reserve, Inc. All rights reserved.
  • 97. Do I have to? 98 © 2013 by Intellectual Reserve, Inc. All rights reserved.
  • 98. The Goal 99 © 2013 by Intellectual Reserve, Inc. All rights reserved.
  • 99. The Goal Learn how to use hypermedia for better Web service APIs. Better? ●More Adaptable ●More Robust ●More Maintainable ● Less Pain 100 © 2013 by Intellectual Reserve, Inc. All rights reserved.