RDQL
[ class tree: RDQL ] [ index: RDQL ] [ all elements ]

Source for file Engine.php

Documentation is available at Engine.php

  1. <?php
  2. // ----------------------------------------------------------------------------------
  3. // Class: RDF_RDQL_Engine
  4. // ----------------------------------------------------------------------------------
  5. /**
  6.  * Some general methods common for RDQLMemEngine and RDQLDBEngine
  7.  *
  8.  * @version V0.7
  9.  * @author Radoslaw Oldakowski <radol@gmx.de>
  10.  * @package RDQL
  11.  * @access public
  12.  */
  13.  
  14. class RDF_RDQL_Engine extends RDF_Object
  15. {
  16.     /**
  17.      * Prints a query result as HTML table.
  18.      * You can change the colors in the configuration file.
  19.      *
  20.      * @param array $queryResult [][?VARNAME] = object Node
  21.      * @access protected
  22.      */
  23.     function writeQueryResultAsHtmlTable($queryResult)
  24.     {
  25.         if (current($queryResult[0]== null{
  26.             echo 'no match<br>';
  27.             return;
  28.         }
  29.  
  30.         echo '<table border="1" cellpadding="3" cellspacing="0"><tr><td><b>No.</b></td>';
  31.         foreach ($queryResult[0as $varName => $value)
  32.         echo "<td align='center'><b>$varName</b></td>";
  33.         echo '</tr>';
  34.  
  35.         foreach ($queryResult as $n => $var{
  36.             echo '<tr><td width="20" align="right">' ($n + 1'.</td>';
  37.             foreach ($var as $varName => $value{
  38.                 echo RDF_INDENTATION . RDF_INDENTATION . '<td bgcolor="';
  39.                 echo RDF_Util::chooseColor($value);
  40.                 echo '">';
  41.                 echo '<p>';
  42.  
  43.                 $lang = null;
  44.                 $dtype = null;
  45.                 if (is_a($value'RDF_Literal')) {
  46.                     if ($value->getLanguage(!= null{
  47.                         $lang ' <b>(xml:lang="' $value->getLanguage('") </b> ';
  48.                     }
  49.                     if ($value->getDatatype(!= null{
  50.                         $dtype ' <b>(rdf:datatype="' $value->getDatatype('") </b> ';
  51.                     }
  52.                 }
  53.                 echo RDF_Util::getNodeTypeName($value$value->getLabel($lang $dtype '</p>';
  54.             }
  55.             echo '</tr>';
  56.         }
  57.         echo '</table>';
  58.     }
  59. // end: Class RDQLEngine
  60.  
  61. ?>

Documentation generated on Mon, 11 Mar 2019 15:39:49 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.