Interface AnnotationRelationDao

All Superinterfaces:
BaseDao<AnnotationRelation>
All Known Implementing Classes:
AnnotationRelationDaoImpl

public interface AnnotationRelationDao extends BaseDao<AnnotationRelation>
Reads over AnnotationRelation.

Two read shapes, because there are two questions and conflating them is a design error:

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.

  • Method Details

    • findRelations

      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 if seedValues is not
      seedValues - ungrounded seeds, matched on the value string - ordinary here, since plenty of curated statement objects are free text (aortic banding has none)
      Returns:
      the related terms, each as [value, valueUri], the URI possibly null
    • removeByBasis

      int removeByBasis(AnnotationRelationBasis basis, @Nullable Long experimentId)
      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 one source.

      AnnotationRelationBasis.ONTOLOGY has 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