Class Statement

All Implemented Interfaces:
Comparable<Characteristic>, Describable, Identifiable

@Entity public class Statement extends Characteristic
A special kind of characteristic that act as a statement.

It can relate to up to two other objects, essentially forming two statements. This is a limited form of RDF-style triplet with the main limitation that a given subject can have up to two predicates and objects.

You can make abstraction of that implementation detail by using getSubject(int), getPredicate(int), getObject(int) and getNumberOfStatements().

Author:
poirigui
  • Constructor Details

    • Statement

      public Statement()
  • Method Details

    • getValue

      @Deprecated public String getValue()
      Deprecated.
      use getSubject() instead
      Overrides:
      getValue in class Characteristic
      Returns:
      The human-readable term (e.g., "OrganismPart"; "kinase")
    • setValue

      @Deprecated public void setValue(String value)
      Deprecated.
      use setSubject(String) instead
      Overrides:
      setValue in class Characteristic
    • getValueUri

      @Deprecated public String getValueUri()
      Deprecated.
      use getSubjectUri() instead
      Overrides:
      getValueUri in class Characteristic
      Returns:
      This can be a URI to any resources that describes the characteristic. Often it might be a URI to an OWL ontology term. If the URI is an instance of an abstract class, the classUri should be filled in with the URI for the abstract class.
    • setValueUri

      @Deprecated public void setValueUri(@Nullable String uri)
      Deprecated.
      Description copied from class: Characteristic
      🛑 Blank is stored as null, the way Characteristic.setValue(String) normalises its free text.

      An empty string is a SECOND DIALECT for ungrounded, and every layer reads the two differently: CharacteristicUtils.equals(String, String, String, String) treats a non-null URI as grounded, so '' beside a NULL reads as "ontology term vs free text" and the duplicate guard in doAddAnnotation lets the pair through; a census grouping on the raw column puts them in two groups. Production carried 80 such rows, all on curation surfaces (52 factor-value statements, 31 experiment tags, 0 biomaterial characteristics); normalising them to NULL on 2026-09-10 collapsed two pairs onto one coordinate and manufactured duplicate tags (frinkbro, 2026-09-11). Ten statement-URI rows were still '' when this landed.

      Only some Factory.newInstance overloads stripped; 72 callsites set a URI directly. The normalisation belongs at the one chokepoint rather than at each of them.

      Entities use @Access(AccessType.FIELD), so Hibernate does not call this on load: an existing '' row reads back unchanged and is not silently rewritten.

      Overrides:
      setValueUri in class Characteristic
    • getSubject

      public String getSubject()
      Obtain the subject of the statement.
    • setSubject

      public void setSubject(String subject)
    • getSubjectUri

      public String getSubjectUri()
      Obtain the subject URI of the statement.
    • setSubjectUri

      public void setSubjectUri(String subject)
    • getPredicate

      @Nullable @FullTextField public String getPredicate()
    • setPredicate

      public void setPredicate(@Nullable String predicate)
    • getPredicateUri

      @Nullable @KeywordField public String getPredicateUri()
    • setPredicateUri

      public void setPredicateUri(@Nullable String predicateUri)
      Blank is stored as null, for the reason spelled out on Characteristic.setValueUri(String): an empty string is a second dialect for ungrounded and no layer reads it that way. Prod carried 7 PREDICATE_URI = '' and 3 OBJECT_URI = '' rows, all factor-value statements, when this landed — the statement columns were outside the sweep that cleared VALUE_URI.
    • getObject

      @Nullable @FullTextField public String getObject()
    • setObject

      public void setObject(@Nullable String object)
    • getObjectUri

      @Nullable @KeywordField public String getObjectUri()
    • setObjectUri

      public void setObjectUri(@Nullable String objectUri)
    • getSecondPredicate

      @Nullable @FullTextField public String getSecondPredicate()
    • setSecondPredicate

      public void setSecondPredicate(@Nullable String secondPredicate)
    • getSecondPredicateUri

      @Nullable @KeywordField public String getSecondPredicateUri()
    • setSecondPredicateUri

      public void setSecondPredicateUri(@Nullable String secondPredicateUri)
    • getSecondObject

      @Nullable @FullTextField public String getSecondObject()
    • setSecondObject

      public void setSecondObject(@Nullable String secondObject)
    • getSecondObjectUri

      @Nullable @KeywordField public String getSecondObjectUri()
    • setSecondObjectUri

      public void setSecondObjectUri(@Nullable String secondObjectUri)
    • getSubject

      @Nullable public String getSubject(int index)
    • getSubjectUri

      @Nullable public String getSubjectUri(int index)
    • getPredicate

      @Nullable public String getPredicate(int index)
    • getPredicateUri

      @Nullable public String getPredicateUri(int index)
    • getObject

      @Nullable public String getObject(int index)
    • getObjectUri

      @Nullable public String getObjectUri(int index)
    • getNumberOfStatements

      public int getNumberOfStatements()
    • equals

      public boolean equals(Object object)
      Description copied from class: AbstractDescribable
      Important note: The name should be compared in a case-insensitive manner. You can use DescribableUtils.equalsByName(Describable, Describable) to get the correct behavior.

      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.

      Overrides:
      equals in class Characteristic
    • hashCode

      public int hashCode()
      Constant, and the SAME constant Characteristic.hashCode() returns. Restated here to say why the predicate fields are NOT hashed, and why this cannot be getClass().hashCode(): Characteristic.equals(Object) calls a Statement equal to a Characteristic with the same category and value, so a per-class constant would break the equals/hashCode contract between them.

      This hashed the predicate and object terms on top of the superclass's mutable category/value hash. Every one of those fields is edited in place by curation, and a Statement lives in FactorValue's Set<Statement>, so an edit moved the element to a stale bucket. See Characteristic.hashCode() for the full reasoning and for the rule about not keying large maps by these types.

      Overrides:
      hashCode in class Characteristic
    • compareTo

      public int compareTo(@NonNull Characteristic characteristic)
      Specified by:
      compareTo in interface Comparable<Characteristic>
      Overrides:
      compareTo in class Characteristic
    • toString

      public String toString()
      Overrides:
      toString in class Characteristic