Fred van den Driessche

g is for genres

Continuing the Atlas A-Z series, this article is brought to you by the letter G. G is for Genres.

genre: documentary/history/horror

In Atlas, pieces of Content can be assigned a number of Genres as a means of categorisation.

At the moment it’s very simple and flexible: genres are just URLs. Remote sources can supply their own URLs which can also be transformed to a fixed set of genres defined in Atlas using a mapping. The example below shows how the genres of the ubiquitous EastEnders appear in the API.

	{
	  "id": "cyp",
	  "type": "brand",
	  "uri": "http://www.bbc.co.uk/programmes/b006m86d",
	  "publisher": {
	    "key": "bbc.co.uk"
	  },
	  "genres": [
	    "http://ref.atlasapi.org/genres/atlas/drama",
	    "http://www.bbc.co.uk/programmes/genres/drama/soaps"
	  ]
	}

The trouble with URLs is that you often have to do a lot of work to infer any meaning from them. An API user will generally have to maintain their own reverse mapping to transform the URL into something which can be displayed to the end-user.

It’s also possible to lose information in a simple set of URLs. Some sources have hierarchical genres, sometimes represented by codes, while in others the order of genres can be important. URLs make it difficult to represent and convey that meaning clearly.

Currently it’s very hard for an API user to find a set of content for a given genre as there’s no filter on the content resource to support it. Since genres are a prominent method of content discovery along with schedules, it should be much easier.

It’s safe to say that there’s a lot that can be done to improve how genres are modelled and used in Atlas.

genre: sci-fi/fantasy

The good news is that we have a plan for the future of genres in Atlas. We’d love to hear any feedback you may have on the proposal. In short, in the version 4.0 API genres will be much more significant and modelled more extensively.

Genres will be very similar to Topics with optional links to broader and narrower Genres so hierarchies can be created.

Genres will also be a top-level resource in the API in the same way that both Topics and Content are. The following requests will be supported:

  • /4.0/genres – list all genres.

  • /4.0/genres/:id – a specific genre.

  • /4.0/genres/:id/content – list content with a specific genre.

  • /4.0/content?genres.id=:id – alternative list content with a specific genre.

That’s about all you need to know about genres in Atlas. If you have any comments or questions please get in touch below or on the Atlas discussion group.

blog comments powered by Disqus