public void onDefinitionUpdate(OntologyTerm cv, String oldDef) { if (oldDef == null){ ontologyTermChangeLogger.log(Level.INFO, "The definition " + cv.getDefinition() + " has been added to the ontology term " + cv.toString()); } else if (cv.getDefinition() == null){ ontologyTermChangeLogger.log(Level.INFO, "The definition "+ oldDef+ " has been removed from the ontology term " + cv.toString()); } else { ontologyTermChangeLogger.log(Level.INFO, "The definition "+oldDef+" has been updated with " + cv.getDefinition() + " in the ontology term " + cv.toString()); } } }
@Override protected void createDefinitionFor(String def, OntologyTerm term) { if (term.getDefinition() != null){ term.setDefinition(term.getDefinition() + LINE_BREAK + def); } else{ term.setDefinition(def); } }
if (ontologyTerm.getDefinition() == null){ ontologyTerm.setDefinition(otherInfoString); ontologyTerm.setDefinition(ontologyTerm.getDefinition() + LINE_BREAK + def); ontologyTerm.setDefinition(ontologyTerm.getDefinition() + LINE_BREAK + otherInfoString);
/** * This method will copy basic properties and parent/children from a ontology term source to a ontology term target * @param source : the cv term source to copy from * @param target : the cv term target to copy to */ public static void copyAndOverrideOntologyTermProperties(OntologyTerm source, OntologyTerm target){ if (source != null && target != null){ copyAndOverrideCvTermProperties(source, target); target.getParents().clear(); target.getParents().addAll(source.getParents()); target.getChildren().clear(); target.getChildren().addAll(source.getChildren()); target.setDefinition(source.getDefinition()); } }