Class AnnotationsWebService.TaxonConstraintValueObject

java.lang.Object
ubic.gemma.rest.AnnotationsWebService.TaxonConstraintValueObject
Enclosing class:
AnnotationsWebService

public static final class AnnotationsWebService.TaxonConstraintValueObject extends Object
What the ontology says about this term's species applicability.

🛑 Presence means "we looked." The object is emitted for every enriched hit, including the overwhelming majority that declare no constraint — those carry declared: false and null taxon fields. A null taxonConstraint on the hit means only "not enriched" (outside the top-N), never "no constraint".

That split exists because a species gate has to tell "MONDO says this is human-applicable, pass it" from "we did not check, so it could be the sheep term". One sentinel for both forces the safe reading to always be the second, which costs a /annotations/term?uri=… round trip per candidate and defeats the point of putting the field in the search response. Raised by CAB 2026-08-15, and it is the same defect as an absent value standing in for a failed one — absent evidence is not failed evidence.

Author:
tesarst
  • Constructor Details

    • TaxonConstraintValueObject

      public TaxonConstraintValueObject(boolean declared, @Nullable String uri, @Nullable Integer ncbiTaxonId, @Nullable String label, List<AnnotationsWebService.OntologyTermSimpleValueObject> crossSpeciesExactMatch)
      Creates a new TaxonConstraintValueObject instance.
      Parameters:
      declared - Whether the ontology declares an in_taxon constraint for this term. False means checked and none declared — a term with no species restriction, i.e. normally applicable.
      uri - Full NCBITaxon URI, e.g. http://purl.obolibrary.org/obo/NCBITaxon_9940. Null when declared is false.
      ncbiTaxonId - NCBI taxon id, e.g. 9940 for Ovis aries. The field to key on: the label is absent whenever NCBITaxon is not loaded (Gemma does not load it) and the referencing ontology declared none of its own, so a client keying on the name stops matching the day that changes.
      label - Scientific name when the loaded model carries one, e.g. Ovis aries; often null.
      crossSpeciesExactMatch - MONDO's crossSpeciesExactMatch targets — the same disease in another species, typically the human counterpart.

      This is the difference between a species gate DROPPING a tag and REPAIRING it: MONDO:0700199 sheep lung adenocarcinoma → MONDO:0005061 lung adenocarcinoma is a defensible annotation, where a bare rejection leaves the experiment with no disease tag at all. MONDO carries 2,279 of these.

      Carries the URI, not just the label. "lung adenocarcinoma" names both MONDO:0005061 and HP:0030078, so a client repairing from the string can land on the phenotype instead of the disease — the exact HP-beats-MONDO confusion the category table exists to prevent. label is null whenever the referenced term's ontology is not loaded, which is precisely when the identifier matters most.

      Empty rather than null when the term declares none, since the object is only ever emitted for hits we actually inspected.

  • Method Details

    • isDeclared

      public boolean isDeclared()
      Whether the ontology declares an in_taxon constraint for this term. False means checked and none declared — a term with no species restriction, i.e. normally applicable.
    • getUri

      @Nullable public String getUri()
      Full NCBITaxon URI, e.g. http://purl.obolibrary.org/obo/NCBITaxon_9940. Null when declared is false.
    • getNcbiTaxonId

      @Nullable public Integer getNcbiTaxonId()
      NCBI taxon id, e.g. 9940 for Ovis aries. The field to key on: the label is absent whenever NCBITaxon is not loaded (Gemma does not load it) and the referencing ontology declared none of its own, so a client keying on the name stops matching the day that changes.
    • getLabel

      @Nullable public String getLabel()
      Scientific name when the loaded model carries one, e.g. Ovis aries; often null.
    • getCrossSpeciesExactMatch

      public List<AnnotationsWebService.OntologyTermSimpleValueObject> getCrossSpeciesExactMatch()
      MONDO's crossSpeciesExactMatch targets — the same disease in another species, typically the human counterpart.

      This is the difference between a species gate DROPPING a tag and REPAIRING it: MONDO:0700199 sheep lung adenocarcinoma → MONDO:0005061 lung adenocarcinoma is a defensible annotation, where a bare rejection leaves the experiment with no disease tag at all. MONDO carries 2,279 of these.

      Carries the URI, not just the label. "lung adenocarcinoma" names both MONDO:0005061 and HP:0030078, so a client repairing from the string can land on the phenotype instead of the disease — the exact HP-beats-MONDO confusion the category table exists to prevent. label is null whenever the referenced term's ontology is not loaded, which is precisely when the identifier matters most.

      Empty rather than null when the term declares none, since the object is only ever emitted for hits we actually inspected.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object