Example #1
0
 function parseRules()
 {
     $rules = array();
     $CP = new ConnectiveParser($this->ER, $this->XPath);
     $BBAP = new BBAParser($this->ER, $this->XPath);
     $BBAP->parseBBAs();
     $DBAP = new DBAParser($this->ER, $this->XPath, $CP);
     $DBAP->parseDBAs();
     $ARQR = new ARQueryRule($this->XPath->evaluate('//ARQuery')->item(0), $this->ER, $this->attributes, $this->interestMeasures, $DBAP, $BBAP);
     try {
         $ARQR->parse($DBAP, $BBAP);
         array_push($rules, $ARQR);
     } catch (InvalidRuleException $e) {
     }
     return $rules;
 }
 /**
  * It solves the rules if the data format is ARQuery
  *
  * @param <String> $whichOne It is name of Element I get from the XML and then
  * proces further.
  */
 private function solveARQuery($whichOne)
 {
     $rule = $this->domER->getElementsByTagName($whichOne)->item(0);
     $ruleAR = new ARQueryRule($rule, $this->domER);
     $this->jsonObject["rule0"] = $ruleAR->toJSON();
     $this->jsonObject["rules"] = 1;
 }