$expresses = "http://semanticscience.org/resource/CHEMINF_000302"; $current_date = gmDate("Y-m-d\\TH:i:s"); echo triple($thisset, $PAV . "createdBy", $importedBy); echo typeddata_triple($thisset, $PAV . "createdOn", $current_date, $XSD . "dateTime"); echo triple($thisset, $PAV . "authoredBy", $importedBy); echo typeddata_triple($thisset, $PAV . "authoredOn", $current_date, $XSD . "dateTime"); echo triple($thisset, $RDF . "type", $VOID . "Linkset"); echo triple($masterset, $VOID . "subset", $thisset); # echo triple( $molset, $RDF . "type", $VOID . "Dataset" ); echo data_triple($sourceSet, $VOID . "uriSpace", $sourceSpace); echo triple($masterset, $VOID . "subset", $sourceSet); # echo triple( $chebiset, $RDF . "type", $VOID . "Dataset" ); echo data_triple($targetSet, $VOID . "uriSpace", $targetSpace); echo triple($masterset, $VOID . "subset", $thisset); echo "\n"; echo data_triple($thisset, $DCT . "title", $thisSetTitle); echo data_triple($thisset, $DCT . "description", $thisSetDescription); echo triple($thisset, $VOID . "subjectsTarget", $sourceSet); echo triple($thisset, $VOID . "objectsTarget", $targetSet); echo triple($thisset, $VOID . "linkPredicate", $linkPredicate); echo triple($thisset, $DCT . "license", $ini["license"]); echo triple($thisset, $DUL . "expresses", $expresses); echo "\n"; # DATA $allIDs = mysqli_query($con, "SELECT DISTINCT * FROM docs WHERE doc_id > 0 AND pubmed_id IS NOT NULL " . $ini["limit"]); while ($row = mysqli_fetch_assoc($allIDs)) { $resource = $CHEMBL . $row['chembl_id']; if ($row['pubmed_id']) { echo triple($resource, $SKOS . "exactMatch", "http://bio2rdf.org/pubmed:" . $row['pubmed_id']); } }
<?php $titrePage = "fonctions"; include "header.php"; //echo get_include_path(); require_once "fonctions.php"; //require parce que bloquant si non trouvé echo double(5) . "<br/>"; echo triple(5) . "<br/>"; echo $multiplicateur; echo double(triple(46)) . "<br/>"; // date du jour en format US $dateJour = date('Y-m-d'); // conversion en date FR echo date_fr($dateJour) . "<br/>"; echo date_fr('2015-10-05') . "<br/>"; echo date_us('05/10/2015') . "<br/>"; $tableau = array(array('Language' => 'PHP', 'Age' => 20, 'Createur' => 'Rasmus Lerdorf'), array('Language' => 'JAVA', 'Age' => 33, 'Createur' => 'SUN'), array('Language' => 'C#', 'Age' => 14, 'Createur' => 'Microsoft'), array('Language' => 'COBOL', 'Age' => 56, 'Createur' => 'IBM'), array('Language' => 'BASIC', 'Age' => 51, 'Createur' => 'inconnu'), array('Language' => 'C', 'Age' => 45, 'Createur' => 'inconnu'), array('Language' => 'C++', 'Age' => 17, 'Createur' => 'toto')); echo afficheTableau2D($tableau); $tNombres = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); echo '<pre>'; // affichage des nombres pairs print_r(array_filter($tNombres, 'pair')); // détail de la fonction array_filter $tResultat = array(); foreach ($tNombres as $cle => $nombre) { if (pair($nombre)) { $tResultat[$cle] = $nombre; } } print_r($tResultat);
$hier = ""; if ($classRow['l1']) { $hier = appendTo($hier, $classRow['l1']); } if ($classRow['l2']) { $hier = appendTo($hier, $classRow['l2']); } if ($classRow['l3']) { $hier = appendTo($hier, $classRow['l3']); } if ($classRow['l4']) { $hier = appendTo($hier, $classRow['l4']); } if ($classRow['l5']) { $hier = appendTo($hier, $classRow['l5']); } if ($classRow['l6']) { $hier = appendTo($hier, $classRow['l6']); } if ($classRow['l7']) { $hier = appendTo($hier, $classRow['l7']); } if ($classRow['l8']) { $hier = appendTo($hier, $classRow['l8']); } echo triple($target, $ONTO . "targetClass", $array[$hier]["uri"]); } if ($row['pref_name']) { echo data_triple($target, $DC . "title", $row['pref_name']); } }
$description = str_replace("\\", "\\\\", $description); $description = str_replace("\"", "\\\"", $description); echo data_triple($assay, $ONTO . "hasDescription", $description); } if ($row['doc_id']) { $docProps = mysqli_query($con, "SELECT DISTINCT chembl_id FROM docs WHERE doc_id = " . $row['doc_id']); while ($docProp = mysqli_fetch_assoc($docProps)) { echo triple($assay, $CITO . "citesAsDataSource", $CHEMBL . $docProp['chembl_id']); } } $props = mysqli_query($con, "SELECT DISTINCT * FROM assay2target WHERE assay_id = " . $row['assay_id']); while ($prop = mysqli_fetch_assoc($props)) { if ($prop['tid']) { $targetURI = $TRG . "t" . $prop['tid']; if ($prop['confidence_score']) { $targetScore = $assay . "/score/t" . $prop['tid']; echo triple($assay, $ONTO . "hasTargetScore", $targetScore); echo triple($targetScore, $ONTO . "forTarget", $targetURI); echo typeddata_triple($targetScore, $ONTO . "hasRelationshipType", $prop['relationship_type'], $XSD . "string"); echo typeddata_triple($targetScore, $ONTO . "isComplex", $prop['complex'], $XSD . "int"); echo typeddata_triple($targetScore, $ONTO . "isMulti", $prop['multi'], $XSD . "int"); } } } if ($row['assay_type']) { $props = mysqli_query($con, "SELECT DISTINCT * FROM assay_type WHERE assay_type = '" . $row['assay_type'] . "'"); while ($prop = mysqli_fetch_assoc($props)) { echo triple($assay, $ONTO . "hasAssayType", $ONTO . $prop['assay_desc']); } } }
<h1>Fonctions</h1> <?php get_include_path(); include "header.php"; include "fonction.php"; echo double(5) . "</br>"; echo triple(3) . "</br>"; echo double(triple(3)) . "</br>"; echo puissance(45, 1) . "</br>"; // date du jour en format US $dateJour = date('Y-m-d'); // conversion en date FR echo date_fr($dateJour) . "</br>"; // reconversion au format US echo date_us(date_fr($dateJour)) . "</br>"; include "footer.php";
echo triple($masterset, $VOID . "subset", $thisset); # echo triple( $molset, $RDF . "type", $VOID . "Dataset" ); echo data_triple($sourceSet, $VOID . "uriSpace", $sourceSpace); echo triple($masterset, $VOID . "subset", $sourceSet); # echo triple( $chebiset, $RDF . "type", $VOID . "Dataset" ); echo data_triple($targetSet, $VOID . "uriSpace", $targetSpace); echo triple($masterset, $VOID . "subset", $thisset); echo "\n"; echo data_triple($thisset, $DCT . "title", $thisSetTitle); echo data_triple($thisset, $DCT . "description", $thisSetDescription); echo triple($thisset, $VOID . "subjectsTarget", $sourceSet); echo triple($thisset, $VOID . "objectsTarget", $targetSet); echo triple($thisset, $VOID . "linkPredicate", $linkPredicate); echo triple($thisset, $DCT . "license", $ini["license"]); echo triple($thisset, $DUL . "expresses", $expresses); echo "\n"; # DATA $allIDs = mysqli_query($con, "SELECT DISTINCT * FROM target_dictionary " . $ini["limit"]); function appendTo($appendTo, $string) { if (strlen($string) > 0) { return $appendTo . "/" . $string; } return $appendTo; } while ($row = mysqli_fetch_assoc($allIDs)) { $target = $CHEMBL . $row['chembl_id']; if ($row['protein_accession']) { echo triple($target, $SKOS . "exactMatch", "http://bio2rdf.org/uniprot:" . $row['protein_accession']); } }
$expresses = "http://purl.obolibrary.org/obo/MI_0574"; $current_date = gmDate("Y-m-d\\TH:i:s"); echo triple($thisset, $PAV . "createdBy", $importedBy); echo typeddata_triple($thisset, $PAV . "createdOn", $current_date, $XSD . "dateTime"); echo triple($thisset, $PAV . "authoredBy", $importedBy); echo typeddata_triple($thisset, $PAV . "authoredOn", $current_date, $XSD . "dateTime"); echo triple($thisset, $RDF . "type", $VOID . "Linkset"); echo triple($masterset, $VOID . "subset", $thisset); # echo triple( $molset, $RDF . "type", $VOID . "Dataset" ); echo data_triple($sourceSet, $VOID . "uriSpace", $sourceSpace); echo triple($masterset, $VOID . "subset", $sourceSet); # echo triple( $chebiset, $RDF . "type", $VOID . "Dataset" ); echo data_triple($targetSet, $VOID . "uriSpace", $targetSpace); echo triple($masterset, $VOID . "subset", $thisset); echo "\n"; echo data_triple($thisset, $DCT . "title", $thisSetTitle); echo data_triple($thisset, $DCT . "description", $thisSetDescription); echo triple($thisset, $VOID . "subjectsTarget", $sourceSet); echo triple($thisset, $VOID . "objectsTarget", $targetSet); echo triple($thisset, $VOID . "linkPredicate", $linkPredicate); echo triple($thisset, $DCT . "license", $ini["license"]); echo triple($thisset, $DUL . "expresses", $expresses); echo "\n"; # DATA $allIDs = mysqli_query($con, "SELECT DISTINCT * FROM docs WHERE doc_id > 0 AND doi IS NOT NULL " . $ini["limit"]); while ($row = mysqli_fetch_assoc($allIDs)) { $resource = $CHEMBL . $row['chembl_id']; if ($row['doi']) { echo triple($resource, $OWL . "sameAs", "http://dx.doi.org/" . $row['doi']); } }
<?php include "header.php"; //echo get_include_path(); include "fonctionj4bis.php"; echo double(5) . '<br>'; echo triple(10) . '<br>'; echo double(triple(46)) . '<br>'; $dateJour = date('Y-m-d'); echo date_fr($dateJour) . "<br>"; echo date_us('05/10/2015') . "<br>"; $tableau = array(array('language' => 'PHP', 'age' => 21, 'createur' => 'Rasmus Ledorf'), array('language' => 'JAVA', 'age' => 33, 'createur' => 'SUN'), array('language' => 'C#', 'age' => 14, 'createur' => 'Microsoft'), array('language' => 'COBOL', 'age' => 56, 'createur' => 'IBM'), array('language' => 'BASIC', 'age' => 51, 'createur' => 'inconnu'), array('language' => 'C', 'age' => 45, 'createur' => 'inconnu'), array('language' => 'C++', 'age' => 32, 'createur' => 'toto')); echo afficheTableau($tableau) . "<br>"; $tnombres = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); echo '<pre>'; //affichage des nombres pairs print_r(array_filter($tnombres, 'pair')); $tresultat = array(); foreach ($tnombres as $nombre) { if (pair($nombre)) { $tresultat[] = $nombre; } } // affichage des nombres impairs print_r(array_filter($tnombres, 'impair')); // tri des éléments dont le créateur est inconnu print_r(array_filter($tableau, 'inconnu')); // calculs sur le tableau print_r(array_map('cube', $tnombres)); // ajout d'une zone divers dans le tableau print_r(array_map('divers', $tableau));
function main() { triple('I'); triple('J'); triple('K'); triple('L'); triple('II'); triple('JJ'); triple('KK'); triple('LL'); test('B', 0, 0); }
if ($struct['standard_inchi']) { echo data_triple($molecule, $CHEM . "inchi", $struct['standard_inchi']); $molsmiles = $molecule . "/inchi"; echo triple($molecule, $CHEMINF . "CHEMINF_000200", $molsmiles); echo triple($molsmiles, $RDF . "type", $CHEMINF . "CHEMINF_000113"); echo data_triple($molsmiles, $CHEMINF . "SIO_000300", $struct['standard_inchi']); if (strlen($struct['standard_inchi']) < 1500) { echo triple($molecule, $OWL . "equivalentClass", "http://rdf.openmolecules.net/?" . $struct['standard_inchi']); } } if ($struct['standard_inchi_key']) { echo data_triple($molecule, $CHEM . "inchikey", $struct['standard_inchi_key']); $molsmiles = $molecule . "/inchikey"; echo triple($molecule, $CHEMINF . "CHEMINF_000200", $molsmiles); echo triple($molsmiles, $RDF . "type", $CHEMINF . "CHEMINF_000059"); echo data_triple($molsmiles, $CHEMINF . "SIO_000300", $struct['standard_inchi_key']); } } # get parent/child information $hierarchies = mysqli_query($con, "SELECT DISTINCT * FROM molecule_hierarchy WHERE molregno = {$molregno}"); while ($hierarchy = mysqli_fetch_assoc($hierarchies)) { if ($hierarchy['parent_molregno'] != $molregno) { $parent = $MOL . "m" . $hierarchy['parent_molregno']; echo triple($molecule, $ONTO . "parentCompound", $parent); } if ($hierarchy['active_molregno'] != $molregno) { $child = $MOL . "m" . $hierarchy['active_molregno']; echo triple($molecule, $ONTO . "activeCompound", $child); } } }
echo triple($masterset, $VOID . "subset", $thisset); # echo triple( $molset, $RDF . "type", $VOID . "Dataset" ); echo data_triple($sourceSet, $VOID . "uriSpace", $sourceSpace); echo triple($masterset, $VOID . "subset", $sourceSet); # echo triple( $chebiset, $RDF . "type", $VOID . "Dataset" ); echo data_triple($targetSet, $VOID . "uriSpace", $targetSpace); echo triple($masterset, $VOID . "subset", $thisset); echo "\n"; echo data_triple($thisset, $DCT . "title", $thisSetTitle); echo data_triple($thisset, $DCT . "description", $thisSetDescription); echo triple($thisset, $VOID . "subjectsTarget", $sourceSet); echo triple($thisset, $VOID . "objectsTarget", $targetSet); echo triple($thisset, $VOID . "linkPredicate", $linkPredicate); echo triple($thisset, $DCT . "license", $ini["license"]); echo triple($thisset, $DUL . "expresses", $expresses); echo "\n"; # DATA $allIDs = mysqli_query($con, "SELECT DISTINCT * FROM target_dictionary " . $ini["limit"]); function appendTo($appendTo, $string) { if (strlen($string) > 0) { return $appendTo . "/" . $string; } return $appendTo; } while ($row = mysqli_fetch_assoc($allIDs)) { $target = $CHEMBL . $row['chembl_id']; if ($row['protein_accession']) { echo triple($target, $SKOS . "exactMatch", $UNIPROT . $row['protein_accession']); } }
<?php for ($index = 1; $index <= 100; $index++) { if (!empty(triplefiver($index))) { echo triplefiver($index) . PHP_EOL; continue; } elseif (!empty(triple($index))) { echo triple($index) . PHP_EOL; continue; } elseif (!empty(fiver($index))) { echo fiver($index) . PHP_EOL; continue; } else { echo $index . PHP_EOL; } } function triple($index) { if ($index % 3 == 0) { return "triple"; } } function fiver($index) { if ($index % 5 == 0) { return "fiver"; } } function triplefiver($index) { if ($index % 3 == 0 && $index % 5 == 0) {
<?php /* Generated By SBP */ function triple($number) { return $number * 3; } $score = 4; $score = triple($score); echo $score; // Affiche 12
echo triple($thisset, $RDF . "type", $VOID . "Linkset"); echo triple($masterset, $VOID . "subset", $thisset); # echo triple( $molset, $RDF . "type", $VOID . "Dataset" ); echo data_triple($sourceSet, $VOID . "uriSpace", $sourceSpace); echo triple($masterset, $VOID . "subset", $sourceSet); # echo triple( $chebiset, $RDF . "type", $VOID . "Dataset" ); echo data_triple($targetSet, $VOID . "uriSpace", $targetSpace); echo triple($masterset, $VOID . "subset", $thisset); echo "\n"; echo data_triple($thisset, $DCT . "title", $thisSetTitle); echo data_triple($thisset, $DCT . "description", $thisSetDescription); echo triple($thisset, $VOID . "subjectsTarget", $sourceSet); echo triple($thisset, $VOID . "objectsTarget", $targetSet); echo triple($thisset, $VOID . "linkPredicate", $linkPredicate); echo triple($thisset, $DCT . "license", $ini["license"]); echo triple($thisset, $DUL . "expresses", $expresses); echo "\n"; # DATA $allIDs = mysqli_query($con, "SELECT DISTINCT molregno, chembl_id FROM molecule_dictionary " . $ini["limit"]); while ($row = mysqli_fetch_assoc($allIDs)) { $molregno = $row['molregno']; $molecule = $CHEMBL . $row['chembl_id']; # get the compound type, ChEBI, and ChEMBL identifiers $chebi = mysqli_query($con, "SELECT DISTINCT chebi_par_id FROM molecule_dictionary WHERE molregno = {$molregno}"); if ($chebiRow = mysqli_fetch_assoc($chebi)) { $chebiid = $chebiRow['chebi_par_id']; if ($chebiid) { echo triple($molecule, $SKOS . "exactMatch", $chebiSpace . "CHEBI_" . $chebiid); } } }
$masterset = $mastervoid . "ChEMBLRDF"; $thisset = $mastervoid . "ChEMBLDocs"; $thisSetTitle = "ChEMBL Documents"; $thisSetDescription = "Document information from ChEMBL."; $current_date = gmDate("Y-m-d\\TH:i:s"); echo triple($thisset, $PAV . "createdBy", $importedBy); echo typeddata_triple($thisset, $PAV . "createdOn", $current_date, $XSD . "dateTime"); echo triple($thisset, $PAV . "authoredBy", $importedBy); echo typeddata_triple($thisset, $PAV . "authoredOn", $current_date, $XSD . "dateTime"); echo triple($thisset, $RDF . "type", $VOID . "Dataset"); echo triple($masterset, $VOID . "subset", $thisset); echo data_triple($thisset, $DCT . "title", $thisSetTitle); echo data_triple($thisset, $DCT . "description", $thisSetDescription); echo triple($thisset, $DCT . "license", $ini["license"]); echo "\n"; while ($row = mysqli_fetch_assoc($allIDs)) { $resource = $CHEMBL . $row['chembl_id']; echo triple($resource, $RDF . "type", $BIBO . "Article"); if ($row['doi']) { echo data_triple($resource, $BIBO . "doi", $row['doi']); } if ($row['pubmed_id']) { echo data_triple($resource, $BIBO . "pmid", $row['pubmed_id']); } echo data_triple($resource, $DC . "date", $row['year']); echo data_triple($resource, $BIBO . "volume", $row['volume']); echo data_triple($resource, $BIBO . "issue", $row['issue']); echo data_triple($resource, $BIBO . "pageStart", $row['first_page']); echo data_triple($resource, $BIBO . "pageEnd", $row['last_page']); echo triple($resource, $DC . "isPartOf", $JRN . "j" . md5($row['journal'])); }
<?php header('Content-type: application/rdf+xml'); ?> <?php include 'vars.php'; include 'namespaces.php'; include 'functions.php'; include 'to.php'; # classifications foreach ($array as $code => $array2) { $higher = $array2["higher"]; $uri = $array2["uri"]; $desc = $array2["label"]; $example = $array2["classification"]; echo triple($uri, $RDF . "type", $SKOS . "Concept"); echo triple($uri, $RDFS . "subClassOf", $higher); echo triple($higher, $SKOS . "narrower", $uri); echo data_triple($uri, $SKOS . "prefLabel", $desc); echo data_triple($uri, $SKOS . "scopeNote", $code); echo data_triple($uri, $SKOS . "example", $example); }
<?php header('Content-type: text/n3'); include 'namespaces.php'; include 'functions.php'; $ini = parse_ini_file("vars.properties"); $rooturi = $ini["rooturi"]; $db = $ini["dbprefix"] . $ini["version"]; $con = mysqli_connect(ini_get("mysqli.default_host"), ini_get("mysqli.default_user"), ini_get("mysqli.default_pw"), $db); if (mysqli_connect_errno($con)) { die(mysqli_connect_errno($con)); } $allIDs = mysqli_query($con, "SELECT * FROM chembl_id_lookup, compound_properties WHERE chembl_id_lookup.entity_id = compound_properties.molregno " . $ini["limit"]); # CHEMINF mappings $descs = array("alogp" => "CHEMINF_000305", "hba" => "CHEMINF_000309", "hbd" => "CHEMINF_000310", "psa" => "CHEMINF_000308", "rtb" => "CHEMINF_000311", "acd_most_apka" => "CHEMINF_000324", "acd_most_bpka" => "CHEMINF_000325", "acd_logp" => "CHEMINF_000321", "acd_logd" => "CHEMINF_000323", "num_ro5_violations" => "CHEMINF_000314", "ro3_pass" => "CHEMINF_000317", "med_chem_friendly" => "CHEMINF_000319", "full_mwt" => "CHEMINF_000198", "mw_freebase" => "CHEMINF_000350"); $descTypes = array("alogp" => "double", "hba" => "nonNegativeInteger", "hbd" => "nonNegativeInteger", "psa" => "double", "rtb" => "nonNegativeInteger", "acd_most_apka" => "double", "acd_most_bpka" => "double", "acd_logp" => "double", "acd_logd" => "double", "num_ro5_violations" => "nonNegativeInteger", "ro3_pass" => "string", "med_chem_friendly" => "string", "full_mwt" => "double", "mw_freebase" => "double"); while ($row = mysqli_fetch_assoc($allIDs)) { $molregno = $row['molregno']; $molecule = $CHEMBL . $row['chembl_id']; foreach ($descs as $value => $cheminf) { if ($row[$value]) { $molprop = $molecule . "/{$value}"; echo triple($molecule, $CHEMINF . "CHEMINF_000200", $molprop); echo triple($molprop, $RDF . "type", $CHEMINF . "{$cheminf}"); echo typeddata_triple($molprop, $CHEMINF . "SIO_000300", $row[$value], $XSD . $descTypes[$value]); } } }