createSynonym(feature, "identifier", redflyID); createSynonym(feature, "name", name);
addItem(createSynonym(feature, "name", name));
    public void process(GFF3Record record) {        Item feature = getFeature();        feature.setClassName(tgtNs + "RedFlyRegulatoryRegion");        String name = record.getId();        feature.addAttribute(new Attribute("curated", "true"));        if (record.getAttributes().containsKey("Evidence")) {            List evidenceList = (List) record.getAttributes().get("Evidence");            String elementEvidence = (String) evidenceList.get(0);            feature.addAttribute(new Attribute("elementEvidence", elementEvidence));        }        List ontologyTermIds = (List) record.getAttributes().get("Ontology_term");        if (ontologyTermIds != null) {            Iterator ontologyTermIdsIter = ontologyTermIds.iterator();            List phenotypeItems = new ArrayList();            while (ontologyTermIdsIter.hasNext()) {                String ontologyTermId = (String) ontologyTermIdsIter.next();                phenotypeItems.add(getPhenotype(ontologyTermId).getIdentifier());            }            feature.setCollection("phenotypes", phenotypeItems);        }        String geneName = null;        String pubmedId = null;        String redflyID = null;        List dbxrefs = record.getDbxrefs();        if (dbxrefs != null) {            Iterator dbxrefsIter = dbxrefs.iterator();            while (dbxrefsIter.hasNext()) {                String dbxref = (String) dbxrefsIter.next();                int colonIndex = dbxref.indexOf(":");                if (colonIndex == -1) {                    throw new RuntimeException("external reference not understood: " + dbxref);                }                if (dbxref.startsWith("Flybase:")) {                    geneName = dbxref.substring(colonIndex + 1);                } else {                    if (dbxref.startsWith("PMID:")) {                        pubmedId = dbxref.substring(colonIndex + 1);                    } else {                        if (dbxref.startsWith(REDFLY_PREFIX)) {                            redflyID = dbxref.substring(colonIndex + 1);                        } else {                            throw new RuntimeException("unknown external reference type: "                                                       + dbxref);                        }                    }                }            }        }        if (geneName == null) {            throw new RuntimeException("gene name not found when processing " + name                                       + " found these dbxrefs: " + dbxrefs);        }        if (pubmedId == null) {            throw new RuntimeException("pubmed ID not found when processing " + name                                       + " found these dbxrefs: " + dbxrefs);        }        if (redflyID == null) {            throw new RuntimeException("REDfly ID not found when processing " + name                                       + " found these dbxrefs: " + dbxrefs);        }        feature.setReference("gene", getGene(geneName));        addEvidence(getPublication(pubmedId));        createSynonym(feature, "identifier", redflyID);        createSynonym(feature, "name", name);        feature.setAttribute("identifier", REDFLY_PREFIX + redflyID);        feature.setAttribute("name", name);    }