public static SimpleOBOTree parse(String name, InputStream in) throws IOException {

        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String line = null;
        SimpleOBOEntry currentEntry = null;
        String currentChildTerm = null;
        SimpleOBOTree simpleOboTree = new SimpleOBOTree();

        while ((line = reader.readLine()) != null) {
            line = line.trim();

            if (line.length() == 0) {
                if (currentEntry != null) {
                    simpleOboTree.addEntry(currentEntry); //if it's not null, add a new entry
                    currentEntry = null;
                }
                continue;
            } else if (line.startsWith("[Term]")) {
                currentEntry = new SimpleOBOEntry();
                //
            } else if (currentEntry != null) {

                if (line.startsWith("id:")) {
                    //the current entry must not be null
                    //try{
                    currentChildTerm = line.substring(4);
                    currentEntry.setID(currentChildTerm);
                    //}
                    //catch(Exception e){
                    //    System.out.println(line);
                    //}
                    continue;
                } else if (line.startsWith("name:")) {
                    //the current entry must not be null
                    currentEntry.setName(line.substring(6));
                    continue;
                } else if (line.startsWith("namespace:")) {
                    //the current entry must not be null
                    currentEntry.setNamespace(line.substring(11));
                    continue;
                } else if (line.startsWith("is_a:")) {
                    //the current entry must not be null
                    line = line.substring(6);
                    line = line.substring(0, line.indexOf(" "));
                    simpleOboTree.addTreeBranch(line, currentChildTerm);
                    currentEntry.addParent(line);
                    continue;
                } else {
                    //add attributes

                    //System.out.println(line);

                    String ele[] = line.split(": ", 2); //why limit is 2?
                    currentEntry.addAttribute(ele[0], ele[1]);


                }
            }
        }

        return simpleOboTree;
    }