owid-grapher icon indicating copy to clipboard operation
owid-grapher copied to clipboard

Include embedded charts redirects in content graph

Open mlbrgl opened this issue 2 years ago • 3 comments

Core problem

Charts embedded in articles are added to the content graph. However, when the chart URL has since then been updated (and is now redirected in the browser), that chart reference is skipped (thanks @marcelgerber for surfacing this).

article ◄─── broken ─── outdated chart URL
           reference    in article text

Proposed solution

Resolve the internal redirect server-side in order to find the chart associated with the outdated chart URL and create the back-reference in the content graph.

                        ┌───────────────────────────────────────────┐
                        │                                           │
article ◄─── chart ◄────┼──── canonical ◄──── outdated chart URL    │
                        │     chart URL       in article text       │
                        │                                           │
                        │                                           │
                        │                 resolveInternalRedirect() │
                        └───────────────────────────────────────────┘

Alternatives

Saving all chart_slug_redirects in the content graph: does not take into consideration chart redirects defined in Wordpress. It also wouldn't handle grapher -> explorer redirects down the line, when explorers make it into the content graph.

Context

See also #1148

mlbrgl avatar Mar 30 '22 13:03 mlbrgl

tagging as "nice to have" as the content graph only powers the "All our related research and data" block" at the moment but will become "important" when we expand its reach, making it a more central piece of our categorization system (#1070), at which point we'll probably also have to persist it (#1223).

mlbrgl avatar Mar 30 '22 13:03 mlbrgl

Suggest closing this one and focusing on #1223 and trying to solve this issue when we implement the persisting

danyx23 avatar May 24 '22 11:05 danyx23

@danyx23 ok, I've added a more visible reference to it in #https://github.com/owid/owid-grapher/issues/1223 to not lose track of the context

mlbrgl avatar May 25 '22 14:05 mlbrgl

This issue has had no activity within 10 months. It is considered stale and will be closed in 7 days unless it is worked on or tagged as pinned.

github-actions[bot] avatar Aug 14 '23 07:08 github-actions[bot]