Table of contents

Topic Taxonomy

The Topic Taxonomy is a classification scheme for organising and finding content on GOV.UK, based on its subject area.

Not to be confused with the Topics published through Collections Publisher.

Editing the Topic Taxonomy

The taxonomy is managed in content-tagger. Users must have the “GDS Editor” permission in content-tagger in order to see the relevant pages.

The topics in the taxonomy (we call them “taxons” in code) are persisted in the publishing-api as content items. For an example see the “Education” taxon.

This means that taxons inherit the publishing-api workflow, and can be in either draft state or published.

The link type parent_taxons is used to store the relationship between taxons. A reverse link called child_taxons is setup through the publishing-api.

Tagging

There is no technical limit in what can be tagged to the taxonomy, but not every type of content in the publishing-api is suitable for tagging to the taxonomy.

Content Tagger has a generic interface for tagging content to the taxonomy.

Pages that belong to selected organisations (like those related to the education theme) can be tagged to the taxonomy in Whitehall.

The relationship between a page and a taxon is persisted in the publishing-api “links hash”. For example, see the taxons link in the content item for this guidance document.

Accessing the taxonomy

The level one taxons are associated with the GOV.UK home page through the root_taxon link type. The GOV.UK home page in turn has a corresponding reverse link of link type level one taxons.

This is the content item for the GOV.UK home page with all level one taxons listed.

https://www.gov.uk/api/content/

An example of a level one taxon is the “Education” taxon:

https://www.gov.uk/api/content/education

You can use this to find the structure of the taxonomy by following the child_taxons links.

Accessing tagged content

You can fetch content tagged to a particular taxon from the Search API (rummager).

This works with a content_id rather than URL. To find all content tagged to the above mentioned “Education taxon”:

https://www.gov.uk/api/search.json?filter_taxons[]=c58fdadd-7743-46d6-9629-90bb3ccc4ef0

By default rummager returns a handful of fields in a search result item. You are able to override the default fields by naming which fields you want returned. If a content item does not have one of the named fields provided, it will be left out of the returned item. See full documentation here.

You can filter on multiple different field names if you wish to narrow down what you are searching for. You are able to filter by one or many field names and multiple values can be given for each field name. To find all speech content tagged to “Education taxon”:

https://www.gov.uk/api/search.json?filter_taxons[]=c58fdadd-7743-46d6-9629-90bb3ccc4ef0&filter_content_store_document_type[]=speech&fields[]=title,description,link,content_store_document_type,format

You can also access all content tagged to a taxon and the part of the taxonomy below it. The following will give you everything tagged to topics in the “Education” taxonomy:

https://www.gov.uk/api/search.json?filter_part_of_taxonomy_tree[]=c58fdadd-7743-46d6-9629-90bb3ccc4ef0&fields=title,taxons,part_of_taxonomy_tree

You can see the number of documents in each topic by using taxons as a facet:

https://www.gov.uk/api/search.json?filter_part_of_taxonomy_tree=c58fdadd-7743-46d6-9629-90bb3ccc4ef0&facet_taxons=1000&count=0

Visibility

Editors can use Whitehall to tag content to the taxonomy. They can see both the published as well as the draft taxonomy. Only content tagged to the published taxonomy can be used on the live site.

Individual branches can be hidden from Editors by clearing the visible_to_departmental_editors flag on level one taxons in Content Tagger.

Additionally taxons have a ‘phase’, which can be 'alpha’, 'beta’ or 'live’. The phase of a taxon controls its visibility on the front end apps. This allows us to publish the entire taxonomy while hiding those parts which are not considered mature enough for production.

Taxonomy Metrics

High level metrics regarding the taxonomy are recorded in Graphite, and can be looked at through a Grafana dashboard.

A rake task in Content Tagger is run through the deploy Jenkins every 30 minutes to push metrics to Graphite (via StatsD).

This page was last reviewed . It needs to be reviewed again by the page owner #govuk-tax-and-nav.
https://docs.publishing.service.gov.uk/manual/taxonomy.html
docs.publishing.service.gov.uk
crawl=CC-MAIN-2018-22
17010
application/http; msgtype=response
sha1:M25QY25ZJ5VZB3YYL6SD54A5D5P2TB35
<urn:uuid:739cde85-faed-4ae5-8b16-5c0b4437841b>
2018-05-25T16:14:19Z
31.210.245.87
text/html
sha1:4NG2JOI62CDO2LIENP4T2FYLDAUBX4UZ
<urn:uuid:5d37c747-4fac-4f98-be83-61ebaae1cfc0>
https://docs.publishing.service.gov.uk/manual/taxonomy.html
length
response
<urn:uuid:99f51f63-6017-4827-abf7-44362f15ab4e>
robots: classic
hostname: ip-10-143-72-160.ec2.internal
software: Nutch 1.6 (CC)
isPartOf: CC-MAIN-2018-22
operator: Common Crawl Admin
description: Wide crawl of the web for May 2018
publisher: Common Crawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf