Last time at the new improved MetaTalks
• Fred
• Covered the history of Atlas (née URIplay) and what it does
• Explained how the new Atlas deer release differs from what came before
• Tom
• Had just given us stable content IDs
• This will be important later
Slide 3
Slide 3 text
Topics for today (vcfm?*)
• Focus on new 4.0 API
• What's different
• Why
*groan…
Slide 4
Slide 4 text
Design principles
• Use plurals for resource types
• Resource type URIs represent a collection of all resources of that type
• Resource type URIs support querying of resources of that type
• Every resource has a single canonical URI under its resource type
• Support the common use cases in simple, obvious ways
• Ensure a guaranteed, consistent speed of response for more complex queries
Slide 5
Slide 5 text
Yes, the URIs are gone
• It’s not that 3.0 wasn’t RESTful - it was
• Atlas and URIplay have always been very of the web
• URIs as IDs make it hard to support things like POSTs, or PUTs to subresources
• They’re also hard to pass round in URLs and for other people to use
• So the URI of URIplay is now gone
• All resources in Atlas now have an Atlas-generated web-safe ID
Slide 6
Slide 6 text
Content requests
• Before
• /3.0/content.json?uri=http://www.bbc.co.uk/programmes/b006q2x0
• After
• /4.0/content/d9t.json
Slide 7
Slide 7 text
Content requests
• But you can still look up by URI
• /4.0/content.json?aliases.namespace=uri&aliases.value=http://www.bbc.co.uk/
programmes/b006q2x0
• Aliases provide a powerful new mechanism
• /4.0/content.json?aliases.namespace=gb:bbc:pid&aliases.value=b006q2x0
Slide 8
Slide 8 text
Schedule requests
• Before
• /3.0/schedule.json?
publisher=bbc.co.uk&from=2013-07-17&to=2013-07-18&channel_id=cbbh
• After
• /4.0/schedules/hkqs.json?
source=bbc.co.uk&from=2013-07-17&to=2013-07-18
Slide 9
Slide 9 text
Topic requests
• Before
• /3.0/topics/vpfv.json
• After
• /4.0/topics/vcfm.json
Slide 10
Slide 10 text
Topic content requests
• Before
• /3.0/topics/vpfv/content.json
• After
• /4.0/topics/vcfm/content.json
Slide 11
Slide 11 text
Where are the differences?
• Deliberately tried to keep things similar to ease migration
• Two things are very different
• Annotations
• Content filtering
Slide 12
Slide 12 text
Annotations
• 4.0 returns only IDs by default
• Much like in 3.0, annotations add fields or groups of fields to the response
• But in 4.0, they are scoped
Slide 13
Slide 13 text
Annotations - scoping
• Different annotations can be applied to different resource types in a response
• This is done using a dotted syntax
• /4.0/schedules/hkqs.json?source=bbc.co.uk&from=2013-07-17&to=2013-07-18
&annotations=content.description,content.topics,channel.detail
Slide 14
Slide 14 text
Annotations - default scoping
• The current resource type is implied
• /4.0/content/d9t.json?
annotations=description,topics,topics.topic.description
• /4.0/topics/vcfm/content.json?
annotations=description,topic.description
Slide 15
Slide 15 text
Filtering
• Deer gives us the foundation to support flexible querying at scale
• Filters will be built out as use cases are proven
• Our general rule:
• The URL that represents the collection of all resources of the type you are
looking for is used to query for resources of that type
• /4.0/channels.json?title=Film4
Slide 16
Slide 16 text
Content filtering
• Content is a special example as there are multiple content resultsets
• /4.0/content
• /4.0/topic/:id/content
• etc
• All of these behave consistently
Slide 17
Slide 17 text
Content filtering
• The following are equivalent
• /4.0/topics/vcfm/content.json?topics.topic.relationship=about
• /4.0/content.json?topics.topic.id=vcfm&topics.topic.relationship=about
• The first is just syntactic sugar for the second
Slide 18
Slide 18 text
Other nice things
• Content negotiation
• Faster, more predictable performance
• Almost: Tidied up representations
Slide 19
Slide 19 text
API 4.0 Next Steps
• Tidy up the representations
• Channels
• Start migrating people to schedule
• Genres
• More flexible content filtering
• Versions
Slide 20
Slide 20 text
Bonus: Atlas Future (unordered)
• API is important, but it’s not everything
• Realtime equivalence processing
• More granular equivalence merging
• Self-service data requests and key configuration
• Change history