Introduce BackLinkViewer component and associated config #342

Merged
jsheunis merged 1 commit from backlinks into main 2026-02-25 10:02:48 +00:00

1 commit

Author SHA1 Message Date
751c8340d1 Introduce 'BackLinkViewer' component and associated config
This new component allows viewing so-called backlinks for a record, i.e. other records
that reference the current record via some property, directly or indirectly. Upon
mounting, the component will first fetch all 'Thing' records (importantly: including
subclasses) that somehow include the PID of the current record (via 'matching' parament)
from the backend service. Determining which referencing records to show required a new
utility function 'getReferencingRecords' which does the following:
- get all quads with the current PID as object
- if the quad has a named node as subject, save it as a referencing record
- if the quad has a blank node as subject, get all quads with the blank node ID as object

This means it recurses into the second level to find referencing records, and no further.
This is a restriction that could be reconsidered and addressed in future, although local
testing on actual data compliant to the xyzri schema has not shown this to be necessary.

Saving a referencing record also includes saving the quad's predicate, which is taken as
the referencing property, e.g. a 'Person' is referenced by a 'Dataset' via 'attributed_to'.
This allows grouping referencing records by property in the 'BackLinkViewer' component.

Lastly, a new config sub-option 'hideBackLinks' is introduces for the 'NodeShapeViewer's
'component_config'. An example:

component_config:
  NodeShapeViewer:
    hideBackLinks:
      - dlthings:AnnotationTag
      - xyzri:AgentRole

'hideBackLinks' can be a boolean or array. It is set to 'true' by default, meaning that
backlinks won't be displayed by default (i.e. when the option is not configured). If an
array with class CURIEs is supplied, the back links will be displayed for records of all
classes except for those included in the configured array.
2026-02-25 10:59:09 +01:00