コード例 #1
0
	public function initialize() {
		$this->bootstrapConceptIds();
		
		// Add concepts to classes
		addDefinedMeaningToCollectionIfNotPresent( $this->proteinConceptId, $this->classCollectionId, "amino acid, peptide, or protein" );
		addDefinedMeaningToCollectionIfNotPresent( $this->geneConceptId, $this->classCollectionId, "gene or genome" );
		addDefinedMeaningToCollectionIfNotPresent( $this->organismConceptId, $this->classCollectionId, "organism" );
		addDefinedMeaningToCollectionIfNotPresent( $this->functionalDomainConceptId, $this->classCollectionId, "functional domain" );
		addDefinedMeaningToCollectionIfNotPresent( $this->organismSpecificProteinConceptId, $this->classCollectionId, "organism specific protein" );
		addDefinedMeaningToCollectionIfNotPresent( $this->organismSpecificGeneConceptId, $this->classCollectionId, "organism specific gene" );
		addDefinedMeaningToCollectionIfNotPresent( $this->enzymeCommissionNumberConceptId, $this->classCollectionId, "enzyme commission number" );
		
		// Add concepts to relation types
		addDefinedMeaningToCollectionIfNotPresent( $this->geneConceptId, $this->relationTypeCollectionId, "gene or genome" );
		addDefinedMeaningToCollectionIfNotPresent( $this->isManifestationOfConceptId, $this->relationTypeCollectionId, "is manifestation of" );
		addDefinedMeaningToCollectionIfNotPresent( $this->occursInConceptId, $this->relationTypeCollectionId, "occurs in" );
		addDefinedMeaningToCollectionIfNotPresent( $this->activityConceptId, $this->relationTypeCollectionId, "performs" );
		addDefinedMeaningToCollectionIfNotPresent( $this->biologicalProcessConceptId, $this->relationTypeCollectionId, "biological process" );
		addDefinedMeaningToCollectionIfNotPresent( $this->molecularFunctionConceptId, $this->relationTypeCollectionId, "molecular function" );
		addDefinedMeaningToCollectionIfNotPresent( $this->cellularComponentConceptId, $this->relationTypeCollectionId, "cellular component" );
//		addDefinedMeaningToCollectionIfNotPresent($this->keywordConceptId, $this->relationTypeCollectionId, "keyword");
		addDefinedMeaningToCollectionIfNotPresent( $this->consistsOfId, $this->relationTypeCollectionId, "consists of" );
		addDefinedMeaningToCollectionIfNotPresent( $this->containsConceptId, $this->relationTypeCollectionId, "contains" );
		addDefinedMeaningToCollectionIfNotPresent( $this->conceptualPartOfId, $this->relationTypeCollectionId, "conceptual part of" );
	}
コード例 #2
0
	public function add( IdStack $idPath, $record ) {
		$definedMeaningId = $idPath->getKeyStack()->peek( 0 )->definedMeaningId;
		$collectionMeaningId = $record->collectionMeaning;
		$internalId = $record->sourceIdentifier;
		
		if ( $collectionMeaningId != 0 ) {
			addDefinedMeaningToCollectionIfNotPresent( $definedMeaningId, $collectionMeaningId, $internalId );
		}
	}
コード例 #3
0
function importUMLSTerms( $sab, $umlsCollectionId, $sourceCollectionId, $languageId, $isoLanguages ) {
	global
		$db;

	$queryResult = mysql_query( "select str, cui, lat, code from MRCONSO where sab like '$sab'", $db );
	
	$progressBar = new ProgressBar( mysql_num_rows( $queryResult ), 100 );

	$collectionMeaningId = getCollectionMeaningId( $sourceCollectionId );

	while ( $umlsTerm = mysql_fetch_object( $queryResult ) ) {
		$definedMeaningId = getDefinedMeaningFromCollection( $umlsCollectionId, $umlsTerm->cui );
		$string = str_replace( '_', ' ', substr( trim( $umlsTerm->str ), 0, 240 ) );
		$expression = findOrCreateExpression( $string, $isoLanguages[strtolower( $umlsTerm->lat )] );
		
		if ( !$definedMeaningId ) {
			$definedMeaningId = addDefinedMeaning( $expression->id );
			addDefinedMeaningToCollection( $definedMeaningId, $umlsCollectionId, $umlsTerm->cui );
		}

		$expression->assureIsBoundToDefinedMeaning( $definedMeaningId, true );
		addDefinedMeaningToCollectionIfNotPresent( $definedMeaningId, $sourceCollectionId, $umlsTerm->code );
		$progressBar->advance( 1 );
	}
	
	mysql_free_result( $queryResult );
	$progressBar->clear();
}