Source for file ResModel.php

Documentation is available at ResModel.php

  1. <?php
  2. // ----------------------------------------------------------------------------------
  3. // Class: ResModel
  4. // ----------------------------------------------------------------------------------
  5.  
  6. /**
  7. * A ResModel provides an resource centric view on an underlying RDF model.
  8. * ResModels show information not as statements but as resources with
  9. * properties, similar to Jena models. ResModels may create Resources [URI
  10. * nodes and bnodes]. Creating a Resource does not make the Resource visible to
  11. * the model; Resources are only "in" Models if Statements about them are added
  12. * to the Model. Similarly the only way to "remove" a Resource from a Model is
  13. * to remove all the Statements that mention it.
  14. *
  15. * When a Resource or Literal is created by a Model, the Model is free to re-use an existing
  16. * Resource or Literal object with the correct values, or it may create a fresh one.
  17. *
  18. * <BR><BR>History:
  19. * <LI>09-10-2004 : First version of this class.</LI>
  20. *
  21. * @version V0.9.3
  22. * @author Daniel Westphal <mail at d-westphal dot de>
  23. *
  24. *
  25. * @package resModel
  26. * @access public
  27. ***/
  28. class ResModel
  29. {
  30. /**
  31. * Holds a reference to the assoiated memmodel/dbmodel/infmodel
  32. * @var ResResource
  33. * @access private
  34. */
  35. var $model;
  36.  
  37. /**
  38. * Constructor
  39. * You have to supply a memmodel/dbmodel/infmodel to save the statements.
  40. *
  41. * @param object model $model
  42. * @access public
  43. */
  44. function ResModel(& $model)
  45. {
  46. if (!is_a($model,''Model''))
  47. trigger_error(RDFAPI_ERROR . ''(class: ResourceLayer; method: ResourceLayer):
  48. $model has to be object of class Model'', E_USER_ERROR);
  49. $this->model =& $model;
  50. }
  51. /**
  52. * Create a new resource associated with this model.
  53. * If the uri string isn''t set, this creates a bnode.
  54. * Otherwise it creates a URI node.
  55. * A URI resource is .equals() to any other URI Resource with the same URI
  56. * (even in a different model - be warned).
  57. *
  58. * This method may return an existing Resource with the correct URI and model,
  59. * or it may construct a fresh one, as it sees fit.
  60. *
  61. * Operations on the result Resource may change this model.
  62. *
  63. * @param string $uri
  64. * @return object ResResource
  65. * @access public
  66. */
  67. function createResource($uri = null)
  68. {
  69. $resResource = new ResResource($uri);
  70. //associate the resource with this model, and get a unique identifier
  71. //if it is bnode.
  72. $resResource->setAssociatedModel($this);
  73. return $resResource;
  74. }
  75. /**
  76. * Create a new Property associated with this model.
  77. * This method may return an existing property with the correct URI and model,
  78. * or it may construct a fresh one, as it sees fit.
  79. *
  80. * Subsequent operations on the returned property may modify this model.
  81. *
  82. *
  83. * @param string $uri
  84. * @return object ResProperty
  85. * @access public
  86. */
  87. function createProperty($uri = null)
  88. {
  89. $resProperty = new ResProperty($uri);
  90. $resProperty->setAssociatedModel($this);
  91. return $resProperty;
  92. }
  93. /**
  94. * Create an untyped literal from a String value with a specified language.
  95. *
  96. * If you want to type this literal, you have to set a datatype before
  97. * adding it to the model.
  98. *
  99. *
  100. * @param string $label
  101. * @param string $languageTag
  102. * @return object ResLiteral
  103. * @access public
  104. */
  105. function createLiteral($label,$languageTag = null)
  106. {
  107. $resLiteral = new ResLiteral($label,$languageTag);
  108. $resLiteral->setAssociatedModel($this);
  109. return $resLiteral;
  110. }
  111. /**
  112. * General method to search for triples.
  113. * NULL input for any parameter will match anything.
  114. * Example: $result = $m->find( NULL, NULL, $node );
  115. * Finds all Statements with $node as object.
  116. * Returns an array of statements with ResResources.
  117. *
  118. * @param object ResResource $subject
  119. * @param object ResResource $predicate
  120. * @param object ResResource $object
  121. * @return array
  122. * @access public
  123. * @throws PhpError
  124. */
  125. function find($subject,$predicate, $object)
  126. {
  127. $result=array();
  128. //convert ResResources to Resources and Blanknodes
  129. $resmodel=$this->model->find( $this->_resNode2Node($subject),
  130. $this->_resNode2Node($predicate),
  131. $this->_resNode2Node($object)
  132. );
  133. //convert Resources, Blanknodes to ResResources
  134. foreach ($resmodel->triples as $statement)
  135. {
  136. $result[]=new Statement($this->_node2ResNode($statement->getSubject()),
  137. $this->_node2ResNode($statement->getPredicate(),true),
  138. $this->_node2ResNode($statement->getObject())
  139. );
  140. };
  141. return $result;
  142. }
  143. /**
  144. * Searches for triples and returns the first matching statement.
  145. * NULL input for any parameter will match anything.
  146. * Example: $result = $m->findFirstMatchingStatement( NULL, NULL, $node );
  147. * Returns the first statement with ResResources of the Model where the object equals $node.
  148. * Returns an NULL if nothing is found.
  149. * You can define an offset to search.
  150. *
  151. * @param object Node $subject
  152. * @param object Node $predicate
  153. * @param object Node $object
  154. * @param integer $offset
  155. * @return object Statement
  156. * @access public
  157. */
  158. function findFirstMatchingStatement($subject,$predicate,$object,$offset = 0)
  159. {
  160. $statement = $this->model->findFirstMatchingStatement( $this->_resNode2Node($subject),
  161. $this->_resNode2Node($predicate),
  162. $this->_resNode2Node($object),
  163. $offset
  164. );
  165. if ($statement!==null)
  166. {
  167. return new Statement( $this->_node2ResNode($statement->getSubject()),
  168. $this->_node2ResNode($statement->getPredicate(),true),
  169. $this->_node2ResNode($statement->getObject())
  170. );
  171. } else
  172. {
  173. return null;
  174. }
  175. }
  176. /**
  177. * Adds a new triple to the Model without checking if the statement is already in the Model.
  178. * So if you want a duplicate free Model use the addWithoutDuplicates() function (which is slower then add())
  179. * Expects a statements with ResResources(ResLiterals)
  180. *
  181. * @param object Statement $statement
  182. * @access public
  183. * @throws PhpError
  184. */
  185. function add($statement)
  186. {
  187. return $this->model->add(new Statement( $this->_resNode2Node($statement->getSubject()),
  188. $this->_resNode2Node($statement->getPredicate()),
  189. $this->_resNode2Node($statement->getObject()))
  190. );
  191. }
  192. /**
  193. * Checks if a new statement is already in the Model and adds the statement, if it is not in the Model.
  194. * addWithoutDuplicates() is significantly slower then add().
  195. * Retruns TRUE if the statement is added.
  196. * FALSE otherwise.
  197. * Expects a statements with ResResources(ResLiterals)
  198. *
  199. * @param object Statement $statement
  200. * @return boolean
  201. * @access public
  202. * @throws PhpError
  203. */
  204. function addWithoutDuplicates($statement)
  205. {
  206. return $this->model->addWithoutDuplicates(new Statement($this->_resNode2Node($statement->getSubject()),
  207. $this->_resNode2Node($statement->getPredicate()),
  208. $this->_resNode2Node($statement->getObject()))
  209. );
  210. }
  211. /**
  212. * Tests if the Model contains the given statement.
  213. * TRUE if the statement belongs to the model;
  214. * FALSE otherwise.
  215. * Expects a statement of ResResources(ResLiterals)
  216. *
  217. * @param object Statement $statement
  218. * @return boolean
  219. * @access public
  220. */
  221. function contains(& $statement)
  222. {
  223. return $this->model->contains(new Statement($this->_resNode2Node($statement->getSubject()),
  224. $this->_resNode2Node($statement->getPredicate()),
  225. $this->_resNode2Node($statement->getObject()))
  226. );
  227. }
  228. /**
  229. * Determine if all of the statements in a model are also contained in this model.
  230. * True if all of the statements in $model are also contained in this model and false otherwise.
  231. *
  232. * @param object Model &$model
  233. * @return boolean
  234. * @access public
  235. */
  236. function containsAll(& $model)
  237. {
  238. if (is_a($model,''ResModel''))
  239. return $this->model->containsAll($model->getModel());
  240. return $this->model->containsAll($model);
  241. }
  242. /**
  243. * Determine if any of the statements in a model are also contained in this model.
  244. * True if any of the statements in $model are also contained in this model and false otherwise.
  245. *
  246. * @param object Model &$model
  247. * @return boolean
  248. * @access public
  249. */
  250. function containsAny(& $model)
  251. {
  252. if (is_a($model,''ResModel''))
  253. return $this->model->containsAny($model->getModel());
  254. return $this->model->containsAny($model);
  255. }
  256. /**
  257. * Determine if the node (ResResource / ResLiteral) $node appears in any statement of this model.
  258. *
  259. * @param object Node &$node
  260. * @return boolean
  261. * @access public
  262. */
  263. function containsResource(& $node)
  264. {
  265. if ($this->findFirstMatchingStatement($node,null,null) === null)
  266. if ($this->findFirstMatchingStatement(null,$node,null) === null)
  267. if ($this->findFirstMatchingStatement(null,null,$node) === null)
  268. return false;
  269. return true;
  270. }
  271. /**
  272. * Create a literal from a String value with the $dtype Datatype
  273. * An existing literal of the right value may be returned, or a fresh one created.
  274. *
  275. * @param string $value
  276. * @param string $dtype
  277. * @return object ResLiteral
  278. * @access public
  279. */
  280. function createTypedLiteral($value,$dtype)
  281. {
  282. $resLiteral = new ResLiteral($value);
  283. $resLiteral->setDatatype($dtype);
  284. $resLiteral->setAssociatedModel($this);
  285. return $resLiteral;
  286. }
  287. /**
  288. * Checks if two models are equal.
  289. * Two models are equal if and only if the two RDF graphs they represent are isomorphic.
  290. *
  291. * Warning: This method doesn''t work correct with models where the same blank node has different
  292. * identifiers in the two models. We will correct this in a future version.
  293. *
  294. * @access public
  295. * @param object model &$that
  296. * @throws phpErrpr
  297. * @return boolean
  298. */
  299. function equals(& $that)
  300. {
  301. if (is_a($that,''ResModel''))
  302. return $this->model->equals($that->getModel());
  303. return $this->model->equals($that);
  304. }
  305. /**
  306. * Returns a new model that is the subtraction of another model from this model.
  307. *
  308. * @param object Model $model
  309. * @return object MemModel
  310. * @access public
  311. * @throws phpErrpr
  312. */
  313. function subtract($model)
  314. {
  315. if (is_a($model,''ResModel''))
  316. return $this->model->subtract($model->getModel());
  317. return $this->model->subtract($model);
  318. }
  319. /**
  320. * Answer a statement find(s, p, null) with ResResources(ResLiterals) from this model.
  321. * If none exist, return null; if several exist, pick one arbitrarily.
  322. *
  323. * @param object ResResource $subject
  324. * @param object ResResource $property
  325. * @return object Statement
  326. * @access public
  327. * @throws phpErrpr
  328. */
  329. function getProperty($subject,$property)
  330. {
  331. $statement= $this->model->findFirstMatchingStatement( $this->_resNode2Node($subject),
  332. $this->_resNode2Node($property),
  333. null
  334. );
  335. if ($statement === null)
  336. return null;
  337. return new Statement($this->_node2ResNode($statement->getSubject()),
  338. $this->_node2ResNode($statement->getPredicate(),true),
  339. $this->_node2ResNode($statement->getObject())
  340. );
  341. }
  342. /**
  343. * Checks if MemModel is empty
  344. *
  345. * @return boolean
  346. * @access public
  347. */
  348. function isEmpty()
  349. {
  350. return $this->model->isEmpty();
  351. }
  352. /**
  353. * Returns a ResIterator with all objects in a model.
  354. *
  355. * @return object ResIterator
  356. * @access public
  357. * @throws phpErrpr
  358. */
  359. function listObjects()
  360. {
  361. return $this->listObjectsOfProperty(null);
  362. }
  363. /**
  364. * Returns a ResIterator with all objects with a given property and property value.
  365. *
  366. * @param object ResResource $property
  367. * @param object ResResource $value
  368. * @return object ResIterator
  369. * @access public
  370. */
  371. function listObjectsOfProperty($property, $value = null)
  372. {
  373. return new ResIterator(null,$property,$value,''o'',$this);
  374. }
  375.  
  376. /**
  377. * Returns a ResIterator with all subjects in a model.
  378. *
  379. * @return object ResIterator
  380. * @access public
  381. * @throws phpErrpr
  382. */
  383. function listSubjects()
  384. {
  385. return $this->listSubjectsWithProperty(null);
  386. }
  387. /**
  388. * Returns a ResIterator with all subjects with a given property and property value.
  389. *
  390. * @param object ResResource $property
  391. * @param object ResResource $value
  392. * @return object ResIterator
  393. * @access public
  394. * @throws phpErrpr
  395. */
  396. function listSubjectsWithProperty($property,$value = null)
  397. {
  398. return new ResIterator(null,$property,$value,''s'',$this);
  399. }
  400. /**
  401. * Removes the statement of ResResources(ResTriples) from the MemModel.
  402. * TRUE if the statement is removed.
  403. * FALSE otherwise.
  404. *
  405. * @param object Statement $statement
  406. * @return boolean
  407. * @access public
  408. * @throws PhpError
  409. */
  410. function remove($statement)
  411. {
  412. return $this->model->remove(new Statement( $this->_resNode2Node($statement->getSubject()),
  413. $this->_resNode2Node($statement->getPredicate()),
  414. $this->_resNode2Node($statement->getObject())
  415. ));
  416. }
  417. /**
  418. * Number of statements in the MemModel
  419. *
  420. * @return integer
  421. * @access public
  422. */
  423. function size()
  424. {
  425. return $this->model->size();
  426. }
  427. /**
  428. * Returns a new Model that is the set-union of the model with another model.
  429. * Duplicate statements are removed. If you want to allow duplicates, use addModel() which is much faster.
  430. *
  431. * The result of taking the set-union of two or more RDF graphs (i.e. sets of triples)
  432. * is another graph, which we will call the merge of the graphs.
  433. * Each of the original graphs is a subgraph of the merged graph. Notice that when forming
  434. * a merged graph, two occurrences of a given uriref or literal as nodes in two different
  435. * graphs become a single node in the union graph (since by definition they are the same
  436. * uriref or literal) but blank nodes are not ''merged'' in this way; and arcs are of course
  437. * never merged. In particular, this means that every blank node in a merged graph can be
  438. * identified as coming from one particular graph in the original set of graphs.
  439. *
  440. * Notice that one does not, in general, obtain the merge of a set of graphs by concatenating
  441. * their corresponding N-triples documents and constructing the graph described by the merged
  442. * document, since if some of the documents use the same node identifiers, the merged document
  443. * will describe a graph in which some of the blank nodes have been ''accidentally'' merged.
  444. * To merge Ntriples documents it is necessary to check if the same nodeID is used in two or
  445. * more documents, and to replace it with a distinct nodeID in each of them, before merging the
  446. * documents. (Not implemented yet !!!!!!!!!!!)
  447. *
  448. * @param object Model $model
  449. * @return object MemModel
  450. * @access public
  451. * @throws phpErrpr
  452. *
  453. */
  454. function & unite(& $model)
  455. {
  456. if (is_a($model,''ResModel''))
  457. return $this->model->unite($model->getModel());
  458. return $this->model->unite($model);
  459. }
  460. /**
  461. * Adds another model to this MemModel.
  462. * Duplicate statements are not removed.
  463. * If you don''t want duplicates, use unite().
  464. * If any statement of the model to be added to this model contains a blankNode
  465. * with an identifier already existing in this model, a new blankNode is generated.
  466. *
  467. * @param object Model $model
  468. * @access public
  469. * @throws phpErrpr
  470. *
  471. */
  472. function addModel(&$model)
  473. {
  474. if (is_a($model,''ResModel''))
  475. return $this->model->addModel($model->getModel());
  476. return $this->model->addModel($model);
  477. }
  478. /**
  479. * Create a new RDF Container from type rdf:Alt
  480. * This method may return an existing container with the correct URI and model,
  481. * or it may construct a fresh one, as it sees fit.
  482. *
  483. * Subsequent operations on the returned Container may modify this model.
  484. *
  485. *
  486. * @param string $uri
  487. * @return object ResProperty
  488. * @access public
  489. */
  490. function createAlt($uri = null)
  491. {
  492. $resAlt = new ResAlt($uri);
  493. $resAlt->setAssociatedModel($this);
  494. return $resAlt;
  495. }
  496. /**
  497. * Create a new RDF Container from type rdf:Bag
  498. * This method may return an existing container with the correct URI and model,
  499. * or it may construct a fresh one, as it sees fit.
  500. *
  501. * Subsequent operations on the returned Container may modify this model.
  502. *
  503. *
  504. * @param string $uri
  505. * @return object ResProperty
  506. * @access public
  507. */
  508. function createBag($uri = null)
  509. {
  510. $resBag = new ResBag($uri);
  511. $resBag->setAssociatedModel($this);
  512. return $resBag;
  513. }
  514. /**
  515. * Create a new RDF Container from type rdf:Seq
  516. * This method may return an existing container with the correct URI and model,
  517. * or it may construct a fresh one, as it sees fit.
  518. *
  519. * Subsequent operations on the returned Container may modify this model.
  520. *
  521. *
  522. * @param string $uri
  523. * @return object ResProperty
  524. * @access public
  525. */
  526. function createSeq($uri = null)
  527. {
  528. $resSeq = new ResSeq($uri);
  529. $resSeq->setAssociatedModel($this);
  530. return $resSeq;
  531. }
  532. /**
  533. * Create a new RDF Collection from type rdf:List
  534. * This method may return an existing container with the correct URI and model,
  535. * or it may construct a fresh one, as it sees fit.
  536. *
  537. * Subsequent operations on the returned Container may modify this model.
  538. *
  539. *
  540. * @param string $uri
  541. * @return object ResProperty
  542. * @access public
  543. */
  544. function createList($uri = null)
  545. {
  546. $resList = new ResList($uri);
  547. $resList->setAssociatedModel($this);
  548. return $resList;
  549. }
  550. /**
  551. * Returns a reference to the underlying model (Mem/DB/InfModel) that contains the statements
  552. *
  553. *
  554. * @return object Model
  555. * @access public
  556. */
  557. function & getModel()
  558. {
  559. return $this->model;
  560. }
  561. /**
  562. * Internal method, that returns a resource URI that is unique for the Model.
  563. * URIs are generated using the base_uri of the Model, the prefix and a unique number.
  564. * If no prefix is defined, the bNode prefix, defined in constants.php, is used.
  565. *
  566. * @param string $prefix
  567. * @return string
  568. * @access private
  569. */
  570. function getUniqueResourceURI($bnodePrefix)
  571. {
  572. return $this->model->getUniqueResourceURI($bnodePrefix);
  573. }
  574. /**
  575. * Load a model from a file containing RDF, N3 or N-Triples.
  576. * This function recognizes the suffix of the filename (.n3 or .rdf) and
  577. * calls a suitable parser, if no $type is given as string ("rdf" "n3" "nt");
  578. * If the model is not empty, the contents of the file is added to this DbModel.
  579. *
  580. * @param string $filename
  581. * @param string $type
  582. * @param boolean $stream
  583. * @access public
  584. */
  585. function load($filename, $type = NULL, $stream=false)
  586. {
  587. $this->model->load($filename, $type = NULL, $stream=false);
  588. }
  589. /**
  590. * Return current baseURI.
  591. *
  592. * @return string
  593. * @access public
  594. */
  595. function getBaseURI()
  596. {
  597. return $this->model->getBaseURI();
  598. }
  599.  
  600. /**
  601. * Saves the RDF,N3 or N-Triple serialization of the MemModel to a file.
  602. * You can decide to which format the model should be serialized by using a
  603. * corresponding suffix-string as $type parameter. If no $type parameter
  604. * is placed this method will serialize the model to XML/RDF format.
  605. * Returns FALSE if the MemModel couldn''t be saved to the file.
  606. *
  607. * @access public
  608. * @param string $filename
  609. * @param string $type
  610. * @throw PhpError
  611. * @return boolean
  612. */
  613. function saveAs($filename, $type =''rdf'')
  614. {
  615. return $this->model->saveAs($filename, $type =''rdf'');
  616. }
  617. /**
  618. * Writes the RDF serialization of the MemModel as HTML table.
  619. *
  620. * @access public
  621. */
  622. function writeAsHTMLTable()
  623. {
  624. $this->model->writeAsHtmlTable();
  625. }
  626. /**
  627. * Returns a new model containing all the statements which are in both this model and another.
  628. *
  629. * @param object Model $model
  630. * @return object MemModel
  631. * @access public
  632. * @throws phpErrpr
  633. */
  634. function & intersect(& $model)
  635. {
  636. if (is_a($model,''ResModel''))
  637. return $this->model->intersect($model->getModel());
  638. return $this->model->intersect($model);
  639. }
  640. /**
  641. * converts a Resource,Blanknode,Literal into a ResResource, ResProperty, or ResLiteral
  642. *
  643. * @param object Node $node
  644. * @param boolean $isProperty
  645. * @return object ResResource / ResProperty / ResLiteral
  646. * @access private
  647. * @throws phpErrpr
  648. */
  649. function _node2ResNode($node, $isProperty = false)
  650. {
  651. if (is_a($node,''Literal''))
  652. {
  653. $return= new ResLiteral($node->getLabel(),$node->getLanguage());
  654. $return->setDatatype($node->getDatatype());
  655. $return->setAssociatedModel($this);
  656.  
  657. return $return;
  658. }
  659. if (is_a($node,''Resource''))
  660. {
  661. if ($isProperty)
  662. {
  663. $res= new ResProperty($node->getLabel());
  664. } else
  665. {
  666. $res= new ResResource($node->getLabel());
  667. }
  668. $res->setAssociatedModel($this);
  669. if (is_a($node,''Blanknode''))
  670. $res->setIsAnon(true);
  671. return $res;
  672. }
  673. }
  674. /**
  675. * converts a ResResource, ResProperty, or ResLiteral into a Resource, Blanknode, or Literal
  676. *
  677. * @param object ResNode $resNode
  678. * @return object Node
  679. * @access private
  680. * @throws phpErrpr
  681. */
  682. function _resNode2Node($resNode)
  683. {
  684. if (is_a($resNode,''ResResource''))
  685. {
  686. if ($resNode->getIsAnon())
  687. {
  688. $return=new BlankNode($resNode->getURI());
  689. } else
  690. {
  691. $return=new Resource($resNode->getURI());
  692. }
  693. return $return;
  694. }
  695. if (is_a($resNode,''ResLiteral''))
  696. {
  697. $literal=new Literal($resNode->getLabel(),$resNode->getLanguage());
  698. if ($resNode->getDatatype() != null)
  699. $literal->setDatatype($resNode->getDatatype());
  700. return $literal;
  701. }
  702. }
  703. /**
  704. * Set a base URI for the MemModel.
  705. * Affects creating of new resources and serialization syntax.
  706. * If the URI doesn''t end with # : or /, then a # is added to the URI.
  707. * @param string $uri
  708. * @access public
  709. */
  710. function setBaseURI($uri)
  711. {
  712. $this->model->setBaseURI($uri);
  713. }
  714. /**
  715. * Writes the RDF serialization of the MemModel as HTML table.
  716. *
  717. * @access public
  718. * @return string
  719. */
  720. function writeRdfToString()
  721. {
  722. return $this->model->writeRdfToString();
  723. }
  724. /**
  725. * Perform an RDQL query on this MemModel.
  726. * This method returns an associative array of variable bindings.
  727. * The values of the query variables can either be RAP''s objects (instances of Node)
  728. * if $returnNodes set to TRUE, or their string serialization.
  729. *
  730. * @access public
  731. * @param string $queryString
  732. * @param boolean $returnNodes
  733. * @return array [][?VARNAME] = object Node (if $returnNodes = TRUE)
  734. * OR array [][?VARNAME] = string
  735. *
  736. */
  737. function & rdqlQuery($queryString, $returnNodes = TRUE)
  738. {
  739. return $this->model->rdqlQuery($queryString, $returnNodes);
  740. }
  741. /**
  742. * Perform an RDQL query on this MemModel.
  743. * This method returns an RdqlResultIterator of variable bindings.
  744. * The values of the query variables can either be RAP''s objects (instances of Node)
  745. * if $returnNodes set to TRUE, or their string serialization.
  746. *
  747. * @access public
  748. * @param string $queryString
  749. * @param boolean $returnNodes
  750. * @return object RdqlResultIterator = with values as object Node (if $returnNodes = TRUE)
  751. * OR object RdqlResultIterator = with values as strings if (if $returnNodes = FALSE)
  752. *
  753. */
  754. function rdqlQueryAsIterator($queryString, $returnNodes = TRUE)
  755. {
  756. return $this->model->rdqlQueryAsIterator($queryString, $returnNodes);
  757. }
  758. /**
  759. * Returns the models namespaces.
  760. *
  761. * @author Tobias Gauß <tobias.gauss@web.de>
  762. * @access public
  763. * @return Array
  764. */
  765. function getParsedNamespaces(){
  766. return $this->model->getParsedNamespaces();
  767. }
  768.  
  769.  
  770.  
  771. /**
  772. * Adds the namespaces to the model. This method is called by
  773. * the parser. !!!! addParsedNamespaces() not overwrites manual
  774. * added namespaces in the model !!!!
  775. *
  776. * @author Tobias Gauß <tobias.gauss@web.de>
  777. * @access public
  778. * @param Array $newNs
  779. */
  780. function addParsedNamespaces($newNs){
  781. $this->model->addParsedNamespaces($newNs);
  782. }
  783.  
  784.  
  785. /**
  786. * Adds a namespace and prefix to the model.
  787. *
  788. * @author Tobias Gauß <tobias.gauss@web.de>
  789. * @access public
  790. * @param String $prefix, String $nmsp
  791. */
  792. function addNamespace($prefix, $namespace){
  793. $this->model->addNamespace($prefix, $namespace);
  794. }
  795. /**
  796. * removes a single namespace from the model
  797. *
  798. * @author Tobias Gauß <tobias.gauss@web.de>
  799. * @access public
  800. * @param String $nmsp
  801. */
  802. function removeNamespace($nmsp){
  803. return $this->model->removeNamespace($nmsp);
  804. }
  805.  
  806. }

Documentation generated on Fri, 13 Jan 2006 07:49:30 +0100 by phpDocumentor 1.3.0RC4