@Override protected void createDefinitionFor(String def, CvTerm term) { term.getAnnotations().add(AnnotationUtils.createAnnotation("definition", def)); } }
/** * Process the other information in the description * @param definition * @param otherInfoString * @return true if an obsolete annotation has been added */ protected void processInfoInDescription(String definition, String otherInfoString, T ontologyTerm) { // URL if ( otherInfoString.startsWith( HTTP_DEF ) ) { ontologyTerm.getAnnotations().add(AnnotationUtils.createAnnotation(Annotation.URL, Annotation.URL_MI, otherInfoString)); } else if (otherInfoString.contains( HTTP_DEF )){ String[] defArray = otherInfoString.split( HTTP_DEF ); String def = null; if ( defArray.length == 2 ) { def = defArray[0]; ontologyTerm.getAnnotations().add(AnnotationUtils.createAnnotation(Annotation.URL, Annotation.URL_MI, HTTP_DEF + defArray[1])); } else if ( defArray.length > 2 ) { def = defArray[0]; ontologyTerm.getAnnotations().add(AnnotationUtils.createAnnotation(Annotation.URL, Annotation.URL_MI, otherInfoString.substring(def.length()))); } createDefinitionFor(otherInfoString, ontologyTerm); } // simple definition else { createDefinitionFor(otherInfoString, ontologyTerm); } }
ontologyTerm.getAnnotations().add(validation); ontologyTerm.getAnnotations().add(validation); ontologyTerm.getAnnotations().add(validation); ontologyTerm.getAnnotations().add(validation);
/*** * 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()); } }
/** * Process the annotations of a term * @param term */ protected void processAnnotations(Term term, T ontologyTerm) { Collection<uk.ac.ebi.ols.model.interfaces.Annotation> annotations = term.getAnnotations(); if (annotations != null){ for (uk.ac.ebi.ols.model.interfaces.Annotation annot : annotations){ // only one comment with type null if (annot.getAnnotationType() != null && COMMENT_KEY.equals(annot.getAnnotationType())){ ontologyTerm.getAnnotations().add(AnnotationUtils.createComment(annot.getAnnotationStringValue())); } } } }
getDatabase().getAnnotations(), Annotation.SEARCH_URL_MI, Annotation.SEARCH_URL); if (searchUrlAnnot != null){ searchUrl = searchUrlAnnot.getValue();
ontologyTerm.getAnnotations().add(AnnotationUtils.createAnnotation(Annotation.URL, Annotation.URL_MI, accession));