Enum Class RelationInferenceDirection

java.lang.Object
java.lang.Enum<RelationInferenceDirection>
ubic.gemma.model.common.description.RelationInferenceDirection
All Implemented Interfaces:
Serializable, Comparable<RelationInferenceDirection>, Constable

public enum RelationInferenceDirection extends Enum<RelationInferenceDirection>
Which end of a relation implies the other.

🛑 A relation is readable from both ends; it is not INFERABLE from both ends. This is the distinction the whole gate depends on and it is easy to lose, because the store is deliberately symmetric — findRelations answers from either side, and that is right for browsing. Applying a relation as an inference is not symmetric:

stored:  Alzheimer disease  -- has_genotype -->  APP/PS1

  APP/PS1  =>  an Alzheimer disease model     ✅  the specific implies the general
  Alzheimer disease  =>  APP/PS1              🛑  NOT all Alzheimer models are APP/PS1

A gate that followed the second direction would suppress a perfectly correct genotype: APP/PS1 tag because the dataset also said disease: Alzheimer — deleting curation on the strength of an inference nobody made.

And the valid direction is not the same for every predicate, because Gemma's curation does not put the specific end on the same side each time:

disease model: Alzheimer  -- has_genotype -->  APP/PS1        specific is the OBJECT
MCF7 cell  -- derives from patient having disease -->  DOID   specific is the SUBJECT

So the direction is read off which end carries the narrower thing, and it is never a property of the direction a caller happened to query from.

The predicate alone does not always settle it. It did when this class was written; it does not now, and each exception was measured rather than anticipated. RelationTopicality decides first, because a predicate that does two jobs licenses on only one of them. And one predicate — RO_0001000 derives from — needs the OBJECT as well, because it carries both directions under a single subject category. See TYPED_OBJECT_REQUIRED.

  • Enum Constant Details

    • SUBJECT_IMPLIES_OBJECT

      public static final RelationInferenceDirection SUBJECT_IMPLIES_OBJECT
      The subject is the specific end: knowing the subject tells you the object. A cell line implies the disease it derives from; a compound implies the role it plays.
    • OBJECT_IMPLIES_SUBJECT

      public static final RelationInferenceDirection OBJECT_IMPLIES_SUBJECT
      The object is the specific end: knowing the object tells you the subject. A genotype implies the disease it models, because Gemma writes the disease as the subject of the statement.
    • NEITHER

      public static final RelationInferenceDirection NEITHER
      Neither end implies the other. Per-experiment parameters live here — a dose implies nothing about a disease and a disease implies no dose — as does any predicate not classified.
  • Method Details

    • values

      public static RelationInferenceDirection[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RelationInferenceDirection valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static RelationInferenceDirection of(@Nullable String predicateUri, @Nullable String subjectCategoryUri)
      Which way the implication runs for this row.

      🛑 The predicate alone is not enough, and taking it as enough is what shipped nonsense to a curator. Half these predicates do two jobs depending on what the subject is — that is the whole premise of RelationTopicality — and the two jobs do not license the same inference. TGEMO_00171 induced by on a disease is a disease model and on a cell type is a differentiation protocol; read as the former, the latter yields iPSC line has disease lower motor neuron. GENO_0000222 has_genotype on female is the same failure with a different predicate.

      So an RelationTopicality.EXPERIMENT_LEVEL row licenses nothing, whatever its predicate. That is one rule rather than a second subject-category list maintained beside the first, and it closes the same hole for every subject-dependent predicate at once instead of for the one that happened to be reported.

    • of

      public static RelationInferenceDirection of(@Nullable String predicateUri, @Nullable String subjectCategoryUri, @Nullable String subjectValueUri)
      Deprecated.
      by omission rather than by policy: a TYPED_OBJECT_REQUIRED predicate cannot be answered without the object's category and comes back NEITHER here. That fails closed, which is the right way for it to fail, but a caller holding a whole row should pass the fourth argument and get the real answer.
      Parameters:
      subjectValueUri - the subject's own URI. Needed because the claim an OBJECT_IMPLIES_SUBJECT predicate licenses is a claim ABOUT DISEASE, so it may only run where the subject is one.
    • of

      public static RelationInferenceDirection of(@Nullable String predicateUri, @Nullable String subjectCategoryUri, @Nullable String subjectValueUri, @Nullable String objectCategoryUri)
      Parameters:
      objectCategoryUri - what kind of thing the object is, where a source has said. Only a producer sets it; the curated harvest never does. See TYPED_OBJECT_REQUIRED for the predicate this decides.
    • impliesAnInducer

      public static boolean impliesAnInducer(@Nullable String predicateUri)
      Whether this predicate names an INDUCER rather than something that can bear the disease itself.

      🛑 The taxon rule — organism models the disease, human line has it — is right for a genotype and unsatisfiable for a compound. uib measured it on one subject: MPTP, alpha-synuclein inclusion body and methamphetamine were reported has role in modeling Parkinson disease and oxidopamine has disease Parkinson disease — same relation, and the only thing that differed was which taxon the attesting experiment happened to carry. A compound is never the thing that has the disease, so for these predicates the verb is settled by the predicate and taxon is not consulted.

    • licenses

      public boolean licenses(boolean seedIsSubject)
      Whether a term sitting on the given end may be used to infer the other end.
      Parameters:
      seedIsSubject - true when the caller holds the subject and wants the object