private void addSubtree(Set<String> nodes, ConcRel cr) { if (!nodes.contains(cr.getConceptID())) { nodes.add(cr.getConceptID()); for (ConcRel crc : cr.getChildren()) { addSubtree(nodes, crc); } } }
private Set<String> exportEdges( ConceptGraph cg, Set<String> nodesToInclude, Set<String> leaves, int leafChildrenDepth, BufferedWriter network) throws IOException { Set<String> exportedNodes = new HashSet<String>(); for (String conceptID : nodesToInclude) { ConcRel cr = cg.getConceptMap().get(conceptID); exportedNodes.add(cr.getConceptID()); for (ConcRel crc : cr.getChildren()) { network.write(crc.getConceptID()); network.write("\tisa\t"); network.write(cr.getConceptID()); network.write("\n"); exportedNodes.add(crc.getConceptID()); } } return exportedNodes; }