Source for file ResultConverter.php
Documentation is available at ResultConverter.php
require_once RDFAPI_INCLUDE_DIR .
'sparql/SparqlEngineDb/ResultRenderer.php';
* Converts a database result into a proper
* rdf statement triple array
* @author Christian Weiske <cweiske@cweiske.de>
* Determines the correct renderer and calls it.
* The $resultform may be:
* - false: The default renderer is taken then
* - an object that implements SparqlEngineDb_ResultRenderer interface
* - a string like "HTML" or "XML". The appropriate renderer is used then.
* - a full class name, e.g. SparqlEngineDb_ResultRenderer_XML
* @param array $arRecordSets Array of anything ADOConnection::Execute() can return
* @param SparqlEngineDb $engine Sparql database engine.
* @param mixed $resultform Which format the results shall be in (false or "xml")
* @return mixed Most likely an array or a boolean value,
* or anything else as determined by $resultform
public static function convertFromDbResults($arRecordSets, SparqlEngineDb $engine, $resultform =
false)
return $resultform->convertFromDbResults(
'Result renderer object needs to implement'
.
' SparqlEngineDb_ResultRenderer interface'
if ($resultform ===
false) {
} else if ($resultform ==
'xml') {
if ($strClass =
self::loadClass($resultform)) {
$rrObj =
new $strClass();
return $rrObj->convertFromDbResults(
'Result renderer class "' .
$strClass .
'" needs to implement'
.
' SparqlEngineDb_ResultRenderer interface'
'Result renderer class "' .
$resultform .
'" could not be loaded.'
}//public static function convertFromDbResults($arRecordSets, SparqlEngineDb $engine, $resultform = false)
* Tries to load a given class if it doesn't exist,
* and returns true if the class can be used.
* @param string $strClass Classname
* @return mixed Class name if the class is loaded and can be used, false if not.
protected static function loadClass($strClass)
//RAP style, shortcut notation
$strFile =
'SparqlEngineDb/ResultRenderer/' .
$strClass .
'.php';
@include_once RDFAPI_INCLUDE_DIR .
'sparql/' .
$strFile;
if (class_exists('SparqlEngineDb_ResultRenderer_' .
$strClass)) {
return 'SparqlEngineDb_ResultRenderer_' .
$strClass;
@include_once RDFAPI_INCLUDE_DIR .
'sparql/' .
$strFile;
}//protected static function loadClass($strClass)
}//class SparqlEngineDb_ResultConverter
Documentation generated on Fri, 1 Jun 2007 16:51:40 +0200 by phpDocumentor 1.3.2