feat(drug): expose synonyms/tradeNames as {label, source}#349
Merged
Conversation
drug_molecule's `synonyms` and `tradeNames` changed from array<string> to array<struct<label, source>> (opentargets/pts#142, tracking opentargets/issues#4414), and the POS ClickHouse drug table now stores Array(Tuple(label, source)) (opentargets/pos#130). Read both as Seq[LabelAndSource] (the existing type Target already uses) — the ClickHouse JSON read path parses the named tuple as a {label, source} object, the same way crossReferences (Tuple(source, ids)) already works. The Drug GraphQL type is derived, so the field type auto-updates to [LabelAndSource]; the synonyms/ tradeNames field docs are updated to describe the provenance.
remo87
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Propagate the
drug_moleculeschema change into the API.synonymsandtradeNameschanged fromarray<string>toarray<struct<label, source>>(opentargets/pts#142, tracking issue opentargets/issues#4414), and the POS ClickHousedrugtable now storesArray(Tuple(label String, source String))(opentargets/pos#130). The API must read and expose the new shape.What changed
app/models/entities/Drug.scala—synonyms/tradeNames:Seq[String]→Seq[LabelAndSource](the existing typeTargetalready uses), plus an import for its JSONOFormat. The ClickHouse read path (fromPositionedResult) parses each row as JSON viaReads[Drug]; ClickHouse emits a namedTuple(label, source)as a{label, source}object, exactly howcrossReferences(Tuple(source, ids)) already deserializes.app/models/gql/Objects.scala— theDrugGraphQL type isderiveObjectType, so thesynonyms/tradeNamesfield type auto-updates to[LabelAndSource](which already has a documentedObjectTypeexposinglabel/source). The twoDocumentFielddescriptions are updated to describe the provenance — mirroring the schema documentation added in ot_croissant (feat: document drug_molecule synonyms/tradeNames {label, source} subfields ot_croissant#47):synonyms→ "List of alternative names for the drug, each with its source (e.g. ChEMBL, or AACT for names mined from clinical trials)"tradeNames→ "List of brand names for the drug, each with its source"No resolver, search, or other code references drug
synonyms/tradeNamesas strings (verified), so this is the whole change.GraphQL impact
synonyms/tradeNameschange from[String]to[LabelAndSource]({ label source }). This is a breaking change for clients that select these as scalars — consumers must now request the subfields. It matches howTarget.synonymsis already exposed, and lands with the new data in the 26.06 run.Note
Based on
master. I could not runsbt compilelocally (this environment only has Java 17; the project targets Java 21 via sdkman) — the change is a direct reuse of the establishedLabelAndSourcepattern, so CI compilation is the verification.