Skip to content

Commit

Permalink
Use a variable root URI and spit turtle (= should be owl:sameAs)
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Aug 14, 2011
1 parent 1bd5e05 commit 32275b2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
5 changes: 4 additions & 1 deletion README.markdown
Expand Up @@ -55,7 +55,10 @@ The scripts expect a script only readble by the server software called vars.php,

<?php

$db = 'chembl_09';
$version = '09';
$rooturi = 'http://data.kasabi.com/dataset/chembl-rdf/' . $version . '/';

$db = 'chembl_' . $version;
$user = 'user';
$pwd = 'secret';

Expand Down
18 changes: 10 additions & 8 deletions compounds.php
Expand Up @@ -12,16 +12,18 @@
@prefix nmr: <http://www.nmrshiftdb.org/onto#> .
@prefix cheminf: <http://semanticscience.org/resource/> .

@prefix : <http://pele.farmbio.uu.se/chembl/onto/#> .
@prefix act: <http://rdf.farmbio.uu.se/chembl/activitiy/> .
@prefix res: <http://rdf.farmbio.uu.se/chembl/resource/> .
@prefix mol: <http://rdf.farmbio.uu.se/chembl/molecule/> .
@prefix ass: <http://rdf.farmbio.uu.se/chembl/assay/> .

<?php

include 'vars.php';

echo "@prefix : <http://rdf.farmbio.uu.se/chembl/onto/#> .\n";
echo "@prefix act: <" . $rooturi . "activitiy/> .\n";
echo "@prefix res: <" . $rooturi . "resource/> .\n";
echo "@prefix mol: <" . $rooturi . "molecule/> .\n";
echo "@prefix ass: <" . $rooturi . "assay/> .\n";
echo "@prefix jrn: <" . $rooturi . "journal/> .\n";
echo "\n";

mysql_connect("localhost", $user, $pwd) or die(mysql_error());
# echo "<!-- Connection to the server was successful! -->\n";

Expand Down Expand Up @@ -87,7 +89,7 @@
echo " chem:inchi \"" . $struct['standard_inchi'] . "\" ;\n";
echo " cheminf:CHEMINF_000200 [ a cheminf:CHEMINF_000113 ; cheminf:SIO_000300 \"" . $struct['standard_inchi'] . "\" ] ;\n";
if (strlen($struct['standard_inchi']) < 1500) {
echo " = <http://rdf.openmolecules.net/?" . $struct['standard_inchi'] . "> ;\n";
echo " owl:sameAs <http://rdf.openmolecules.net/?" . $struct['standard_inchi'] . "> ;\n";
}
}
if ($struct['standard_inchi_key'])
Expand Down Expand Up @@ -117,7 +119,7 @@
echo " dc:title \"" . str_replace("\"", "\\\"", $name['synonyms']) . "\" ;\n";
}

echo " = <http://bio2rdf.org/chebi:" . $chebiRow['chebi_id'] . "> .\n";
echo " owl:sameAs <http://bio2rdf.org/chebi:" . $chebiRow['chebi_id'] . "> .\n";
}
}

Expand Down
17 changes: 9 additions & 8 deletions docs.php
Expand Up @@ -11,17 +11,18 @@
@prefix chem: <http://www.blueobelisk.org/chemistryblogs/> .
@prefix nmr: <http://www.nmrshiftdb.org/onto#> .

@prefix : <http://pele.farmbio.uu.se/chembl/onto/#> .
@prefix act: <http://rdf.farmbio.uu.se/chembl/activitiy/> .
@prefix res: <http://rdf.farmbio.uu.se/chembl/resource/> .
@prefix mol: <http://rdf.farmbio.uu.se/chembl/molecule/> .
@prefix ass: <http://rdf.farmbio.uu.se/chembl/assay/> .
@prefix jrn: <http://rdf.farmbio.uu.se/chembl/journal/> .

<?php
<?php

include 'vars.php';

echo "@prefix : <http://rdf.farmbio.uu.se/chembl/onto/#> .\n";
echo "@prefix act: <" . $rooturi . "activitiy/> .\n";
echo "@prefix res: <" . $rooturi . "resource/> .\n";
echo "@prefix mol: <" . $rooturi . "molecule/> .\n";
echo "@prefix ass: <" . $rooturi . "assay/> .\n";
echo "@prefix jrn: <" . $rooturi . "journal/> .\n";
echo "\n";

mysql_connect("localhost", $user, $pwd) or die(mysql_error());
# echo "<!-- Connection to the server was successful! -->\n";

Expand Down

0 comments on commit 32275b2

Please sign in to comment.