Interface AnnotationRelationDao
- All Superinterfaces:
BaseDao<AnnotationRelation>
- All Known Implementing Classes:
AnnotationRelationDaoImpl
AnnotationRelation.
Two read shapes, because there are two questions and conflating them is a design error:
findRelations(AnnotationRelationDao.RelationQuery)- the ranked, evidenced list. For showing a curator, and for anything that has to choose a term. Ambiguity is fatal here: SURF1 carries three germline disease axioms in MONDO, so a producer asked to emit one annotation has to pick, and picking wrong ships a wrong annotation. That is why the curation rule forbids generating the tag.findRelatedTerms(Collection, Collection, AnnotationRelationDao.Direction, Set, Collection, Long, Collection, int, int)- set membership. For query expansion, and for asking "is this proposed tag already implied by what the experiment carries?". Ambiguity is harmless here: all three of SURF1's diseases go into the set, and testing membership against the set gives the right answer whichever one is meant.
Many-to-many kills generation and is irrelevant to suppression. A caller that needs the second and reaches for the first inherits a problem it does not have.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumWhich end of the relation a caller is seeding from.static classWhat to look for.static classA relation aggregated over its attesting experiments, for one basis. -
Method Summary
Modifier and TypeMethodDescriptionfindRelatedTerms(Collection<String> seedValueUris, Collection<String> seedValues, AnnotationRelationDao.Direction direction, Set<AnnotationRelationBasis> bases, Collection<String> predicateUris, Long taxonId, Collection<Long> excludedExperimentIds, int maximumObjectBreadth, int maxResults) Set membership: every term related to any of the seeds, with no counting, no ranking and no ambiguity to resolve.The ranked, evidenced read.intremoveByBasis(AnnotationRelationBasis basis, Long experimentId) Remove every derived row for a basis, optionally for one experiment.intremoveByBasis(AnnotationRelationBasis basis, Long experimentId, String source) The same rebuild delete, narrowed to onesource.
-
Method Details
-
findRelations
List<AnnotationRelationDao.RelationSummary> findRelations(AnnotationRelationDao.RelationQuery query) The ranked, evidenced read. Empty when the query names neither end of the relation.Support is counted here, never stored, so the counts are exact for the calling user's ACL.
-
findRelatedTerms
List<String[]> findRelatedTerms(Collection<String> seedValueUris, Collection<String> seedValues, AnnotationRelationDao.Direction direction, Set<AnnotationRelationBasis> bases, Collection<String> predicateUris, @Nullable Long taxonId, Collection<Long> excludedExperimentIds, int maximumObjectBreadth, int maxResults) Set membership: every term related to any of the seeds, with no counting, no ranking and no ambiguity to resolve.This is the primitive behind query expansion and behind "is this tag already implied?". It is one indexed lookup and has to stay cheap enough to sit on an interactive path.
- Parameters:
seedValueUris- grounded seeds; may be empty ifseedValuesis notseedValues- ungrounded seeds, matched on the value string - ordinary here, since plenty of curated statement objects are free text (aortic bandinghas none)- Returns:
- the related terms, each as
[value, valueUri], the URI possibly null
-
removeByBasis
Remove every derived row for a basis, optionally for one experiment.Rebuild, not upsert - see
AnnotationRelation. An upsert can only correct rows the new query still produces, so a row whose source annotation was deleted would outlive it. -
removeByBasis
int removeByBasis(AnnotationRelationBasis basis, @Nullable Long experimentId, @Nullable String source) The same rebuild delete, narrowed to onesource.AnnotationRelationBasis.ONTOLOGYhas more than one producer — CLO states which disease a cell line came from, CHEBI which roles a chemical bears — and they are loaded and rebuilt independently. Rebuilding one with the basis-wide delete would silently drop the other's rows and leave the table looking like the other producer had never run.- Parameters:
source- the source to remove, or null for every source under the basis
-