1 | <?php
|
---|
2 | require_once RDFAPI_INCLUDE_DIR . 'util/Object.php';
|
---|
3 | // ---------------------------------------------
|
---|
4 | // class: Constraint.php
|
---|
5 | // ---------------------------------------------
|
---|
6 |
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * Represents a constraint. A value constraint is a boolean- valued expression
|
---|
10 | * of variables and RDF Terms.
|
---|
11 | *
|
---|
12 | * @author Tobias Gauss <tobias.gauss@web.de>
|
---|
13 | * @version $Id$
|
---|
14 | * @license http://www.gnu.org/licenses/lgpl.html LGPL
|
---|
15 | *
|
---|
16 | * @package sparql
|
---|
17 | */
|
---|
18 | Class Constraint extends Object{
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * The expression string.
|
---|
22 | * @var string
|
---|
23 | */
|
---|
24 | protected $expression;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * True if it is an outer filter, false if not.
|
---|
28 | * @var boolean
|
---|
29 | */
|
---|
30 | protected $outer;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The expression tree
|
---|
34 | * @var array
|
---|
35 | */
|
---|
36 | protected $tree = null;
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Adds an expression string.
|
---|
40 | *
|
---|
41 | * @param String $exp the expression String
|
---|
42 | * @return void
|
---|
43 | */
|
---|
44 | public function addExpression($exp)
|
---|
45 | {
|
---|
46 | $this->expression = $exp;
|
---|
47 | }
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * Returns the expression string.
|
---|
51 | *
|
---|
52 | * @return String the expression String
|
---|
53 | */
|
---|
54 | public function getExpression()
|
---|
55 | {
|
---|
56 | return $this->expression;
|
---|
57 | }
|
---|
58 |
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * Sets the filter type to outer or inner filter.
|
---|
62 | * True for outer false for inner.
|
---|
63 | *
|
---|
64 | * @param boolean $boolean
|
---|
65 | * @return void
|
---|
66 | */
|
---|
67 | public function setOuterFilter($boolean)
|
---|
68 | {
|
---|
69 | $this->outer = $boolean;
|
---|
70 | }
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * Returns true if this constraint is an outer filter- false if not.
|
---|
74 | *
|
---|
75 | * @return boolean
|
---|
76 | */
|
---|
77 | public function isOuterFilter()
|
---|
78 | {
|
---|
79 | return $this->outer;
|
---|
80 | }
|
---|
81 |
|
---|
82 |
|
---|
83 | public function getTree()
|
---|
84 | {
|
---|
85 | return $this->tree;
|
---|
86 | }//public function getTree()
|
---|
87 |
|
---|
88 | public function setTree($tree)
|
---|
89 | {
|
---|
90 | $this->tree = $tree;
|
---|
91 | }//public function setTree($tree)
|
---|
92 |
|
---|
93 | }
|
---|
94 | // end class: Constraint.php
|
---|
95 | ?>
|
---|