Merge branch 'develop' into features/JAL-3010ontologyFeatureSettings
[jalview.git] / src / jalview / datamodel / ontology / OntologyI.java
1 package jalview.datamodel.ontology;
2
3 import java.util.List;
4 import java.util.Set;
5
6 public interface OntologyI
7 {
8
9   /**
10    * Answers true if <code>childTerm</code> is the same as, or a sub-type
11    * (specialisation of) <code>parentTerm</code>, else false
12    * 
13    * @param childTerm
14    * @param parentTerm
15    * @return
16    */
17   boolean isA(String childTerm, String parentTerm);
18
19   /**
20    * Answers those terms in the given set which are not child terms of some
21    * other term in the set. That is, returns a set of parent terms. The input
22    * set is not modified.
23    * 
24    * @param terms
25    * @return
26    */
27   Set<String> getParentTerms(Set<String> terms);
28
29   /**
30    * Answers a (possibly empty) list of those terms in the supplied list which
31    * are a child (directly or indirectly) of <code>parent</code>. The parent
32    * term itself is not included (even if in the input list)
33    * 
34    * @param parent
35    * @param terms
36    * @return
37    */
38   List<String> getChildTerms(String parent, List<String> terms);
39
40   /**
41    * Returns a sorted list of all valid terms queried for (i.e. terms processed
42    * which were valid in the SO), using the friendly description.
43    * 
44    * This can be used to check that any hard-coded stand-in for the full SO
45    * includes all the terms needed for correct processing.
46    * 
47    * @return
48    */
49   List<String> termsFound();
50
51   /**
52    * Returns a sorted list of all invalid terms queried for (i.e. terms
53    * processed which were not found in the SO), using the friendly description.
54    * 
55    * This can be used to report any 'non-compliance' in data, and/or to report
56    * valid terms missing from any hard-coded stand-in for the full SO.
57    * 
58    * @return
59    */
60   List<String> termsNotFound();
61 }