Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added the links (skos:exactMatch) into the ChEBI ontology
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php header('Content-type: text/n3'); | ||
|
||
include 'vars.php'; | ||
include 'namespaces.php'; | ||
include 'functions.php'; | ||
|
||
mysql_connect("localhost", $user, $pwd) or die(mysql_error()); | ||
# echo "<!-- Connection to the server was successful! -->\n"; | ||
|
||
mysql_select_db($db) or die(mysql_error()); | ||
# echo "<!-- Database was selected! -->\n"; | ||
|
||
$allIDs = mysql_query( | ||
"SELECT DISTINCT molregno FROM compound_records " . $limit | ||
); | ||
|
||
$num = mysql_numrows($allIDs); | ||
|
||
while ($row = mysql_fetch_assoc($allIDs)) { | ||
$molregno = $row['molregno']; | ||
$molecule = $MOL . "m" . $molregno; | ||
|
||
# get the compound type, ChEBI, and ChEMBL identifiers | ||
$chebi = mysql_query("SELECT DISTINCT chebi_par_id FROM molecule_dictionary WHERE molregno = $molregno"); | ||
if ($chebiRow = mysql_fetch_assoc($chebi)) { | ||
$chebiid = $chebiRow['chebi_par_id']; | ||
if ($chebiid) { | ||
echo triple( $molecule, $SKOS . "exactMatch", "http://purl.obolibrary.org/obo/CHEBI_" . $chebiid ); | ||
} | ||
} | ||
|
||
} | ||
|
||
?> |