Class AnnotationSet

java.lang.Object
ubic.gemma.model.common.AbstractIdentifiable
ubic.gemma.model.common.auditAndSecurity.curation.AnnotationSet
All Implemented Interfaces:
Identifiable

@Entity public class AnnotationSet extends AbstractIdentifiable
A "curation hypothesis" attached to an Investigation: a JSON description of one annotation set in one of three lifecycle shapes (see AnnotationSetRole).

Relationship to the applied annotations. The authoritative record of an experiment's annotations lives on the EE entity graph (Characteristic, Statement, FactorValue, …). AnnotationSet is the curation log alongside that graph — a side-table of hypotheses, drafts, and snapshots that may or may not have been applied. Reading "the current annotations on EE X" still means walking the EE; reading "what did the agent propose / what is the curator drafting / what was the state at time T" is what this table answers.

Roles.

  • AnnotationSetRole.PROPOSAL — immutable hypothesis emitted by an agent run (or external import). The kind sub-discriminator distinguishes a forward-looking proposal from a post-hoc audit.
  • AnnotationSetRole.DRAFT — mutable curator WIP buffer. Typically seeded from a PROPOSAL via parent; per-element disposition is derived at read time by diffing payloadJson against the parent's payload. parkedElements is the sidecar for opaque element keys the curator has chosen to park.
  • AnnotationSetRole.SNAPSHOT — immutable capture of the experiment's annotation state at a point in time. A SNAPSHOT with finalizedAt set is the "polished" view the curator has blessed as canonical; without it, the row is a raw capture (e.g. for diffing across runs).

Idempotency. UNIQUE(investigation, role, runId) carries three different semantics depending on role:

  • PROPOSAL — runId is the agent runner's unique identifier for the run; re-posting the same run is a no-op returning the existing row (matches the AgentProposal contract).
  • DRAFT — runId is derived as "draft-{createdBy}" so the constraint enforces "one DRAFT per (investigation, curator)".
  • SNAPSHOT — runId is a generated UUID at create time; SNAPSHOTs are append-only.

FK to Investigation cascades on delete; FK to parent is ON DELETE SET NULL so a parent retirement leaves the descendant payload intact (sans lineage baseline).

  • Constructor Details

    • AnnotationSet

      public AnnotationSet()
  • Method Details

    • getStatus

      @Nullable public String getStatus()
    • setStatus

      public void setStatus(@Nullable String status)
    • getFactorCount

      @Nullable public Integer getFactorCount()
    • setFactorCount

      public void setFactorCount(@Nullable Integer factorCount)
    • getTagCount

      @Nullable public Integer getTagCount()
    • setTagCount

      public void setTagCount(@Nullable Integer tagCount)
    • getInvestigation

      public Investigation getInvestigation()
    • setInvestigation

      public void setInvestigation(Investigation investigation)
    • getRole

      public AnnotationSetRole getRole()
    • setRole

      public void setRole(AnnotationSetRole role)
    • getSource

      public AnnotationSetSource getSource()
    • setSource

      public void setSource(AnnotationSetSource source)
    • getKind

      public AgentCurationKind getKind()
    • setKind

      public void setKind(AgentCurationKind kind)
    • getRunId

      public String getRunId()
    • setRunId

      public void setRunId(String runId)
    • getParent

      public AnnotationSet getParent()
    • setParent

      public void setParent(AnnotationSet parent)
    • getCreatedBy

      public String getCreatedBy()
    • setCreatedBy

      public void setCreatedBy(String createdBy)
    • getCreatedAt

      public Date getCreatedAt()
    • setCreatedAt

      public void setCreatedAt(Date createdAt)
    • getUpdatedAt

      public Date getUpdatedAt()
    • setUpdatedAt

      public void setUpdatedAt(Date updatedAt)
    • getFinalizedAt

      public Date getFinalizedAt()
    • setFinalizedAt

      public void setFinalizedAt(Date finalizedAt)
    • getFinalizedBy

      public String getFinalizedBy()
    • setFinalizedBy

      public void setFinalizedBy(String finalizedBy)
    • getFinalizedNotes

      public String getFinalizedNotes()
    • setFinalizedNotes

      public void setFinalizedNotes(String finalizedNotes)
    • getAgentVersion

      public String getAgentVersion()
    • setAgentVersion

      public void setAgentVersion(String agentVersion)
    • getModel

      public String getModel()
    • setModel

      public void setModel(String model)
    • getRunSha

      public String getRunSha()
    • setRunSha

      public void setRunSha(String runSha)
    • getAgentName

      public String getAgentName()
    • setAgentName

      public void setAgentName(String agentName)
    • getRanAt

      public Date getRanAt()
    • setRanAt

      public void setRanAt(Date ranAt)
    • getPayloadJson

      public String getPayloadJson()
    • setPayloadJson

      public void setPayloadJson(String payloadJson)
    • getParkedElements

      public String getParkedElements()
    • setParkedElements

      public void setParkedElements(String parkedElements)
    • hashCode

      public int hashCode()
      Description copied from class: AbstractIdentifiable
      Important note: Never use the ID in the hashCode() implementation since it can be assigned when the object is persisted.
      Specified by:
      hashCode in class AbstractIdentifiable
    • equals

      public boolean equals(Object o)
      Description copied from class: AbstractIdentifiable
      Important note: Two objects with the same class and non-null ID must be considered equal. If one or both IDs are nulls, the rest of the state can be used to determine equality.
      Specified by:
      equals in class AbstractIdentifiable