Class CharacteristicValueObject

java.lang.Object
ubic.gemma.model.common.IdentifiableValueObject<Characteristic>
ubic.gemma.model.common.description.CharacteristicValueObject
All Implemented Interfaces:
Serializable, Comparable<CharacteristicValueObject>, Identifiable

public class CharacteristicValueObject extends IdentifiableValueObject<Characteristic> implements Comparable<CharacteristicValueObject>
Value object representation of a Characteristic.
Author:
poirigui
See Also:
  • Field Details

    • valueId

      public String valueId
      A unique ontology identifier (i.e. IRI) for this characteristic.
  • Constructor Details

    • CharacteristicValueObject

      public CharacteristicValueObject()
      Required when using the class as a spring bean.
    • CharacteristicValueObject

      public CharacteristicValueObject(Long id)
    • CharacteristicValueObject

      public CharacteristicValueObject(Characteristic characteristic)
    • CharacteristicValueObject

      public CharacteristicValueObject(String value, @Nullable String valueUri)
    • CharacteristicValueObject

      public CharacteristicValueObject(String value, @Nullable String valueUri, String category, @Nullable String categoryUri)
  • Method Details

    • characteristic2CharacteristicVO

      public static Collection<CharacteristicValueObject> characteristic2CharacteristicVO(Collection<? extends Characteristic> characteristics)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class IdentifiableValueObject<Characteristic>
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class IdentifiableValueObject<Characteristic>
    • compareTo

      public int compareTo(@NonNull CharacteristicValueObject that)
      Specified by:
      compareTo in interface Comparable<CharacteristicValueObject>
    • toString

      public String toString()
      Overrides:
      toString in class IdentifiableValueObject<Characteristic>
    • incrementOccurrenceCount

      public void incrementOccurrenceCount()
    • getCategory

      public String getCategory()
    • getCategoryUri

      public String getCategoryUri()
    • getValue

      public String getValue()
    • getValueUri

      public String getValueUri()
    • getOriginalValue

      public String getOriginalValue()
      The submitter's own wording, as it arrived — before curation replaced value with an ontology label, and before a compound field was split.

      Once value has been grounded the original is not recoverable from anything else on the wire: organism part: "hypothalamus" does not say the submitter wrote tissue: "Hypothalamus". That makes two questions unanswerable without it — "is this the right resolution of what they actually wrote?" and "what literal should a curator revisit when no term covers it?" (a mouse cohort aged "2-3 months" straddles two stages; the span is real and only the literal carries it). Curators were preserving such strings by hand in free-text tags because nothing surfaced this field.

      Null means "not recorded", NEVER "same as value". It is populated at GEO import and backfilled from the pre-edit value when a curator grounds a tag, so it is absent for rows written through the curation API and for anything that never had a distinct original. A consumer that reads null as "unchanged" turns an unknown into a confirmed no-op.

      Serialized only when present. Was withheld from REST under the old @GemmaWebOnly marker until the field's only consumer, Gemma Web, was retired.

    • getValueId

      public String getValueId()
      A unique ontology identifier (i.e. IRI) for this characteristic.
    • getSupportingEvidence

      @Nullable public com.fasterxml.jackson.databind.JsonNode getSupportingEvidence()
      Verbatim provenance backing a curated characteristic — a JSON array of {quote, source, location, …} items the curation agents emitted. Gemma stores and serves it opaquely; the agents repo owns the schema.

      This is the field that answers "where did this come from" for an ExperimentalFactor's category, which is a Characteristic like any other and therefore already has the storage. Null means "nothing recorded", which is the expected reading for most rows — it is not an error and must not be rendered as one.

      Provenance rather than identity, so it is excluded from equals/hashCode for the same reason supplementary is: the same term reached with and without recorded evidence is the same term, and including it here would break the de-duplication the search paths rely on.

    • getUrlId

      public String getUrlId()
      id used by url on the client side
    • isAlreadyPresentInDatabase

      public boolean isAlreadyPresentInDatabase()
    • isAlreadyPresentOnGene

      public boolean isAlreadyPresentOnGene()
    • isSupplementary

      public boolean isSupplementary()
      True when this candidate came from a flat lexical catalogue (MGI names, Cellosaurus) rather than a conventional ontology.

      These sources exist to back-fill names the ontologies lack, and their index applies a large exact-name boost whose scores are not comparable with a Jena index's — which is why OntologyServiceImpl.findTermsInexact ranks them below every conventional hit rather than merging them. Carrying the flag onto the value object lets the ranking layers keep that distinction instead of re-deriving it from URI namespaces one pair at a time.

      Provenance rather than identity, so it is excluded from equals/hashCode: the same term reached through two sources is the same term.

    • isChild

      public boolean isChild()
      child term from a root
    • getNumTimesUsed

      public int getNumTimesUsed()
    • getOntologyUsed

      public String getOntologyUsed()
      what Ontology uses this term
    • getPrivateGeneCount

      public long getPrivateGeneCount()
    • getPublicGeneCount

      public long getPublicGeneCount()
      number of occurrences in all genes
    • isRoot

      public boolean isRoot()
      root of a query
    • getTaxon

      public String getTaxon()
    • getValueDefinition

      public String getValueDefinition()
      The definition of the value, if it is an ontology term, as supplied by the ontology. If the value is free text, this will be empty
    • setCategory

      public void setCategory(String category)
    • setCategoryUri

      public void setCategoryUri(String categoryUri)
    • setValue

      public void setValue(String value)
    • setValueUri

      public void setValueUri(String valueUri)
    • setOriginalValue

      public void setOriginalValue(String originalValue)
      The submitter's own wording, as it arrived — before curation replaced value with an ontology label, and before a compound field was split.

      Once value has been grounded the original is not recoverable from anything else on the wire: organism part: "hypothalamus" does not say the submitter wrote tissue: "Hypothalamus". That makes two questions unanswerable without it — "is this the right resolution of what they actually wrote?" and "what literal should a curator revisit when no term covers it?" (a mouse cohort aged "2-3 months" straddles two stages; the span is real and only the literal carries it). Curators were preserving such strings by hand in free-text tags because nothing surfaced this field.

      Null means "not recorded", NEVER "same as value". It is populated at GEO import and backfilled from the pre-edit value when a curator grounds a tag, so it is absent for rows written through the curation API and for anything that never had a distinct original. A consumer that reads null as "unchanged" turns an unknown into a confirmed no-op.

      Serialized only when present. Was withheld from REST under the old @GemmaWebOnly marker until the field's only consumer, Gemma Web, was retired.

    • setValueId

      public void setValueId(String valueId)
      A unique ontology identifier (i.e. IRI) for this characteristic.
    • setSupportingEvidence

      public void setSupportingEvidence(@Nullable com.fasterxml.jackson.databind.JsonNode supportingEvidence)
      Verbatim provenance backing a curated characteristic — a JSON array of {quote, source, location, …} items the curation agents emitted. Gemma stores and serves it opaquely; the agents repo owns the schema.

      This is the field that answers "where did this come from" for an ExperimentalFactor's category, which is a Characteristic like any other and therefore already has the storage. Null means "nothing recorded", which is the expected reading for most rows — it is not an error and must not be rendered as one.

      Provenance rather than identity, so it is excluded from equals/hashCode for the same reason supplementary is: the same term reached with and without recorded evidence is the same term, and including it here would break the de-duplication the search paths rely on.

    • setUrlId

      public void setUrlId(String urlId)
      id used by url on the client side
    • setAlreadyPresentInDatabase

      public void setAlreadyPresentInDatabase(boolean alreadyPresentInDatabase)
    • setAlreadyPresentOnGene

      public void setAlreadyPresentOnGene(boolean alreadyPresentOnGene)
    • setSupplementary

      public void setSupplementary(boolean supplementary)
      True when this candidate came from a flat lexical catalogue (MGI names, Cellosaurus) rather than a conventional ontology.

      These sources exist to back-fill names the ontologies lack, and their index applies a large exact-name boost whose scores are not comparable with a Jena index's — which is why OntologyServiceImpl.findTermsInexact ranks them below every conventional hit rather than merging them. Carrying the flag onto the value object lets the ranking layers keep that distinction instead of re-deriving it from URI namespaces one pair at a time.

      Provenance rather than identity, so it is excluded from equals/hashCode: the same term reached through two sources is the same term.

    • setChild

      public void setChild(boolean child)
      child term from a root
    • setNumTimesUsed

      public void setNumTimesUsed(int numTimesUsed)
    • setOntologyUsed

      public void setOntologyUsed(String ontologyUsed)
      what Ontology uses this term
    • setPrivateGeneCount

      public void setPrivateGeneCount(long privateGeneCount)
    • setPublicGeneCount

      public void setPublicGeneCount(long publicGeneCount)
      number of occurrences in all genes
    • setRoot

      public void setRoot(boolean root)
      root of a query
    • setTaxon

      public void setTaxon(String taxon)
    • setValueDefinition

      public void setValueDefinition(String valueDefinition)
      The definition of the value, if it is an ontology term, as supplied by the ontology. If the value is free text, this will be empty