Database Reference
In-Depth Information
Figure 7-2 shows the Comedy genre. Additional information lets you know what you need to add to
the URI to drill down into more detail. For example, look at the <id> element. If you copy the value of
that element into your browser, you see the detailed information for that genre.
Continuing the Comedy example, let's return all the titles in the Comedy genre. To do that, you
need to append the /Titles filter to the end of the URI:
http://OData.netflix.com/Catalog/Genres('Comedy')/Titles
The Netflix OData service returns all the information for the movies in the Comedy genre. Figure 7-3
shows one of the movies returned from the service, displayed in the browser.
Figure 7-3. Viewing Netflix titles
At this point you're just scratching the surface—you can go much further. Although this chapter
isn't intended to be a complete OData tutorial, here are some basic examples of queries you can execute:
To count how many movies Netflix has in its Comedy genre, the URI is
http://netflix.cloudapp.net/Catalog/Genres('Comedy')/Titles/$count?$filter
=Type%20eq%20'Movie' .
Your browser displays a number, and as of this writing, it's 4642.
To list all the comedies made in the 1980s, the URI is
http://OData.netflix.com/Catalog/Genres('Comedy')/Titles?$filter=ReleaseYe
ar%20le%201989%20and%20ReleaseYear%20ge%201980 .
Search WWH ::




Custom Search