Esempio n. 1
0
 $json = json_decode($response, true);
 $temp = $json["results"]["bindings"];
 foreach ($temp as $t) {
     array_push($topics, $t["topic_value"]["value"]);
     //}
 }
 if ($control == 1) {
     //STAMPA I TOPIC DELL ARTICOLO DATO IN INPUT
     echo "----------------------TOPIC----------------------<br>";
     foreach ($topics as $t) {
         echo $t;
         echo "</br>";
     }
 }
 if (sizeof($topics) > 0) {
     $query = $prefixs . $sparql->getArticlesByTopics($topics, $title, "?title_value", "?topic_value", "?count");
     $response = $http->sparqlQuery($query);
     $json = json_decode($response, true);
     $temp = $json["results"]["bindings"];
     foreach ($temp as $t) {
         // ARRAY ASSOCIATIVO TITOLO_ARTICOLO -> NUMERO TOPIC
         $article1[$t["title_value"]["value"]] = $t["count"]["value"];
     }
 }
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //A PARTIRE DAL TITOLO RESTITUISCE ALLA FINE UNA LISTA DI ARTICOLI CON LA CORRELAZIONE OTTENUTA DALLE KEYWORD IN COMUNE
 if (!isset($keywords)) {
     $query = $prefixs . $sparql->getKeywordsByTitle($title, '?keyword_value');
     $response = $http->sparqlQuery($query);
     $json = json_decode($response, true);
     $temp = $json["results"]["bindings"];