From ee5d95dd7a15081baaa05803bdd0b6a95fd755aa Mon Sep 17 00:00:00 2001 From: Adam Wright Date: Fri, 30 Oct 2026 18:26:25 +0000 Subject: [PATCH 1/2] Note where the old enhanced query drops references (#760) /data/query/enhanced keeps Java's answer byte for byte, including a bare dbId for an object written earlier; since graph-core bb5e0ca0 an event's parent pathways come first, so references its parent also cites are bare numbers in its own list. Production's browser loses them (#760). The endpoint and the event model now say to read an event's lists from /enhanced/v2, as the details pages do, so the new site does not copy the fault. Co-Authored-By: Claude Opus 5.5 --- .../src/app/model/graph/event/event.model.ts | 6 ++++++ tools/content-node/data-query-endpoints.ts | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/projects/pathway-browser/src/app/model/graph/event/event.model.ts b/projects/pathway-browser/src/app/model/graph/event/event.model.ts index 0c4fdee6b..45dda35b3 100644 --- a/projects/pathway-browser/src/app/model/graph/event/event.model.ts +++ b/projects/pathway-browser/src/app/model/graph/event/event.model.ts @@ -15,6 +15,12 @@ import { GO_BiologicalProcess } from '../go-term/go-biological-process.model'; * As /data/query/enhanced sends it, which leaves out what an event has none of: * of 15 sampled pathways one had authors, reviewers or a review status, and * three of 15 reactions (#344). + * + * In that answer (not /enhanced/v2) a list such as `literatureReference` can + * hold bare dbIds where the object was written earlier in the answer, often in + * the parent pathway (`eventOf`); the types here do not say so. Dropping them + * loses references, as production's browser does (#760). Take an event's lists + * from /enhanced/v2, which writes every object in full. */ export interface Event extends DatabaseObject, InDepth, HasFigure { stId: string; diff --git a/tools/content-node/data-query-endpoints.ts b/tools/content-node/data-query-endpoints.ts index 7f0adf17b..ab41a0479 100644 --- a/tools/content-node/data-query-endpoints.ts +++ b/tools/content-node/data-query-endpoints.ts @@ -391,6 +391,14 @@ export const dataQueryEndpoints: Endpoint[] = [ * serialiser in the request's view. The entity popup, the website's * content pages and the IDG panel read it. * + * Kept byte for byte as Java answers it, so it keeps a trap: an object is + * written in full only once, later as its bare dbId, and since graph-core + * bb5e0ca0 (Aug 2025) an event's parent pathways (`eventOf`) come before its + * own lists. A reference its parent also cites is therefore a bare number + * in the event's `literatureReference`, and a reader that keeps only + * objects loses it, which is #760 on production. Read an event's lists + * from /query/enhanced/v2 (full objects), as the details pages do. + * * Its relationships go both ways unless QueryObjectController's * needsIncomingRelationship says not (needsIncoming). The id is read as * getIdentifier reads it (inDepthId). From bb4e325fe6b02cda4ad51151ce045984ec1b647b Mon Sep 17 00:00:00 2001 From: Adam Wright Date: Fri, 30 Oct 2026 18:28:58 +0000 Subject: [PATCH 2/2] The note on the old enhanced query, from #761's review: v2 has back-references too v2 writes each object once as well, with @id, and points back with @ref; it is safe only through the site's JSOGDeserializer, which the note now says. Neighbouring events, not only parent pathways, come before an event's lists in v1. The two v1 readers still at risk are issue #762. Co-Authored-By: Claude Opus 5.5 --- .../src/app/model/graph/event/event.model.ts | 7 ++++--- tools/content-node/data-query-endpoints.ts | 15 +++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/projects/pathway-browser/src/app/model/graph/event/event.model.ts b/projects/pathway-browser/src/app/model/graph/event/event.model.ts index 45dda35b3..7f0f71b08 100644 --- a/projects/pathway-browser/src/app/model/graph/event/event.model.ts +++ b/projects/pathway-browser/src/app/model/graph/event/event.model.ts @@ -18,9 +18,10 @@ import { GO_BiologicalProcess } from '../go-term/go-biological-process.model'; * * In that answer (not /enhanced/v2) a list such as `literatureReference` can * hold bare dbIds where the object was written earlier in the answer, often in - * the parent pathway (`eventOf`); the types here do not say so. Dropping them - * loses references, as production's browser does (#760). Take an event's lists - * from /enhanced/v2, which writes every object in full. + * the parent pathway (`eventOf`) or a preceding or following event; the types + * here do not say so. Dropping them loses references, as production's browser + * does (#760). Take an event's lists from /enhanced/v2 through JSOGDeserializer, + * which resolves v2's own back-references (`@ref`) to the objects they name. */ export interface Event extends DatabaseObject, InDepth, HasFigure { stId: string; diff --git a/tools/content-node/data-query-endpoints.ts b/tools/content-node/data-query-endpoints.ts index ab41a0479..d48710d65 100644 --- a/tools/content-node/data-query-endpoints.ts +++ b/tools/content-node/data-query-endpoints.ts @@ -392,12 +392,15 @@ export const dataQueryEndpoints: Endpoint[] = [ * content pages and the IDG panel read it. * * Kept byte for byte as Java answers it, so it keeps a trap: an object is - * written in full only once, later as its bare dbId, and since graph-core - * bb5e0ca0 (Aug 2025) an event's parent pathways (`eventOf`) come before its - * own lists. A reference its parent also cites is therefore a bare number - * in the event's `literatureReference`, and a reader that keeps only - * objects loses it, which is #760 on production. Read an event's lists - * from /query/enhanced/v2 (full objects), as the details pages do. + * written in full only once, later as its bare dbId, and an event's + * neighbours come before its own lists: its preceding and following events, + * and since graph-core bb5e0ca0 (Aug 2025) its parent pathways (`eventOf`). + * A reference one of them also cites is therefore a bare number in the + * event's `literatureReference`, and a reader that keeps only objects loses + * it, which is #760 on production. Read an event's lists from + * /query/enhanced/v2 through the site's JSOGDeserializer, as the details + * pages do: v2 writes each object once too, with `@id`, and points back to + * it with `{"@ref": …}`, which the deserializer resolves. * * Its relationships go both ways unless QueryObjectController's * needsIncomingRelationship says not (needsIncoming). The id is read as