private void addChild(OBOClass parent, OBOClass child) { Link linkToIsA = new OBORestrictionImpl(child); linkToIsA.setType( OBOProperty.IS_A ); parent.addChild( linkToIsA ); }
private OBOClass getRootObject() { if (rootObj != null) { return rootObj; } /* [Term] id: MI:0000 name: molecular interaction def: "Controlled vocabularies originally created for protein protein interactions, extended to other molecules interactions." [PMID:14755292] subset: Drugable subset: PSI-MI slim synonym: "mi" EXACT PSI-MI-short [] */ rootObj = new OBOClassImpl( "molecular interaction", "MI:0000" ); rootObj.setDefinition( "Controlled vocabularies originally created for protein protein interactions, extended to other molecules interactions." ); //[PMID:14755292]" Dbxref dbxref = new DbxrefImpl( "PMID", "14755292" ); dbxref.setType( Dbxref.DEFINITION ); rootObj.addDefDbxref( dbxref ); addPsimiShortSyn(rootObj, "mi"); return rootObj; }//end of method
dbxref.setType( Dbxref.DEFINITION ); oboObj.addDefDbxref( dbxref ); oboObj.setNamespace(new Namespace(currentOntologyConfig.getDefaultNamespace())); oboObj.addSynonym( syn ); } else if ( cvTopic.getShortLabel().equalsIgnoreCase( CvTopic.SEARCH_URL ) ) { String annotationText = "\""+annotation.getAnnotationText()+"\""; oboObj.addPropertyValue(new PropertyValueImpl("xref", CvTopic.SEARCH_URL+": "+annotationText)); } else if ( cvTopic.getShortLabel().equalsIgnoreCase( CvTopic.XREF_VALIDATION_REGEXP ) ) { String annotationText = "\\\""+annotation.getAnnotationText()+"\\\""; oboObj.addPropertyValue(new PropertyValueImpl("xref", CvTopic.XREF_VALIDATION_REGEXP+":"+annotationText)); } else if ( cvTopic.getShortLabel().equalsIgnoreCase( CvTopic.COMMENT ) && annotation.getAnnotationText() != null ) { oboObj.setComment( removeLineReturns(annotation.getAnnotationText() )); } else if ( cvTopic.getShortLabel().equalsIgnoreCase( CvTopic.OBSOLETE ) ) { oboObj.setObsolete( true ); definitionSuffix = "\n" + annotation.getAnnotationText(); oboObj.setDefinition( definitionPrefix + definitionSuffix ); oboObj.addSynonym( altSyn );
public OBOClass getOBOCellType() { if (cellTypeObj != null) { return cellTypeObj; } cellTypeObj = new OBOClassImpl("cell type", "IAX:0002"); cellTypeObj.setDefinition("IntAct cell type base object"); addLinkToRootFor(cellTypeObj); oboSession.addObject(cellTypeObj); return cellTypeObj; }
private void addPsimiShortSyn(OBOClass oboObj, String synonym) { Synonym syn = new SynonymImpl(); syn.setText( synonym ); SynonymType synCat = new SynonymTypeImpl(); synCat.setID(synonym); syn.setSynonymType( synCat ); syn.setScope( 1 ); oboObj.addSynonym( syn ); }
public OBOClass getOBOTissue() { if (tissueObj != null) { return tissueObj; } tissueObj = new OBOClassImpl("tissue", "IAX:0001"); tissueObj.setDefinition("IntAct tissue base object"); addLinkToRootFor(tissueObj); oboSession.addObject(tissueObj); return tissueObj; }
private void addLinkToRootFor(OBOClass oboObj) { OBOClass rootObject = getRootObject(); Link linkToRoot = new OBORestrictionImpl( oboObj ); OBOProperty oboProp = new OBOPropertyImpl( "part_of" ); linkToRoot.setType( oboProp ); rootObject.addChild( linkToRoot ); }