@Override public String toString() { return "Alias[name: " + name + ", type: " + ( cvAliasType != null ? cvAliasType.getShortLabel() : "" ) + "]"; }
@Override public String toString() { return "Alias[name: " + name + ", type: " + ( cvAliasType != null ? cvAliasType.getShortLabel() : "" ) + "]"; }
@Override public String toString() { return "Alias[name: " + name + ", type: " + ( cvAliasType != null ? cvAliasType.getShortLabel() : "" ) + "]"; }
private void writeAliases(StringBuffer alias, Collection<CvObjectAlias> aliases) { int index = 0; int size = aliases.size(); if (aliases.isEmpty()){ alias.append(EMPTY_VALUE); } else { for (CvObjectAlias ref : aliases){ alias.append(ref.getCvAliasType().getShortLabel()); alias.append(":"); alias.append(ref.getName()); if (index < size - 1){ alias.append(", "); } index ++; } } }
@Override public void visitAlias( Alias alias ) { final CvAliasType type = alias.getCvAliasType(); if( type != null ) { final String mi = type.getIdentifier(); if ( mi != null ) { final String key = createCvKey( type.getClass(), mi ); final CvAliasType oboTerm = ( CvAliasType ) mi2cv.get( key ); if ( oboTerm == null ) { log.warn( "Could not find alias " + type.getClass().getSimpleName() + "( " + type.getShortLabel() + " ) by MI: " + mi ); } else { alias.setCvAliasType( oboTerm ); } } } }
public static Collection<Alias> getAliasByType(AnnotatedObject<?, ?> annotatedObject, String miOrLabel) { Collection<Alias> matchingAliases = new ArrayList<Alias>(); for (Alias alias : annotatedObject.getAliases()) { if (alias.getCvAliasType() != null && ( alias.getCvAliasType().getIdentifier().equals(miOrLabel) || alias.getCvAliasType().getShortLabel().equals(miOrLabel)) ) { matchingAliases.add(alias); } } return matchingAliases; }
public static Collection<Alias> getAliasByType(AnnotatedObject<?, ?> annotatedObject, String miOrLabel) { Collection<Alias> matchingAliases = new ArrayList<Alias>(); for (Alias alias : annotatedObject.getAliases()) { if (alias.getCvAliasType() != null && ( alias.getCvAliasType().getIdentifier().equals(miOrLabel) || alias.getCvAliasType().getShortLabel().equals(miOrLabel)) ) { matchingAliases.add(alias); } } return matchingAliases; }
private static SearchItem searchItemForAlias( Alias alias ) { return new SearchItem( alias.getParentAc(), alias.getName(), alias.getParent().getClass().getName(), alias.getCvAliasType().getShortLabel() ); }
private static List<SearchItem> searchItemsForAnnotatedObject( AnnotatedObject<? extends Xref, ? extends Alias> ao, boolean includeAliases ) { List<SearchItem> searchItems = new ArrayList<SearchItem>(); searchItems.add( new SearchItem( ao.getAc(), ao.getAc(), ao.getClass().getName(), "ac" ) ); searchItems.add( new SearchItem( ao.getAc(), ao.getShortLabel(), ao.getClass().getName(), "shortlabel" ) ); if ( ao.getFullName() != null ) { searchItems.add( new SearchItem( ao.getAc(), ao.getFullName(), ao.getClass().getName(), "fullname" ) ); } if ( includeAliases ) { for ( Alias alias : ao.getAliases() ) { if ( alias.getCvAliasType() != null ) { searchItems.add( new SearchItem( ao.getAc(), alias.getName(), ao.getClass().getName(), alias.getCvAliasType().getShortLabel() ) ); } else { log.warn( "Couldn't insert SearchItem for Alias, as it cvAliasType is null: " + alias.getName() ); } } } return searchItems; }
public psidev.psi.mi.xml.model.Alias intactToPsi(Alias intactObject) { intactStartConversation(intactObject); String name = intactObject.getName(); psidev.psi.mi.xml.model.Alias psiAlias = new psidev.psi.mi.xml.model.Alias(name); CvAliasType cvAliasType = intactObject.getCvAliasType(); if (cvAliasType != null) { String aliasType = cvAliasType.getShortLabel(); if (cvAliasType.getIdentifier() != null) { String upperId = cvAliasType.getIdentifier().toUpperCase(); Matcher typeMatcher = CvObjectConverter.MI_REGEXP.matcher(upperId); if (typeMatcher.find() && typeMatcher.group().equalsIgnoreCase(upperId)){ psiAlias.setTypeAc(cvAliasType.getIdentifier()); } } psiAlias.setType(aliasType); } intactEndConversion(intactObject); return psiAlias; }
aliasElement.setAttribute( TYPE_ATTRIBUTE_NAME, aliasType.getShortLabel() );
aliasElement.setAttribute( TYPE_ATTRIBUTE_NAME, aliasType.getShortLabel() );
aliasElement.setAttribute( TYPE_ATTRIBUTE_NAME, aliasType.getShortLabel() );
for ( Alias alias : interactor.getAliases() ) { String aliasName = escapeXml( alias.getName() ); writeField( out, alias.getCvAliasType().getShortLabel(), aliasName, iii );
for ( Alias alias : interaction.getAliases() ) { String aliasName = escapeXml( alias.getName() ); writeField( out, alias.getCvAliasType().getShortLabel(), aliasName, iii );
for ( Alias alias : experiment.getAliases() ) { String aliasName = escapeXml( alias.getName() ); writeField( out, alias.getCvAliasType().getShortLabel(), aliasName, iii );
protected void indexInteractorNames(Interactor interactor, SolrInputDocument solrDocument){ // shortname solrDocument.addField ( ComplexFieldNames.INTERACTOR_ALIAS, interactor.getShortLabel ( ) ) ; // fullname if (interactor.getFullName() != null){ solrDocument.addField ( ComplexFieldNames.INTERACTOR_ALIAS, interactor.getFullName ( ) ) ; } // aliases for ( Alias alias : interactor.getAliases ( ) ) { if (alias.getName() != null){ if (alias.getCvAliasType() != null){ CvAliasType type = alias.getCvAliasType(); solrDocument.addField ( ComplexFieldNames.INTERACTOR_ALIAS, type.getShortLabel() ) ; solrDocument.addField ( ComplexFieldNames.INTERACTOR_ALIAS, alias.getName() ) ; solrDocument.addField ( ComplexFieldNames.INTERACTOR_ALIAS, type.getShortLabel()+":"+alias.getName()) ; } else{ solrDocument.addField ( ComplexFieldNames.INTERACTOR_ALIAS, alias.getName()); } } } }
if (intactAlias.getCvAliasType() != null && intactAlias.getCvAliasType().getShortLabel() != null){ String type = intactAlias.getCvAliasType().getShortLabel(); String typeMI = intactAlias.getCvAliasType().getIdentifier();
CvAliasType aliasType = alias.getCvAliasType(); if (aliasType != null) { if (log.isDebugEnabled()) log.debug("\tSaving aliasType: "+aliasType.getShortLabel()); try { CvObjectPersister.getInstance().saveOrUpdate(aliasType);