<h2>
  Triple store <?t $arg.name?>
  <?if userRole("site")?>
    <a class="linkish" style="font-size: 83%; font-weight: normal;">(change name)</a>
    <?event click changeStoreName();?>
  <?if.?>
</h2>

<p id="db-blurb">
  <?h template("store/blurb")($arg.blurb)?>
</p>

<p>
  There are <?t bigNumber($arg.triples)?> triples in this store.
  <?if userWrite()?>
    You can <span class="linkish">add a triple</span><?event click addTripleDialog();?>,
    <span class="linkish">import a file</span><?event click uploadDialog();?>,
    or use <span class="linkish">OpenCalais text-extraction</span><?event click calaisDialog();?>.
  <?if.?>
</p>

<p>
  Reasoning is
  <?if $arg.canReason?>
    enabled
    <?if userRole("site")?>
      <span class="linkish">(disable)</span>
      <?event click setDBReasoning(false);?>
    <?if.?>
  <?else?>
    disabled
    <?if userRole("site")?>
      <span class="linkish">(enable)</span>
      <?event click setDBReasoning(true);?>
    <?if.?>
  <?if.?>
</p>

<?if $arg.classes.length?>
  <p>Common types:
    <?for c $arg.classes?><?if $i > 0?>, <?if.?><?part c[0]?> (<?t c[1]?>)<?for.?>.
  </p>
<?if.?>
<?if $arg.notable.length || userRole("site")?>
  <p>
    Notable nodes: <?if !$arg.notable.length?>None.<?if.?>
    <?if userRole("site")?>
      <span class="linkish">(add node)</span><?event click addNotable();?>
    <?if.?>
  </p>
  <ul>
    <?for n $arg.notable?>
      <li><?part n[0]?> <span class="subtle"><?t n[1]?></span>
        <?if userRole("site")?><span class="linkish" title="delete">×</span><?event click deleteNotable(n);?><?if.?>
      </li>
    <?for.?>
  </ul>
<?if.?>

<?if $arg.queries.length?>
  <p>There are <?t $arg.queries.length?> <a href="#query/db">pre-defined queries</a> for this database.</p>
<?elif userRole("site")?>
  <p>No <a href="#query/db">pre-defined queries</a> yet.</p>
<?if.?>

<?if $arg.namespaces.length?>
  <h3>Default namespaces:</h3>
  <?namespaces {ns: $arg.namespaces, del: userRole("site") && deleteNamespace}?>
<?if.?>
<?if userRole("site")?>
  <p><span class="linkish">Add namespace</span><?event click namespaceDialog();?>.</p>
<?if.?>

<?if $arg.freetext?>
  <h3>Free-text indexed predicates:</h3>
  <p>
    <?for n $arg.freetext?><?if $i > 0?>, <?if.?><?part n?><?for.?><?if !$arg.freetext.length?>None<?if.?>.
    <?if userWrite()?><span class="linkish">(add predicate)</span><?event click newTextIndex();?><?if.?>
  </p>
<?if.?>

<h3>Active indices:</h3>
<p>
  <?for i $arg.indices?>
    <?if $i > 0?>, <?if.?>
    <abbr title="[?t map(function(ch){return capitalise(fullName[ch]);}, characters(i)).join(", ")?]">
      <?t i?>
    </abbr>
  <?for.?>
  <?if !$arg.indices.length?>None.<?if.?>
</p>
<p>
  <?t printDecimal($arg.indexCoverage * 100, 2)?>% index coverage.
  <?if userWrite()?>
    (Index <span class="linkish">all</span><?event click indexTriples(true);?>
    or <span class="linkish">new</span><?event click indexTriples(false);?> triples.)
  <?if.?>
</p>

<?if userRole("site")?>
  <h3>Query statistics</h3>
  <p>An average of <?t printDecimal($arg.queriesMade / (($arg.storeAge || .01) / 3600), 2)?> queries made per hour.
  Average query time <?t printDecimal(($arg.queryTime * 1000) / ($arg.queriesMade || .01), 2)?> ms.</p>
<?if.?>
