Source for file ResModel.php

Documentation is available at ResModel.php

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

Documentation generated on Fri, 17 Dec 2004 16:17:58 +0100 by phpDocumentor 1.3.0RC3