private Collection<IdentifiedObject> getChildren( OBOSession source, String miTerm ) { OBOObject parentTerm = ( OBOObject ) source.getObject( miTerm ); Collection<Link> childLinks = parentTerm.getChildren(); Collection<IdentifiedObject> children = new ArrayList<IdentifiedObject>(); for ( Link childLink : childLinks ) { OBOObject childTerm = ( OBOObject ) childLink.getChild(); children.add( childTerm ); children.addAll( getChildren( source, childTerm.getID() ) ); } return children; }
public Collection<IdentifiedObject> getRootOBOObjects( OboCategory... categories ) { ArrayList<IdentifiedObject> rootOboObjects = new ArrayList<IdentifiedObject>(); OBOObject rootObj = ( OBOObject ) oboSession.getObject( MI_ROOT_IDENTIFIER ); Collection<Link> childLinks = rootObj.getChildren(); for ( Link childLink : childLinks ) { if (MI_ROOT_IDENTIFIER.equals(childLink.getParent().getID())) { OBOObject immediateChildOfRoot = (OBOObject) childLink.getChild(); if ( checkIfCategorySubset( immediateChildOfRoot, categories ) ) { rootOboObjects.add( immediateChildOfRoot ); } } } log.debug( "oboObjects " + rootOboObjects.size() ); return rootOboObjects; }
private static void findChildren( Collection<OBOObject> children, OBOObject oboObject, boolean recursive, Set<String> processedIdSet ) { final String id = oboObject.getID(); if( processedIdSet.contains( id ) ) { return; // cuts infinite loop as the ontology can have cycles. } else { processedIdSet.add( id ); } for ( Link childLink : oboObject.getChildren() ) { OBOObject child = (OBOObject) childLink.getChild(); children.add( child ); if( recursive && !child.getChildren().isEmpty() ) { if ( log.isTraceEnabled() ) { log.trace( "Calling recursively findChildren( "+ child.getID() +" - "+ child.getName() +" ) ..." ); } findChildren( children, child, recursive, processedIdSet ); } } }
Link linkToIsA = new OBORestrictionImpl( child.getChild() ); linkToIsA.setType( OBOProperty.IS_A ); isAparent.addChild( linkToIsA );
Term childTrm = ontologyTerms.get(safeTrim(lnk.getChild().getID())); if (childTrm != null) { TermRelationshipBean trb = new TermRelationshipBean();
Term childTrm = ontologyTerms.get(safeTrim(lnk.getChild().getID())); if (childTrm != null) { TermRelationshipBean trb = new TermRelationshipBean();
Term childTrm = ontologyTerms.get(safeTrim(lnk.getChild().getID())); if (childTrm != null) { TermRelationshipBean trb = new TermRelationshipBean();
OBOObject childObj = (OBOObject) childLink1.getChild();