Source for file QueryTriple.php

Documentation is available at QueryTriple.php

  1. <?php
  2. // ---------------------------------------------
  3. // Class: QueryTriple
  4. // ---------------------------------------------
  5. require_once RDFAPI_INCLUDE_DIR 'sparql/SparqlEngineDb/SqlGenerator.php';
  6.  
  7. /**
  8. * Represents a query triple.
  9. *
  10. @author   Tobias Gauss <tobias.gauss@web.de>
  11. @version    $Id: fsource_sparql__sparqlQueryTriple.php.html 443 2007-06-01 16:25:38Z cax $
  12. *
  13. @package sparql
  14. */
  15. Class QueryTriple extends Object{
  16.  
  17.     /**
  18.     * The QueryTriples Subject.
  19.     */
  20.     protected $subject;
  21.  
  22.     /**
  23.     * The QueryTriples Predicate.
  24.     */
  25.     protected $predicate;
  26.  
  27.     /**
  28.     * The QueryTriples Object.
  29.     */
  30.     protected $object;
  31.  
  32.  
  33.     /**
  34.     * Constructor
  35.     */
  36.     public function QueryTriple($sub,$pred,$ob)
  37.     {
  38.         $this->subject   = $sub;
  39.         $this->predicate = $pred;
  40.         $this->object    = $ob;
  41.     }
  42.  
  43.     /**
  44.     * Returns the Triples Subject.
  45.     *
  46.     * @return Node 
  47.     */
  48.     public function getSubject()
  49.     {
  50.         return $this->subject;
  51.     }
  52.  
  53.     /**
  54.     * Returns the Triples Predicate.
  55.     *
  56.     * @return Node 
  57.     */
  58.     public function getPredicate()
  59.     {
  60.         return $this->predicate;
  61.     }
  62.  
  63.     /**
  64.     * Returns the Triples Object.
  65.     *
  66.     * @return Node 
  67.     */
  68.     public function getObject()
  69.     {
  70.         return $this->object;
  71.     }
  72.  
  73.  
  74.  
  75.     /**
  76.     *   Returns an array of all variables in this triple.
  77.     *
  78.     *   @return array   Array of variable names
  79.     */
  80.     public function getVariables()
  81.     {
  82.         $arVars array();
  83.  
  84.         foreach (array('subject''predicate''object'as $strVar{
  85.             if (SparqlEngineDb_SqlGenerator::isVariable($this->$strVar)) {
  86.                 $arVars[$this->$strVar;
  87.             }
  88.         }
  89.  
  90.         return $arVars;
  91.     }
  92.  
  93. }
  94.  
  95. // end class: QueryTriple.php
  96. ?>

Documentation generated on Fri, 1 Jun 2007 16:50:29 +0200 by phpDocumentor 1.3.2