Background
WebsiteAngular's beta /content/schema/instance/:dbId view is missing the "Referrals" section that the legacy Joomla page at https://reactome.org/content/schema/instance/browser/{dbId} renders. That section lists every other instance that references the current one, grouped by attribute name. Example today on prod:
Referrals
(hasModifiedResidue) — [EntityWithAccessionedSequence:R-XTR-159718] f10 [Golgi lumen], [EntityWithAccessionedSequence:R-XTR-159774] …
ContentService currently only exposes class-level referrers via GET /data/schema/{className}/referrals — which returns metadata about which attributes on which classes can reference instances of the named class. That's enough to render the Properties tab's "Referrals" section on /content/schema/{className}, but not enough to render per-instance referrers without an N+1 query storm from the frontend.
Ask
Add a new endpoint along these lines:
GET /data/instance/{id}/referrers
Response shape (suggested):
[
{
"attribute": "hasModifiedResidue",
"fromClass": "EntityWithAccessionedSequence",
"referrers": [
{ "dbId": 159718, "stId": "R-XTR-159718", "displayName": "f10 [Golgi lumen]", "schemaClass": "EntityWithAccessionedSequence" },
...
]
},
...
]
Backed by a Cypher query roughly like:
MATCH (n)-[r]->(target)
WHERE target.dbId = $id
RETURN type(r) AS attribute, labels(n) AS classes, n.dbId, n.stId, n.displayName
…plus the usual apoc.coll.disambiguate / grouping to bucket by attribute.
Why
Without this, the WebsiteAngular beta can't replace prod's instance browser page — there is no frontend-only workaround that's fast enough (would require N+1 lookups across every potential referrer class for every page render).
Consumer
- Repo: https://github.com/reactome/WebsiteAngular
- File:
projects/website-angular/src/app/content/schema/instance-browser/instance-browser.component.ts
- Will fetch this endpoint after
getInstance resolves and render the result below the existing attribute table.
Background
WebsiteAngular's beta
/content/schema/instance/:dbIdview is missing the "Referrals" section that the legacy Joomla page athttps://reactome.org/content/schema/instance/browser/{dbId}renders. That section lists every other instance that references the current one, grouped by attribute name. Example today on prod:ContentService currently only exposes class-level referrers via
GET /data/schema/{className}/referrals— which returns metadata about which attributes on which classes can reference instances of the named class. That's enough to render the Properties tab's "Referrals" section on/content/schema/{className}, but not enough to render per-instance referrers without an N+1 query storm from the frontend.Ask
Add a new endpoint along these lines:
Response shape (suggested):
[ { "attribute": "hasModifiedResidue", "fromClass": "EntityWithAccessionedSequence", "referrers": [ { "dbId": 159718, "stId": "R-XTR-159718", "displayName": "f10 [Golgi lumen]", "schemaClass": "EntityWithAccessionedSequence" }, ... ] }, ... ]Backed by a Cypher query roughly like:
…plus the usual
apoc.coll.disambiguate/ grouping to bucket by attribute.Why
Without this, the WebsiteAngular beta can't replace prod's instance browser page — there is no frontend-only workaround that's fast enough (would require N+1 lookups across every potential referrer class for every page render).
Consumer
projects/website-angular/src/app/content/schema/instance-browser/instance-browser.component.tsgetInstanceresolves and render the result below the existing attribute table.