@Override protected void createDefinitionFor(String def, OntologyTerm term) { if (term.getDefinition() != null){ term.setDefinition(term.getDefinition() + LINE_BREAK + def); } else{ term.setDefinition(def); } }
/** * Process the definition String * @param definition * @return */ protected void processDefinition(String definition, OntologyTerm ontologyTerm) { if ( definition.contains( LINE_BREAK ) ) { String[] defArray = definition.split( LINE_BREAK ); String otherInfoString = null; if ( defArray.length == 2 ) { ontologyTerm.setDefinition(defArray[0]); otherInfoString = defArray[1]; processInfoInDescription(definition, otherInfoString, ontologyTerm); } else if ( defArray.length > 2 ) { ontologyTerm.setDefinition(defArray[0]); for (int i = 1; i < defArray.length; i++){ otherInfoString = defArray[i]; processInfoInDescription(definition, otherInfoString, ontologyTerm); } } } else { processInfoInDescription(definition, definition, ontologyTerm); } }
ontologyTerm.setDefinition(otherInfoString); ontologyTerm.setDefinition(ontologyTerm.getDefinition() + LINE_BREAK + def); ontologyTerm.setDefinition(otherInfoString); 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()); } }