Пример #1
0
 function _generateRDF()
 {
     $model = new MemModel();
     $model->setBaseURI($this->doclink);
     $proc = new xsltprocessor();
     include_once RDFAPI_INCLUDE_DIR . PACKAGE_SYNTAX_RDF;
     $pars = new RdfParser();
     foreach ($this->stylelink as $key => $value) {
         $xsl = new DomDocument();
         $xsl->load($value);
         $proc->importStyleSheet($xsl);
         $model->addModel($pars->generateModel($proc->transformToXML($this->domdoc), $this->doclink));
     }
     return $model;
 }
Пример #2
0
 /**
  * Create a MemModel containing only the base triples 
  * (without inferred statements) of the current InfModelF.
  *
  * @return object MemModel
  * @access public
  */
 function getBaseMemModel()
 {
     $return = new MemModel();
     $return->setBaseURI($this->baseURI);
     foreach ($this->triples as $key => $statement) {
         if (!in_array($key, $this->infPos)) {
             $return->add($statement);
         }
     }
     $retun->addParsedNamespaces($this->getParsedNamespaces());
     return $return;
 }
Пример #3
0
 /**
  * Create a MemModel containing only the base triples (without inferred 
  * statements) of the current InfModelB.
  *
  * @return object MemModel
  * @access public
  */
 function &getBaseMemModel()
 {
     $return = new MemModel();
     $return->setBaseURI($this->baseURI);
     foreach ($this->triples as $statement) {
         $return->add($statement);
     }
     $retun->addParsedNamespaces($this->getParsedNamespaces());
     return $return;
 }
Пример #4
0
 function _generateModelLiteral()
 {
     $model = new MemModel();
     $model->setBaseURI('http://www.example.org');
     $sub = new Resource('http://www.example.org/subject1');
     $pred = new Resource('http://www.example.org/predicate1');
     $obj = new Literal('http://www.example.org/object1');
     $obj->setDatatype('test');
     $obj->setLanguage('DE');
     $model->add(new Statement($sub, $pred, $obj));
     return $model;
 }