alphagov / govuk-knowledge-graph-gcp

GOV.UK content data and cloud infrastructure for the GovSearch app.
https://docs.data-community.publishing.service.gov.uk/tools/govgraph/
MIT License
8 stars 1 forks source link

feat: derive a table of organisations #680

Closed nacnudus closed 4 months ago

nacnudus commented 4 months ago

This pull request derives a table of organisations, and uses it to populate a new column in the table search.page that gives the full ancestry of the organisation that published a given page. This will allow a new feature in GovSearch to filter by an organisation or its constituent parts, which has been requested by users.

Organisations can have multiple parents at differing depths, so there is no meaningful way to describe the depth of an organisation in the hierarchy. For example, the arrows in the diagrams below are links of type ordered_child_organisations. The organisations are each associated with their immediate parent organisation, as well as with organisations that are further up the hierarchy.

graph TD;
    cabinet-office-->civil-service;
    cabinet-office-->government-people-group;
    cabinet-office-->government-skills-and-curriculum-unit;
    civil-service-->government-people-group;
    government-people-group-->government-skills-and-curriculum-unit;
graph TD;
    defence-science-and-technology-laboratory-->national-cyber-force;
    secret-intelligence-service-->national-cyber-force;
    government-communications-headquarters-->national-cyber-force;
    ministry-of-defence-->defence-science-and-technology-laboratory;
    ministry-of-defence-->national-cyber-force;
    foreign-commonwealth-development-office-->government-communications-headquarters;
    foreign-commonwealth-development-office-->secret-intelligence-service;

TODO:

guilhem-fry commented 4 months ago

Deployed & tested