Class AnnotationRelationDao.RelationSummary

java.lang.Object
ubic.gemma.persistence.service.common.description.AnnotationRelationDao.RelationSummary
Enclosing interface:
AnnotationRelationDao

public static class AnnotationRelationDao.RelationSummary extends Object
A relation aggregated over its attesting experiments, for one basis.

One summary per (triple, basis), and deliberately not merged across bases. Merging would require deciding that two bases naming different terms mean the same thing, and they routinely do while naming different terms: MONDO's germline axiom for SURF1 points at MONDO:0700250 (mitochondrial complex IV deficiency, nuclear type 1) where the curator wrote MONDO:0009723 (Leigh syndrome). Those two share no xref, sit in different branches, and neither subsumes the other - the ontology is modelling the molecular diagnosis and the curator the clinical syndrome. Both are correct. A merge keyed on term identity would call that a disagreement; a merge keyed on anything looser would invent an equivalence nobody asserted. So the rows come back side by side and the caller sees both framings.

  • Constructor Details

    • RelationSummary

      public RelationSummary(String subjectValue, @Nullable String subjectValueUri, @Nullable String subjectCategory, @Nullable String subjectCategoryUri, @Nullable String predicate, @Nullable String predicateUri, String objectValue, @Nullable String objectValueUri, @Nullable String objectCategory, @Nullable String objectCategoryUri, @Nullable Long taxonId, @Nullable String taxonCommonName, @Nullable Integer taxonNcbiId, AnnotationRelationBasis basis, AnnotationRelationStatus status, @Nullable String source, @Nullable String sourceVersion, long numberOfExperiments, long numberOfExperimentsAtFactorValue, long numberOfExperimentsAtTag, long numberOfExperimentsAtBioMaterial, @Nullable Long exampleExperimentId, long numberOfExperimentsWithSubject, long objectBreadth, long subjectBreadth, @Nullable String evidence)
      🛑 Build one with builder(), not with this. Twenty-six positional arguments, a dozen of them long and most of the rest String, is a constructor where a transposition compiles and passes — and adding a field to it broke a stale test class three times in one day, because Maven does not recompile a test whose source has not changed and the mismatch therefore arrives at runtime as NoSuchMethodError rather than at compile time.

      With a builder an added field is additive: existing callers keep compiling AND keep meaning what they meant, and the new field simply defaults.

  • Method Details

    • getSpecificity

      public double getSpecificity()
      The fraction of the subject's experiments this object accounts for, or 0 when there is no denominator to divide by.

      This is what separates a real relation from a background co-occurrence, and support on its own cannot. Abca4 null is annotated retinal degeneration nearly every time it appears; C57BL/6J appears against obesity a handful of times out of many hundreds of experiments, and against hundreds of other diseases besides. Ranking on raw support puts the background strain on top of every disease in the corpus - the obesity is diet-induced, the stroke surgical, the Burkitt lymphoma belongs to the cell line. The same measure demotes the drug-versus-model confusion with no special case, since a drug tested against everything has low specificity against any one thing.

    • getScore

      public double getScore()
      Ranking score, highest first: the basis rank dominates, and support x specificity orders within a basis.

      The basis dominating is the point - an assertion outranks any amount of co-occurrence. A score alone is never enough to act on, which is why the basis, the counts and the denominator all stay on the row for a client to apply its own bar to.

    • getSubjectValue

      public String getSubjectValue()
    • getSubjectValueUri

      @Nullable public String getSubjectValueUri()
    • getSubjectCategory

      @Nullable public String getSubjectCategory()
    • getSubjectCategoryUri

      @Nullable public String getSubjectCategoryUri()
    • getPredicate

      @Nullable public String getPredicate()
    • getPredicateUri

      @Nullable public String getPredicateUri()
    • getObjectValue

      public String getObjectValue()
    • getObjectValueUri

      @Nullable public String getObjectValueUri()
    • getObjectCategory

      @Nullable public String getObjectCategory()
    • getObjectCategoryUri

      @Nullable public String getObjectCategoryUri()
    • getTaxonId

      @Nullable public Long getTaxonId()
    • getTaxonCommonName

      @Nullable public String getTaxonCommonName()
    • getTaxonNcbiId

      @Nullable public Integer getTaxonNcbiId()
    • getBasis

      public AnnotationRelationBasis getBasis()
    • getStatus

      public AnnotationRelationStatus getStatus()
    • getSource

      @Nullable public String getSource()
    • getSourceVersion

      @Nullable public String getSourceVersion()
    • getNumberOfExperiments

      public long getNumberOfExperiments()
    • getNumberOfExperimentsAtFactorValue

      public long getNumberOfExperimentsAtFactorValue()
    • getNumberOfExperimentsAtTag

      public long getNumberOfExperimentsAtTag()
    • getNumberOfExperimentsAtBioMaterial

      public long getNumberOfExperimentsAtBioMaterial()
    • getExampleExperimentId

      @Nullable public Long getExampleExperimentId()
    • getNumberOfExperimentsWithSubject

      public long getNumberOfExperimentsWithSubject()
    • getObjectBreadth

      public long getObjectBreadth()
    • getSubjectBreadth

      public long getSubjectBreadth()
      See Also:
      • subjectBreadth
    • getEvidence

      @Nullable public String getEvidence()
      See Also:
      • evidence
    • getTopicality

      public RelationTopicality getTopicality()
      Whether this relation says something about the subject TERM, or records a parameter of one experiment. See RelationTopicality.
    • getInferenceDirection

      public RelationInferenceDirection getInferenceDirection()
      Which end of this relation licenses an inference about the other. A relation is readable from both ends and inferable from only one — see RelationInferenceDirection.
    • getImpliedSubject

      @Nullable public String getImpliedSubject()
      The claim this relation licenses, as a triple in its own right — not the stored row read backwards.

      Gemma stores Alzheimer disease --has_genotype--> APP/PS1, but the fact that follows from it is "APP/PS1 is a disease model of Alzheimer's": different ends, and a different verb. A consumer handed only the stored row has to invert it and choose a verb itself, and three consumers will choose three.

      Taxon picks the verb, which is the rule the design settled on and the reason RO_0003301 has role in modeling was added to the vocabulary. A mouse carrying APP/PS1 models Alzheimer disease; a human line carrying LRRK2 G2019S is not modelling Parkinson disease, it has it. Unknown taxon falls to has role in modeling, the weaker of the two claims, rather than being guessed at.

      Null when getInferenceDirection() is RelationInferenceDirection.NEITHER — nothing is implied, so there is no claim to phrase.

    • getImpliedSubjectUri

      @Nullable public String getImpliedSubjectUri()
    • getImpliedObject

      @Nullable public String getImpliedObject()
    • getImpliedObjectUri

      @Nullable public String getImpliedObjectUri()
    • getImpliedPredicateUri

      @Nullable public String getImpliedPredicateUri()
      See Also:
    • getImpliedPredicate

      @Nullable public String getImpliedPredicate()
    • getImpliedTripleKey

      @Nullable public String getImpliedTripleKey()
      Identity of the CLAIM this row licenses, as opposed to getTripleKey(), which is the identity of the row as stored. Null when the row licenses nothing.

      🛑 Two different stored relations routinely derive one claim, and tripleKey cannot see it. uib measured it on the BRCA1 card, 2026-08-18:

      BRCA1         --has disease-->  breast cancer   tripleKey  …/672 RO_0016002 …/MONDO_0007254
      breast cancer --has_genotype--> BRCA1           tripleKey  …/MONDO_0007254 GENO_0000222 …/672
      

      Two keys, one claim — BRCA1 — has disease → breast cancer — rendered twice, word for word. tripleKey groups the side-by-side rows ONE relation produces across bases, which is a different shape from two relations converging on one claim, so a consumer reaching for it to deduplicate a card gets a duplicate anyway. Dedup belongs at the level the reader actually sees, which is the claim.

      It correctly keeps apart claims whose verb differs: the same genotype relation on a mouse implies has role in modeling and on a human line has disease, and those are two claims rather than one rendered twice.

    • getTripleKey

      public String getTripleKey()
    • builder