$query = "select property, count(*) c from graph where not(value like '" . PREFIX . "%') group by property order by c desc";
    $result = mysqli_query($dbc, $query) or die('Error querying database1.');
    while ($row = mysqli_fetch_array($result)) {
        $value = $row[0];
        $count = $row[1];
        echo '<li ';
        if (isset($active_relation) && $active_relation == $value) {
            echo 'class = "active"';
        }
        echo '><a href = "' . $_SERVER['PHP_SELF'] . '?db_name=' . $db_name . '&active_relation=' . $value . '">' . $value . '&nbsp;<span class="badge">' . $count . '</span>' . '</a></li>';
    }
}
if (isset($_GET['active_relation'])) {
    $active_relation = $_GET['active_relation'];
}
$num_of_entities = get_num_of_entities($dbc);
$num_of_facts = get_num_of_facts($dbc);
$num_of_relations = get_num_of_relations($dbc);
$num_of_literals = get_num_of_literals($dbc);
?>

<script>
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-146052-10']);
    _gaq.push(['_trackPageview']);
    (function() {
        var ga = document.createElement('script');
        ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(ga, s);
Exemple #2
0
<?php

include_once "./header.php";
include_once "./appvars.php";
include_once "./entity_helper.php";
include_once "./db_array.php";
$entity_counts = array();
$total_entity_counts = 0;
foreach ($dbs as $db_id => $db) {
    $dbc = mysqli_connect($db[0], $db[1], $db[2], $db[3]) or die('Error connecting to MySQL server.');
    $entity_counts[$db_id] = get_num_of_entities($dbc);
    $total_entity_counts = $total_entity_counts + $entity_counts[$db_id];
}
$fact_counts = array();
$total_fact_counts = 0;
foreach ($dbs as $db_id => $db) {
    $dbc = mysqli_connect($db[0], $db[1], $db[2], $db[3]) or die('Error connecting to MySQL server.');
    $fact_counts[$db_id] = get_num_of_facts($dbc);
    $total_fact_counts = $total_fact_counts + $fact_counts[$db_id];
}
arsort($entity_counts);
?>


<div class="container" align="center">


    <div class="jumbotron" align ="center">
         <h1>世界上最大的中医药知识图谱!</h1>
         <h2>The world's <em>biggest</em> knowledge graph for Traditonal Chinese Medicine!</h2>