Esempio n. 1
0
 /**
  * Get word connections and objects
  *
  * @param		string		$uri				Word URI from WS
  * @return		array		$ret_val			Connections and objects array
  */
 public function getWordConnectionObjects($uri = '')
 {
     $ret_val = array();
     $data = array('propertyDetailsList' => array(array('uri' => '?lexicalEntry', 'value' => $uri)));
     $ws_url_copy = $this->ws_urls['search']['addr'];
     $this->ws_urls['search']['addr'] .= '?sparqlQueryName=SenseRelation';
     $result = $this->sendRequest('search', $data);
     $this->ws_urls['search']['addr'] = $ws_url_copy;
     if (empty($result['type']) || $result['type'] != 'success' || empty($result['details'])) {
         return $ret_val;
     }
     foreach ($result['details'] as $item) {
         if (empty($item['properties'])) {
             continue;
         }
         $ret_val[] = ArrayUtils::restruct($item['properties'], 'uri', 'dataProperty');
     }
     return $ret_val;
 }