public void onFullNameUpdate(CvTerm cv, String oldFullName) { if (oldFullName == null){ cvChangeLogger.log(Level.INFO, "The full name has been initialised for the cv term " + cv.toString()); } else if (cv.getFullName() == null){ cvChangeLogger.log(Level.INFO, "The full name has been reset for the cv term " + cv.toString()); } else { cvChangeLogger.log(Level.INFO, "The full name "+oldFullName+" has been updated with " + cv.getFullName() + " in the cv term " + cv.toString()); } }
/** * Write full name if not null, otherwise write shortname * @param cv * @throws IOException */ protected void writeCvTermName(CvTerm cv) throws IOException { if (cv != null){ if (cv.getFullName() != null){ escapeAndWriteString(cv.getFullName()); } else{ escapeAndWriteString(cv.getShortName()); } } } }
/** * Check if the CvTerm natches the MI term and/or the name if no MI term exist * @param term : the term to check * @param mi : the mi id to compare * @param name : the name to compare * @return true if the CvTerm natches the MI term and/or the name */ public static boolean isCvTerm(CvTerm term, String mi, String name){ if (term.getMIIdentifier() != null && mi != null){ return term.getMIIdentifier().equals(mi); } else{ if (term.getShortName().equalsIgnoreCase(name) || (term.getFullName() != null && term.getFullName().equalsIgnoreCase(name))){ return true; } else { return false; } } }
protected void configure(String filePath) { /** * ensure we get the right logger */ logger = Logger.getLogger(AbstractOboLoader.class); try { parser = new OBO2FormatParser(filePath); } catch (Exception e) { logger.fatal("Parse failed: " + e.getMessage(), e); } ONTOLOGY_DEFINITION = ontologyDatabase.getShortName(); FULL_NAME = ontologyDatabase.getFullName(); SHORT_NAME = ontologyDatabase.getShortName(); }
public void writeConfidence(Confidence conf) throws IOException { if (conf != null){ // write confidence type first if (conf.getType().getFullName() != null){ escapeAndWriteString(conf.getType().getFullName()); } else{ escapeAndWriteString(conf.getType().getShortName()); } // write confidence value writer.write(MitabUtils.XREF_SEPARATOR); escapeAndWriteString(conf.getValue()); } }
writeMIOutput(sentence.getDetMethod().getMIIdentifier(), sentence.getDetMethod().getFullName() != null ? sentence.getDetMethod().getFullName() : sentence.getDetMethod().getShortName());
/*** * This method will copy properties of cv term source in cv term target and will override all the other properties of Target cv term. * @param source : the cv term source to copy from * @param target : the cv term target to copy to */ public static void copyAndOverrideCvTermProperties(CvTerm source, CvTerm target){ if (source != null && target != null){ target.setShortName(source.getShortName()); target.setFullName(source.getFullName()); // copy collections target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getXrefs().clear(); target.getXrefs().addAll(source.getXrefs()); target.getIdentifiers().clear(); target.getIdentifiers().addAll(source.getIdentifiers()); target.getSynonyms().clear(); target.getSynonyms().addAll(source.getSynonyms()); } }
if (type.getFullName() != null){ escapeAndWriteString(type.getFullName());
if (type.getFullName() != null){ escapeAndWriteString(type.getFullName());
if (type.getFullName() != null){ escapeAndWriteString(type.getFullName());
@Override public void writeConfidence(Confidence conf) throws IOException { if (conf != null){ // write confidence type first if (conf.getType().getFullName() != null){ escapeAndWriteString(conf.getType().getFullName()); } else{ escapeAndWriteString(conf.getType().getShortName()); } // write confidence value getWriter().write(MitabUtils.XREF_SEPARATOR); escapeAndWriteString(conf.getValue()); // write text if (conf instanceof MitabConfidence){ MitabConfidence mitabConf = (MitabConfidence) conf; if (mitabConf.getText() != null){ getWriter().write("("); getWriter().write(mitabConf.getText()); getWriter().write(")"); } } } }
@Override public void writeConfidence(Confidence conf) throws IOException { if (conf != null){ // write confidence type first if (conf.getType().getFullName() != null){ escapeAndWriteString(conf.getType().getFullName()); } else{ escapeAndWriteString(conf.getType().getShortName()); } // write confidence value getWriter().write(MitabUtils.XREF_SEPARATOR); escapeAndWriteString(conf.getValue()); // write text if (conf instanceof MitabConfidence){ MitabConfidence mitabConf = (MitabConfidence) conf; if (mitabConf.getText() != null){ getWriter().write("("); getWriter().write(mitabConf.getText()); getWriter().write(")"); } } } }
if (object.getFullName() != null){ MIJsonUtils.writeProperty("name", JSONValue.escape(object.getFullName()), writer);
String name = type.getFullName() != null ? type.getFullName() : type.getShortName(); try { term = fetcher.fetchByName(name, CvTerm.PSI_MI); logger.log(Level.SEVERE, "Cannot fetch the ontology information for the term " + (type.getFullName() != null ? type.getFullName() : type.getShortName()), e);