Source for file Dataset.php

Documentation is available at Dataset.php

  1. <?php
  2. // ----------------------------------------------------------------------------------
  3. // Class: Dataset
  4. // ----------------------------------------------------------------------------------
  5.  
  6. /**
  7. * Dataset implementation.
  8. * Superclass of datasetMem and datasetDb which contains shared functionality.
  9. *
  10. @version  $Id: fsource_dataset__datasetDataset.php.html,v 1.8 2006/06/26 12:34:12 tgauss Exp $
  11. @author Daniel Westphal (http://www.d-westphal.de)
  12. @author Chris Bizer <chris@bizer.de>
  13. *
  14. @package     dataset
  15. @access    public
  16. ***/
  17.  
  18. class Dataset
  19. {
  20.     /**
  21.     * Load a Dataset from a File
  22.     *
  23.     * @param string 
  24.     * @access    public
  25.     */    
  26.     function loadFromFile($file)
  27.     {
  28.         $parsernew TriXParser(&$this);
  29.         $parser->parseFile($file);    
  30.     }
  31.     
  32.     /**
  33.     * Load a Datset from a string
  34.     *
  35.     * @param string 
  36.     * @access    public
  37.     */
  38.     function loadFromString($string)
  39.     {
  40.         $parsernew TriXParser(&$this);
  41.         $parser->parseString($string);        
  42.     }
  43.     
  44.     /**
  45.     * Serialize the Dataset to File
  46.     *
  47.     * @param  string 
  48.     * @access    public
  49.     */    
  50.     function serializeToFile($fileName)
  51.     {
  52.         $serializernew TriXSerializer(&$this);
  53.         $serializer->serializeToFile($fileName);    
  54.     }
  55.     
  56.     /**
  57.     * Serialize the Dataset to string
  58.     *
  59.     * @return string 
  60.     * @access    public
  61.     */
  62.     function serializeToString()
  63.     {
  64.         $serializernew TriXSerializer(&$this);
  65.         return $serializer->serializeToString();        
  66.     }
  67.     
  68.  /**
  69.  * Performs a SPARQL query against an RDF Dataset.
  70.  * The result can be retrived in SPARQL Query Results XML Format or
  71.  * as an array containing the variables an their bindings.
  72.  *
  73.  * @param  String $query      the sparql query string
  74.  * @param  String $resultform the result form ('xml' for SPARQL Query Results XML Format)
  75.  * @return String/array 
  76.  */
  77.  function sparqlQuery($query,$resultform false){
  78.      include_once(RDFAPI_INCLUDE_DIR.PACKAGE_SPARQL);
  79.      $parser new SparqlParser();
  80.      $q $parser->parse($query);
  81.      
  82.      $eng new SparqlEngine();
  83.      return $eng->queryModel($this,$q,$resultform);
  84.  }
  85.  
  86.     
  87.     
  88. }
  89. ?>

Documentation generated on Mon, 26 Jun 2006 14:25:20 +0200 by phpDocumentor 1.3.0RC6