예제 #1
0
 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);
     }
   }
 }
예제 #2
0
 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;
 }