Skip to content

Commit 092e008

Browse files
committed
Use Variable.getName() for synthesised queried-term column
The queried-term column (Downstream_Class for an upstream call and vice versa) was emitting variable.getId() — so the v2 table showed "FBbt_00100246" instead of "mushroom body output neuron 11". Variable.getName() resolves to the human label via Node.getName() on the EMF parent (verified against org.geppetto.model/.../Node.java tag vfb_20200604_a). Earlier I dropped it after conflating with the AQueryResult.getValues() compile error — different issue, Variable exposes it just fine. Falls back to id if name is null/empty.
1 parent 0c1caed commit 092e008

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/main/java/uk/ac/vfb/geppetto/VFBqueryJsonProcessor.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,12 @@ private void buildClassConnectivityRows(Variable variable, QueryResults in, Quer
158158
// the plain label text. VFBquery's API returns the partner column as
159159
// markdown ("[label](id)"); strip that to the label only so the v2
160160
// frontend can link both label columns from the composite ID.
161-
// For the queried-term column we don't have the human label (the
162-
// Variable EClass doesn't expose it cleanly at compile time and we'd
163-
// otherwise need a second API call). Fall back to the id; the
164-
// frontend will still resolve and link it via the composite ID.
165-
String queriedLabel = queriedId;
161+
// For the queried-term column we synthesise the label from the
162+
// Variable's Node.getName() (the human label, set when the term-info
163+
// processor created the variable). Fall back to the id if the name
164+
// is null/empty.
165+
String queriedName = variable != null ? variable.getName() : null;
166+
String queriedLabel = (queriedName != null && !queriedName.isEmpty()) ? queriedName : queriedId;
166167

167168
String partnerColumn = upstreamCall ? COL_UPSTREAM : COL_DOWNSTREAM;
168169

0 commit comments

Comments
 (0)