Retrieve all descendant ontology terms

@return a list of {@link OntologyTerm}
359412
public List<OntologyTerm> getChildren(OntologyTerm ontologyTerm) {
    Iterable<org.molgenis.ontology.core.meta.OntologyTerm> ontologyTermEntities =
        () ->
            dataService
                .query(ONTOLOGY_TERM, org.molgenis.ontology.core.meta.OntologyTerm.class)
                .eq(ONTOLOGY_TERM_IRI, ontologyTerm.getIRI())
                .findAll()
                .iterator();

    List<OntologyTerm> children = new ArrayList<>();
    for (Entity ontologyTermEntity : ontologyTermEntities) {
      Entity ontologyEntity = ontologyTermEntity.getEntity(OntologyTermMetadata.ONTOLOGY);
      ontologyTermEntity
          .getEntities(OntologyTermMetadata.ONTOLOGY_TERM_NODE_PATH)
          .forEach(
              ontologyTermNodePathEntity ->
                  children.addAll(
                      getChildOntologyTermsByNodePath(ontologyEntity, ontologyTermNodePathEntity)));
    }
    return children;
  }
848650
public final ImmutableList<TaxonomyTerm> tags() {
      ImmutableList<TaxonomyTerm> tags = taxonomyTerms.get(TAG_TAXONOMY);
      return tags != null ? tags : ImmutableList.of();
   }
307153
public List<String> toList() {
        List<String> list = new LinkedList<String>();
        if (authority != null) {
            list.add(authority);
        }
        for (Term t : terms) {
            list.add(t.toString());
        }
        return list;
    }
866875
public final ImmutableList<TaxonomyTerm> terms(final String taxonomy) {
      ImmutableList<TaxonomyTerm> terms = taxonomyTerms.get(taxonomy);
      return terms != null ? terms : ImmutableList.of();
   }
536607
public List<MethodType<BeanType<T>>> getAllMethod()
   {
      List<MethodType<BeanType<T>>> list = new ArrayList<MethodType<BeanType<T>>>();
      List<Node> nodeList = childNode.get("method");
      for(Node node: nodeList)
      {
         MethodType<BeanType<T>>  type = new MethodTypeImpl<BeanType<T>>(this, "method", childNode, node);
         list.add(type);
      }
      return list;
   }
1065724
public final ImmutableList<TaxonomyTerm> categories() {
      ImmutableList<TaxonomyTerm> categories = taxonomyTerms.get(CATEGORY_TAXONOMY);
      return categories != null ? categories : ImmutableList.of();
   }
1230299
public ArrayList<MtasTreeHit<String>> getTerms(ArrayList<MtasTreeHit<?>> refs)
      throws IOException {
    try {
      ArrayList<MtasTreeHit<String>> terms = new ArrayList<MtasTreeHit<String>>();
      IndexInput inTerm = indexInputList.get("term");
      for (MtasTreeHit<?> hit : refs) {
        inTerm.seek(hit.ref);
        String term = inTerm.readString();
        MtasTreeHit<String> newHit = new MtasTreeHit<String>(hit.startPosition,
            hit.endPosition, hit.ref, hit.additionalId, hit.additionalRef,
            term);
        terms.add(newHit);
      }
      return terms;
    } catch (Exception e) {
      throw new IOException(e);
    }
  }
156892
public List<String> getAllDescription()
   {
      List<String> result = new ArrayList<String>();
      List<Node> nodes = childNode.get("description");
      for (Node node : nodes)
      {
         result.add(node.getText());
      }
      return result;
   }
971214
public final List<T> getAncestors() {
      List<T> path = new ArrayList<>();
      HierarchicalEnumValue<T> hev = Cast.as(this);
      do {
         hev = Cast.as(hev.getParent());
         if (hev != null && hev != getSingleRoot()) {
            path.add(Cast.as(hev));
         }
      } while (hev != null && hev != getSingleRoot());
      return path;
   }
209028
public List<GetterType<BeanType<T>>> getAllGetter()
   {
      List<GetterType<BeanType<T>>> list = new ArrayList<GetterType<BeanType<T>>>();
      List<Node> nodeList = childNode.get("getter");
      for(Node node: nodeList)
      {
         GetterType<BeanType<T>>  type = new GetterTypeImpl<BeanType<T>>(this, "getter", childNode, node);
         list.add(type);
      }
      return list;
   }
285575
protected static List<SpecNode> getAllSpecNodes(final Level level) {
        final List<SpecNode> specNodes = new ArrayList<SpecNode>();

        for (final Node childNode : level.getChildNodes()) {
            if (childNode instanceof SpecNode) {
                specNodes.add((SpecNode) childNode);
            }

            if (childNode instanceof Level) {
                specNodes.addAll(getAllSpecNodes((Level) childNode));
            }
        }

        return specNodes;
    }
971665
public static List<Object> getAllNodes(TreeModel treeModel)
    {
        List<Object> result = new ArrayList<Object>();
        getAllDescendants(treeModel, treeModel.getRoot(), result);
        result.add(0, treeModel.getRoot());
        return result;
    }
374741
public List<Index<SecondaryTable<T>>> getAllIndex()
   {
      List<Index<SecondaryTable<T>>> list = new ArrayList<Index<SecondaryTable<T>>>();
      List<Node> nodeList = childNode.get("index");
      for(Node node: nodeList)
      {
         Index<SecondaryTable<T>>  type = new IndexImpl<SecondaryTable<T>>(this, "index", childNode, node);
         list.add(type);
      }
      return list;
   }
127121
public ClassInfoList getClassInfoRecursive() {
        final Set<ClassInfo> reachableClassInfo = new HashSet<>();
        obtainClassInfoRecursive(reachableClassInfo);
        return new ClassInfoList(reachableClassInfo, /* sortByName = */ true);
    }
658578
def termset_ancestors(self, terms):
        
        ancs = set()
        for term in terms:
            ancs = ancs.union(self.ontology.ancestors(term))
        return ancs.union(set(terms))
201327
@Override
	public Set<T> getAllChildNodes() {

		Set<T> allChildNodes = new HashSet();

		List<T> childNodes = treeGetChildren();

		for (final T child : childNodes) {

			allChildNodes.add(child);

			if (child instanceof LinkedTreeNode) {

				final LinkedTreeNode treeNode = (LinkedTreeNode)child;
				allChildNodes.addAll(treeNode.getAllChildNodes());
			}
		}

		return allChildNodes;
	}
1368211
public List<NamedQuery<OrmDescriptor>> getAllNamedQuery()
   {
      List<NamedQuery<OrmDescriptor>> list = new ArrayList<NamedQuery<OrmDescriptor>>();
      List<Node> nodeList = model.get("named-query");
      for(Node node: nodeList)
      {
         NamedQuery<OrmDescriptor>  type = new NamedQueryImpl<OrmDescriptor>(this, "named-query", model, node);
         list.add(type);
      }
      return list;
   }