Class AnnotationRelation
- All Implemented Interfaces:
Identifiable
subject — predicate → object, plus where
that came from.
Why this exists. Gemma holds this knowledge in four places and can query it from none of
them. A curator writes disease model: left ventricular hypertrophy — induced by — aortic
banding and it lands in getPredicate()/getObject(),
indexed per-experiment only; ask "which manipulations are asserted to induce left ventricular
hypertrophy?" and there is nothing to ask it of. CLO states which disease a cell line derives from
and OntologyTerm.getRestrictions() has always been able to
read it and is called from nowhere. MGI holds gene-level disease associations we compare against
offline and never load. And our own corpus attests pairings by co-occurrence that nobody has
written down. This table is one queryable home for all four, with
AnnotationRelationBasis recording which.
It is not a disease table. Nothing here names disease, genotype or cell line. Those are
particular (subjectCategory, predicate, objectCategory) combinations; cell line → organism
part, cell type → organism part, cell line → species and disease → taxon are the same rows with
different terms in them. Resist adding a column that only one relation kind would use.
Grain: one row per basis, and for attested bases, per attesting experiment. The same
triple legitimately appears several times — once stated by CLO, once harvested from a curator's
statement, once per experiment whose annotations co-attest it. Reads aggregate by triple and report
the set of bases, because corroboration is decided at read: a relation only
AnnotationRelationBasis.CORPUS attests is reported as uncorroborated and ranks below one
something else also states.
🛑 Support is counted at read, never stored. This is why getExpressionExperiment()
exists instead of a count column. A stored count cannot be ACL-filtered afterwards: the public-only
version understates for a curator, and the whole-corpus version leaks the existence of private
datasets through the denominator. getAclIsAuthenticatedAnonymouslyMask() is carried for the
same reason EXPRESSION_EXPERIMENT2CHARACTERISTIC carries it and is read with the same
EE2CAclQueryUtils.formNativeAclRestrictionClause.
Every row is derived, so the table is rebuilt rather than upserted — deleted by basis (or
by basis and experiment) and re-inserted. An upsert can only correct rows the new query still
produces, which is how EXPRESSION_EXPERIMENT2CHARACTERISTIC ended up with 1,008 rows a full
rebuild could not fix. Nothing here is authored, so nothing is lost by dropping it all and
recomputing.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanImportant note: Two objects with the same class and non-null ID must be considered equal.intgetBasis()getLevel()getTaxon()inthashCode()Constant, deliberately.voidsetAclIsAuthenticatedAnonymouslyMask(int aclIsAuthenticatedAnonymouslyMask) voidsetBasis(AnnotationRelationBasis basis) voidsetEvidence(String evidence) voidsetEvidenceCode(GOEvidenceCode evidenceCode) voidsetExpressionExperiment(ExpressionExperiment expressionExperiment) voidsetGeneratedAt(Date generatedAt) voidvoidsetObjectCategory(String objectCategory) voidsetObjectCategoryUri(String objectCategoryUri) voidsetObjectValue(String objectValue) voidsetObjectValueUri(String objectValueUri) voidsetPredicate(String predicate) voidsetPredicateUri(String predicateUri) voidvoidsetSourceVersion(String sourceVersion) voidsetStatus(AnnotationRelationStatus status) voidsetSubjectCategory(String subjectCategory) voidsetSubjectCategoryUri(String subjectCategoryUri) voidsetSubjectValue(String subjectValue) voidsetSubjectValueUri(String subjectValueUri) voidsetSupportingEvidence(String supportingEvidence) voidtoString()Methods inherited from class AbstractIdentifiable
getId, setId
-
Constructor Details
-
AnnotationRelation
public AnnotationRelation()
-
-
Method Details
-
getSubjectValue
-
setSubjectValue
-
getSubjectValueUri
-
setSubjectValueUri
-
getSubjectCategory
-
setSubjectCategory
-
getSubjectCategoryUri
-
setSubjectCategoryUri
-
getPredicate
-
setPredicate
-
getPredicateUri
-
setPredicateUri
-
getObjectValue
-
setObjectValue
-
getObjectValueUri
-
setObjectValueUri
-
getObjectCategory
-
setObjectCategory
-
getObjectCategoryUri
-
setObjectCategoryUri
-
getTaxon
-
setTaxon
-
getBasis
-
getStatus
-
setStatus
-
setBasis
-
getSource
-
setSource
-
getSourceVersion
-
setSourceVersion
-
getEvidenceCode
-
setEvidenceCode
-
getEvidence
-
setEvidence
-
getSupportingEvidence
-
setSupportingEvidence
-
getExpressionExperiment
-
setExpressionExperiment
-
getLevel
-
setLevel
-
getAclIsAuthenticatedAnonymouslyMask
public int getAclIsAuthenticatedAnonymouslyMask() -
setAclIsAuthenticatedAnonymouslyMask
public void setAclIsAuthenticatedAnonymouslyMask(int aclIsAuthenticatedAnonymouslyMask) -
getGeneratedAt
-
setGeneratedAt
-
hashCode
public int hashCode()Constant, deliberately.The business key here is nine nullable columns wide and is populated through setters, so a key-based hash would be wrong the moment a producer set a field after adding the instance to a set, and an id-based one is wrong by construction (the id appears on persist, moving the object to a different bucket than the one it was filed under). A constant hash degrades a single bucket to a linear scan and is never incorrect. Nothing collects these into large in-memory sets — the reads are native aggregate queries — so the cost is not observable.
- Specified by:
hashCodein classAbstractIdentifiable
-
equals
Description copied from class:AbstractIdentifiableImportant 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:
equalsin classAbstractIdentifiable
-
toString
- Overrides:
toStringin classAbstractIdentifiable
-