Enum Class RelationInferenceDirection
- All Implemented Interfaces:
Serializable, Comparable<RelationInferenceDirection>, Constable
🛑 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionNeither end implies the other.The object is the specific end: knowing the object tells you the subject.The subject is the specific end: knowing the subject tells you the object. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanimpliesAnInducer(String predicateUri) Whether this predicate names an INDUCER rather than something that can bear the disease itself.booleanlicenses(boolean seedIsSubject) Whether a term sitting on the given end may be used to infer the other end.static RelationInferenceDirectionWhich way the implication runs for this row.static RelationInferenceDirectionDeprecated.static RelationInferenceDirectionof(String predicateUri, String subjectCategoryUri, String subjectValueUri, String objectCategoryUri) static RelationInferenceDirectionReturns the enum constant of this class with the specified name.static RelationInferenceDirection[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
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
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
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
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 nameNullPointerException- 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 byon 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_genotypeonfemaleis the same failure with a different predicate.So an
RelationTopicality.EXPERIMENT_LEVELrow 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: aTYPED_OBJECT_REQUIREDpredicate cannot be answered without the object's category and comes backNEITHERhere. 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 anOBJECT_IMPLIES_SUBJECTpredicate 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. SeeTYPED_OBJECT_REQUIREDfor the predicate this decides.
-
impliesAnInducer
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 bodyandmethamphetaminewere reported has role in modeling Parkinson disease andoxidopaminehas 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
-
TYPED_OBJECT_REQUIREDpredicate cannot be answered without the object's category and comes backNEITHERhere.