Commit 5c9eb60f authored by PkSM3's avatar PkSM3

last version

parent 419e4eac
<?php
header('Content-Type: application/json');
include("DirectoryScanner.php");
$projectFolderPat = dirname(dirname(getcwd())) . "/";
$instance = new scanTree($projectFolderPat);
$instance->getDirectoryTree("data");
//pr(var_dump($instance->folders));
$output = array();
$output["folders"] = $instance->folders;
$output["gexf_idfolder"] = $instance->gexf_folder;
echo json_encode($output);
// ** Debug Functions: **
function br() {
echo "----------<br>";
}
function pr($msg) {
echo $msg . "<br>";
}
?>
<?php
class scanTree {
public $root;
public $folders = array();
public $gexf_folder = array();
public function __construct($rootpath = "") {
$this->root = $rootpath;
}
public function getDirectoryTree($dir) {
$folder = array();
$dbs = array();
$gexfs = array();
$dataFolder = $this->root . $dir;
$files = scandir($dataFolder);
foreach ($files as $f) {
if ($f != "." and $f != ".." and $f[strlen($f) - 1] != "~") {
if (is_dir($dataFolder . "/" . $f)) {
//pr("Dir: ".$f);
$subfolder = $f;
$this->getDirectoryTree($dir . "/" . $subfolder);
} else {
//pr("File: ".$f);
if ((strpos($f, '.gexf')))
array_push($gexfs, $f);
if ((strpos($f, '.db')) or (strpos($f, '.sqlite')) or (strpos($f, '.sqlite3')))
array_push($dbs, $f);
if (!$folder[$dir]["gexf"] or !$folder[$dir]["dbs"])
$folder[$dir] = array();
$folder[$dir]["gexf"] = $gexfs;
$folder[$dir]["dbs"] = $dbs;
if ((strpos($f, '.gexf'))) {
$this->gexf_folder[$dir . "/" . $f] = "";
}
}
}
}
if ($folder[$dir]["gexf"]) {
foreach ($folder[$dir]["gexf"] as $g) {
$this->gexf_folder[$dir . "/" . $g] = count($this->folders);
}
}
array_push($this->folders, $folder);
}
}
?>
<?php
echo 'toto';
?>
\ No newline at end of file
<?php
// default informations
$thedb = $graphdb;
$gexf=$_GET["gexf"];
$max_item_displayed=6;
$type = $_GET["type"];
$TITLE="ISITITLE";
$query = str_replace( '__and__', '&', $_GET["query"] );
$elems = json_decode($query);
$table = "";
$column = "";
$id="";
$twjs="API_CNRS/"; // submod path of TinaWebJS
if($type=="social"){
$table = "ISIAUTHOR";
$column = "data";
$id = "id";
$restriction='';
$factor=10;// factor for normalisation of stars
}
if($type=="semantic"){
$table = $_GET["index"];//"ISItermsfirstindexing";
$column = "data";
$id = "id";
$restriction='';
$factor=10;
}
$restriction='';
$factor=10;
$sql="";
//////////
if (count($elems)==1){// un seul mot est sélectionné, on compte les mots multiples
$sql = 'SELECT count(*),'.$id.'
FROM '.$table.' where (';
foreach($elems as $elem){
$sql.=' '.$column.'="'.$elem.'" OR ';
}
#$querynotparsed=$sql;#####
$sql = substr($sql, 0, -3);
$sql = str_replace( ' & ', '" OR '.$column.'="', $sql );
$sql.=')'.$restriction.'
GROUP BY '.$id.'
ORDER BY count('.$id.') DESC
LIMIT 1000';
}else{// on compte une seule fois un mot dans un article
$factor=ceil(count($elems)/5); //les scores sont moins haut
$sql='';
foreach($elems as $elem){
$sql.=' '.$column.'="'.$elem.'" OR ';
}
$sql=substr($sql, 0, -3);
$sql='SELECT count(*),id,data FROM (SELECT *
FROM '.$table.' where ('.$sql.')'.$restriction.'
group by id,data) GROUP BY '.$id.'
ORDER BY count('.$id.') DESC
LIMIT 1000';
}
$wos_ids = array();
$sum=0;
// echo "<br>";
// echo "$sql";
//The final query!
// array of all relevant documents with score
foreach ($base->query($sql) as $row) {
// on pondère le score par le nombre de termes mentionnés par l'article
//$num_rows = $result->numRows();
$wos_ids[$row[$id]] = $row["count(*)"];
$sum = $row["count(*)"] +$sum;
}
// /// nombre de document associés $related
$total_count=0;
$count_max=500;
$number_doc=count($wos_ids);
$count=0;
$all_terms_from_selected_projects=array();// list of terms for the top 6 project selected
// to filter under some conditions
$to_display=true;
$count=0;
foreach ($wos_ids as $id => $score) {
if ($total_count<$count_max) {
// retrieve publication year
if ($to_display){
$total_count+=1;
if ($count<=$max_item_displayed){
$count+=1;
$sql = 'SELECT data FROM ISITITLE WHERE id='.$id.' group by data';
foreach ($base->query($sql) as $row) {
$external_link="<a href=http://google.com/webhp?#q=".urlencode('"'.$row['data'].'"')." target=blank>".' <img width=15px src="'.$twjs.'img/google.png"></a>';
$output.="<li title='".$score."'>";
$output.=$external_link.imagestar($score,$factor,$twjs).' ';
$output.='<a href="JavaScript:newPopup(\''.$twjs.'default_doc_details.php?gexf='.urlencode($gexf).'&index='.$table.'&query='.urlencode($query).'&type='.urlencode($_GET["type"]).'&id='.$id.' \')">'.$row['data']." </a> ";
// echo '<a href="JavaScript:newPopup(\''.$twjs.'default_doc_details.php?gexf='.urlencode($gexf).'&index='.$table.'&query='.urlencode($query).'&type='.urlencode($_GET["type"]).'&id='.$id.' \')">'.$row['data']." </a> ";
}
// get the authors
$sql = 'SELECT data FROM ISIAUTHOR WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.=($row['data']).', ';
}
$output = rtrim($output, ", ");
$output.="</li><br>";
}
}
} else{
continue;
}
}
if ($total_count<$count_max){
$related .= $total_count;
}else{
$related .= ">".$count_max;
}
$output .= "</ul>"; #####
// // if (($project_folder=='nci')&&(count($elems)<$max_selection_size)){
// // // for NCI we compare the impact and novelty score making the difference if there are more than 4 terms selected
// // $news='';//new terms
// // $terms_from_selected_projects=array_unique($all_terms_from_selected_projects);
// // if(count($terms_from_selected_projects)>3){
// // $diff=array();
// // foreach ($terms_from_selected_projects as $key => $term) {
// // $sql= "select count(*),ISIterms.id, ISIterms.data from ISIterms join ISIpubdate on (ISIterms.id=ISIpubdate.id AND ISIpubdate.data=2011 AND ISIterms.data='".$term."') group by ISIterms.data";
// // $nov=0;
// // foreach ($corporadb->query($sql) as $row) {
// // $nov=$row['count(*)'];
// // }
// // $sql= "select count(*),ISIterms.id, ISIterms.data from ISIterms join ISIpubdate on (ISIterms.id=ISIpubdate.id AND ISIpubdate.data=2012 AND ISIterms.data='".$term."') group by ISIterms.data";
// // $imp=0;
// // foreach ($corporadb->query($sql) as $row) {
// // $imp=$row['count(*)'];
// // }
// // $diff[$term]=info($nov,$imp); //positive si c'est un term novelty, negatif si c'est un terme impact.
// // //echo $term.'-nov: '.$nov.'- imp:'.$imp.'<br/>';//'-info'.$diff[$term].
// // }
// // if (true){
// // arsort($diff);
// // $res=array_keys($diff);
// // //echo implode(', ', $res);
// // $nov_string='';
// // for ($i=0;$i<$top_displayed;$i++){
// // // on récupère les titres du document qui a le plus for impact
// // $sql="SELECT ISIterms.id,ISIC1_1.data,count(*) from ISIterms,ISIpubdate,ISIC1_1 where ISIterms.data='".$res[$i]."' AND ISIterms.id=ISIpubdate.id AND ISIterms.id=ISIC1_1.id AND ISIpubdate.data='2011' group by ISIterms.id ORDER BY RANDOM() limit 1";
// // //on récupère les id associés.
// // foreach ($corporadb->query($sql) as $row){
// // $sql2='SELECT ISIpubdate.id,ISIC1_1.data from ISIpubdate,ISIC1_1 where ISIC1_1.data="'.$row['data'].'" AND ISIpubdate.id=ISIC1_1.id AND ISIpubdate.data="2013" limit 1';
// // //echo $sql2;
// // foreach ($corporadb->query($sql2) as $row2){
// // $nov_string.='<a href="JavaScript:newPopup(\''.$twjs.'php/default_doc_details.php?db='.urlencode($graphdb).'&gexf='.urlencode($gexf).'&query='.urlencode('["'.$res[$i].'"]').'&type='.urlencode($_GET["type"]).'&id='.$row2['id'].' \')">'.$res[$i]."</a>, ";
// // }
// // }
// // }
// // $news.='<br/><b><font color="#FF0066">Top '.$top_displayed.' Novelty related terms </font></b>'.$nov_string.'<br/>';
// // asort($diff);
// // $res=array_keys($diff);
// // $res_string='';
// // for ($i=0;$i<$top_displayed;$i++){
// // // on récupère les titres du document qui a le plus for impact
// // $sql="SELECT ISIterms.id,ISIC1_1.data,count(*) from ISIterms,ISIpubdate,ISIC1_1 where ISIterms.data='".$res[$i]."' AND ISIterms.id=ISIpubdate.id AND ISIterms.id=ISIC1_1.id AND ISIpubdate.data='2012' group by ISIterms.id ORDER BY RANDOM()limit 1";
// // //on récupère les id associés.
// // foreach ($corporadb->query($sql) as $row){
// // $sql2='SELECT ISIpubdate.id,ISIC1_1.data from ISIpubdate,ISIC1_1 where ISIC1_1.data="'.$row['data'].'" AND ISIpubdate.id=ISIC1_1.id AND ISIpubdate.data="2013" limit 1';
// // //echo $sql2;
// // foreach ($corporadb->query($sql2) as $row2){
// // $res_string.='<a href="JavaScript:newPopup(\''.$twjs.'php/default_doc_details.php?db='.urlencode($graphdb).'&gexf='.urlencode($gexf).'&query='.urlencode('["'.$res[$i].'"]').'&type='.urlencode($_GET["type"]).'&id='.$row2['id'].' \')">'.$res[$i]."</a>, ";
// // }
// // }
// // }
// // $news.='<br/><b><font color="#CF5300">Top '.$top_displayed.' Impact related terms: </font></b>'.$res_string.'<br/>';
// // }
// // }
// // }
// // display the most occuring terms when only one is selected.
// //elseif (count($elems)==1) {// on affiche les voisins
// // $terms_array=array();
// // $id_sql='SELECT ISIterms.id FROM ISIterms where ISIterms.data="'.$elems[0].'" group by id';
// // foreach ($base->query($id_sql) as $row_id) {
// // $sql2='SELECT ISIterms.data FROM ISIterms where ISIterms.id='.$row_id['id'];
// // foreach ($base->query($sql2) as $row_terms) {
// // if ($terms_array[$row_terms['data']]>0){
// // $terms_array[$row_terms['data']]=$terms_array[$row_terms['data']]+1;
// // }else{
// // $terms_array[$row_terms['data']]=1;
// // }
// // }
// // }
// // natsort($terms_array);
// // $terms_list=array_keys(array_slice($terms_array,-11,-1));
// // foreach ($terms_list as $first_term) {
// // $related_terms.=$first_term.', ';
// // }
// // $news.='<br/><b><font color="#CF5300">Related terms: </font></b>'.$related_terms.'<br/>';
// //}
// calculate binomial coefficient
function binomial_coeff($n, $k) {
$j = $res = 1;
if($k < 0 || $k > $n)
return 0;
if(($n - $k) < $k)
$k = $n - $k;
while($j <= $k) {
$res *= $n--;
$res /= $j++;
}
return $res;
}
function imagestar($score,$factor,$twjs) {
// produit le html des images de score
$star_image = '';
if ($score > .5) {
$star_image = '';
for ($s = 0; $s < min(5,$score/$factor); $s++) {
$star_image.='<img src="'.$twjs.'img/star.gif" border="0" >';
}
} else {
$star_image.='<img src="'.$twjs.'img/stargrey.gif" border="0">';
}
return $star_image;
}
if($max_item_displayed>$related) $max_item_displayed=$related;
echo $news.'<br/><h4><font color="#0000FF"> Full text of top '.$max_item_displayed.'/'.$related.' related publications:</font></h4>'.$output;
//pt - 301 ; 15.30
?>
<?php
include('parameters_details.php');
$db = $gexf_db[$gexf];
$base = new PDO("sqlite:../" .$db);
$query = str_replace( '__and__', '&', $_GET["query"] );
$terms_of_query = json_decode($query);
// echo "mainpath: ".$mainpath."<br>";
// echo "thedb: ".$db."<br>";
// echo "thequery: ".var_dump($terms_of_query);
echo '
<html>
<head>
<meta charset="utf-8" />
<title>Document details</title>
<link rel="stylesheet" href="js/jquery-ui.css" />
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui.js"></script>
<script>
$(function() {
$( "#tabs" ).tabs({
collapsible: true
});
});
</script>
</head>
<body>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Selected Document</a></li>
<li><a href="full_doc_list.php?'.'gexf='.urlencode($gexf).'&query='.urlencode($_GET["query"]).'&type='.urlencode($_GET["type"]).'">Full list</a></li>';
echo '</ul>';
echo '<div id="tabs-1">';
$id=$_GET["id"];
// //$elems = json_decode($query);
// $sql = 'SELECT data FROM ISIkeyword WHERE id='.$id;
// foreach ($base->query($sql) as $row) {
// $country=$CC[strtoupper($row['data'])];
// }
$sql = 'SELECT data FROM ISITITLE WHERE id='.$id.' group by data';
foreach ($base->query($sql) as $row) {
$output.='<h2>'.$row['data'].'</h2>';
$find.="<br/><a href=http://google.com/webhp?q=".urlencode('"'.$row['data'].'"')." target='blank'>[ Search on the web ] </a>";
}
// get the authors
$sql = 'SELECT data FROM ISIAUTHOR WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.='<i>'.($row['data']).'</i>, ';
}
$output = rtrim($output, ", ");
// // // get the company
// // $sql = 'SELECT data FROM ISIC1_1 WHERE id='.$id;
// // foreach ($base->query($sql) as $row) {
// //$output.=' - '.substr($row['data'],3,strlen( $row['data'])).' ';
// //}
// get the date
$sql = 'SELECT data FROM ISIpubdate WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.=' ('.$row['data'].') ';
}
// // get the country
// $sql = 'SELECT data FROM ISIkeyword WHERE id='.$id;
// foreach ($base->query($sql) as $row) {
// $country=$CC[strtoupper($row['data'])];
// $output.=strtoupper($country).'<br/> ';
// }
// // get the date
if(strpos($_GET["index"],'terms') ) $sql = 'SELECT data FROM '.$_GET["index"].' WHERE id='.$id;
else $sql = 'SELECT data FROM ISItermsListV1 WHERE id='.$id;
$output.='<br/><b>Keywords: </b>';
$terms=array();
foreach ($base->query($sql) as $row) {
$terms[]=$row['data'];
}
natsort($terms);
$terms=array_unique($terms); // liste des termes de l'article
$keywords='';
foreach ($terms as $key => $value) {
$keywords.=$value.', ';
}
foreach ($terms_of_query as $key => $value) {
$keywords=str_replace($value,'<font color="green"><b> '.$value.'</b></font>',$keywords);
}
foreach (array_diff($terms,$terms_of_query) as $key => $value) {
$keywords=str_ireplace($value,'<font color="#800000"> '.$value.'</font>',$keywords);
}
$output.='<p align="justify">'.$keywords.'</p>';
// // get the website
$sql = 'SELECT data FROM ISISO WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.='<b>Journal: </b>'.$row['data'].'<br/> ';
}
$sql = 'SELECT data FROM ISIABSTRACT WHERE id='.$id;
// echo $output."<br>";
$abs="";
foreach ($base->query($sql) as $row) {
$abs.=". ".$row['data'];
}
$abs=str_replace('ISSUES:' ,'<br/><br/><b>Issues:</b>',$abs);
$abs=str_replace('INTENDED IMPACT:' ,'<br/><br/><b>Intended impact:</b>',$abs);
$abs=str_replace('IMPACT:' ,'<br/><br/><b>Impact:</b>',$abs);
$abs=str_replace('NOVELTY:' ,'<br/><br/><b>Novelty:</b>',$abs);
$abs=str_replace('BOLD INNOVATION:' ,'<br/><br/><b>Bold innovation:</b>',$abs);
$abs=str_replace('SOCIAL PROBLEM:' ,'<br/><br/><b>Social problem:</b>',$abs);
// solving encoding pb
$abs=str_replace('―', ' ', $abs);
$abs=str_replace('‟‟', ' ', $abs);
$abs=str_replace('„‟', ' ', $abs);
$abs=str_replace('_x000D_', ' ', $abs);
$abs=str_replace('•', ' ', $abs);
$abs=str_replace('’', '\'', $abs);
foreach ($terms_of_query as $key => $value) {
$abs=str_ireplace($value,'<font color="green"><b> '.$value.'</b></font>',$abs);
}
foreach (array_diff($terms,$terms_of_query) as $key => $value) {
$abs=str_ireplace($value,'<font color="#800000"> '.$value.'</font>',$abs);
}
$output.='<br/><p align="justify"><b>Abstract : </b><i>'.$abs.' </i></p>';
$output.="<br>";
echo $output.$find;
echo '</div>';
//echo '<div id="tabs-2">
// <p><strong>Click this tab again to close the content pane.</strong></p>
// <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
// </div>';
echo '</div>';
function pt($string){
// juste pour afficher avec retour à la ligne
echo $string."<br/>";
}
function pta($array){
print_r($array);
echo '<br/>';
}
?>
<?php
include('parameters_details.php');
$db = $gexf_db[$gexf];
$base = new PDO("sqlite:../" ."data/terrorism/data.db");
$query = str_replace( '__and__', '&', $_GET["query"] );
$terms_of_query = json_decode($query);
// echo "mainpath: ".$mainpath."<br>";
// echo "thedb: ".$db."<br>";
// echo "thequery: ".var_dump($terms_of_query);
echo '
<html>
<head>
<meta charset="utf-8" />
<title>Document details</title>
<link rel="stylesheet" href="js/jquery-ui.css" />
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui.js"></script>
<script>
$(function() {
$( "#tabs" ).tabs({
collapsible: true
});
});
</script>
</head>
<body>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Selected Document</a></li>
<li><a href="full_doc_list2.php?'.'gexf='.urlencode($gexf).'&query='.urlencode($_GET["query"]).'&type='.urlencode($_GET["type"]).'">Full list</a></li>';
echo '</ul>';
echo '<div id="tabs-1">';
$id=$_GET["id"];
// //$elems = json_decode($query);
// $sql = 'SELECT data FROM ISIkeyword WHERE id='.$id;
// foreach ($base->query($sql) as $row) {
// $country=$CC[strtoupper($row['data'])];
// }
$sql = 'SELECT data FROM ID WHERE id='.$id.' group by data';
foreach ($base->query($sql) as $row) {
$output.='<h2>Project Identification: '.$row['data'].'</h2>';
}
$sql = 'SELECT data FROM TI WHERE id='.$id.' group by data';
foreach ($base->query($sql) as $row) {
$output.='<h2>'.$row['data'].'</h2>';
$find.="<br/><a href=http://google.com/webhp?q=".urlencode('"'.$row['data'].'"')." target='blank'>[ Search on the web ] </a>";
}
// get the authors
$sql = 'SELECT data FROM PI WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.='<i>'.($row['data']).'</i>, ';
}
$output = rtrim($output, ", ");
// // // get the company
// // $sql = 'SELECT data FROM ISIC1_1 WHERE id='.$id;
// // foreach ($base->query($sql) as $row) {
// //$output.=' - '.substr($row['data'],3,strlen( $row['data'])).' ';
// //}
$output.=' (2014) ';
// // get the country
// $sql = 'SELECT data FROM ISIkeyword WHERE id='.$id;
// foreach ($base->query($sql) as $row) {
// $country=$CC[strtoupper($row['data'])];
// $output.=strtoupper($country).'<br/> ';
// }
// // get the date
// $sql = 'SELECT data FROM '."ISItermsBigWL".' WHERE id='.$id;
$sql = 'SELECT data FROM ISItermsfirstindexing WHERE id='.$id;
$output.='<br/><b>Keywords: </b>';
$terms=array();
foreach ($base->query($sql) as $row) {
$terms[]=$row['data'];
}
natsort($terms);
$terms=array_unique($terms); // liste des termes de l'article
$keywords='';
foreach ($terms as $key => $value) {
$keywords.=$value.', ';
}
foreach ($terms_of_query as $key => $value) {
$keywords=str_replace($value,'<font color="green"><b> '.$value.'</b></font>',$keywords);
}
foreach (array_diff($terms,$terms_of_query) as $key => $value) {
$keywords=str_ireplace($value,'<font color="#800000"> '.$value.'</font>',$keywords);
}
$output.='<p align="justify">'.$keywords.'</p>';
// // get the website
$sql = 'SELECT data FROM AG1 WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.='<b>Agency: </b>'.$row['data'].'<br/> ';
}
$sql = 'SELECT data FROM ABS WHERE id='.$id;
// echo $output."<br>";
$abs="";
foreach ($base->query($sql) as $row) {
$abs.=". ".$row['data'];
}
$abs=str_replace('ISSUES:' ,'<br/><br/><b>Issues:</b>',$abs);
$abs=str_replace('INTENDED IMPACT:' ,'<br/><br/><b>Intended impact:</b>',$abs);
$abs=str_replace('IMPACT:' ,'<br/><br/><b>Impact:</b>',$abs);
$abs=str_replace('NOVELTY:' ,'<br/><br/><b>Novelty:</b>',$abs);
$abs=str_replace('BOLD INNOVATION:' ,'<br/><br/><b>Bold innovation:</b>',$abs);
$abs=str_replace('SOCIAL PROBLEM:' ,'<br/><br/><b>Social problem:</b>',$abs);
// solving encoding pb
$abs=str_replace('―', ' ', $abs);
$abs=str_replace('‟‟', ' ', $abs);
$abs=str_replace('„‟', ' ', $abs);
$abs=str_replace('_x000D_', ' ', $abs);
$abs=str_replace('•', ' ', $abs);
$abs=str_replace('’', '\'', $abs);
foreach ($terms_of_query as $key => $value) {
$abs=str_ireplace($value,'<font color="green"><b> '.$value.'</b></font>',$abs);
}
foreach (array_diff($terms,$terms_of_query) as $key => $value) {
$abs=str_ireplace($value,'<font color="#800000"> '.$value.'</font>',$abs);
}
$output.='<br/><p align="justify"><b>Abstract : </b><i>'.$abs.' </i></p>';
$output.="<br>";
echo $output.$find;
echo '</div>';
//echo '<div id="tabs-2">
// <p><strong>Click this tab again to close the content pane.</strong></p>
// <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
// </div>';
echo '</div>';
function pt($string){
// juste pour afficher avec retour à la ligne
echo $string."<br/>";
}
function pta($array){
print_r($array);
echo '<br/>';
}
?>
<?php
$db= $_GET["db"];//I receive the specific database as string!
$terms_of_query=json_decode($_GET["query"]);
include('parameters_details.php');
$base = new PDO("sqlite:" .$mainpath.$db);
$query=$_GET["query"];
$gexf=$_GET["gexf"];
$max_tag_could_size=15;
$output = "<ul>"; // string sent to the javascript for display
$type = $_GET["type"];
$sql='SELECT id from favorites';
$wos_ids=array(); // favorite list
$num_favorite=0;
$count=0;
foreach ($base->query($sql) as $row){
$wos_ids[$row['id']] = 1;
$num_favorite+=1;
}
$favorite_keywords=array();
foreach ($wos_ids as $id => $score) {
if ($count<1000){
// retrieve publication year
$sql = 'SELECT data FROM ISIpubdate WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$pubdate=$row['data'];
}
$count+=1;
$output.="<li >";
$sql = 'SELECT data FROM ISItermsListV1 WHERE id='.$id;
foreach ($base->query($sql) as $row) {
if (array_key_exists($row['data'], $favorite_keywords)){
$favorite_keywords[$row['data']]=$favorite_keywords[$row['data']]+1;
}else{
$favorite_keywords[$row['data']]=1;
}
}
$sql = 'SELECT data FROM ISITITLE WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.='<a href="default_doc_details.php?db='.urlencode($db).'&type='.urlencode($_GET["type"]).'&query='.urlencode($query).'&id='.$id.'">'.$row['data']." </a> ";
//this should be the command:
//$output.='<a href="JavaScript:newPopup(\''.$twjs.'php/default_doc_details.php?db='.urlencode($datadb).'&id='.$id.' \')">'.$row['data']." </a> ";
//the old one:
//$output.='<a href="JavaScript:newPopup(\''.$twjs.'php/default_doc_details.php?id='.$id.' \')">'.$row['data']." </a> ";
$external_link="<a href=http://scholar.google.com/scholar?q=".urlencode('"'.$row['data'].'"')." target=blank>".' <img width=20px src="img/gs.png"></a>';
//$output.='<a href="JavaScript:newPopup(''php/doc_details.php?id='.$id.''')"> Link</a>';
}
// get the authors
$sql = 'SELECT data FROM ISIAUTHOR WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.=strtoupper($row['data']).', ';
}
if($project_folder!='nci'){
$output.='('.$pubdate.') ';
}else {
$output.='(2013) ';
}
// get the country
$sql = 'SELECT data FROM ISIkeyword WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$country=$CC[strtoupper($row['data'])];
$output.=strtoupper($country).' ';
}
//<a href="JavaScript:newPopup('http://www.quackit.com/html/html_help.cfm');">Open a popup window</a>'
$output.=$external_link."</li><br>";
}else{
continue;
}
}
arsort($favorite_keywords);
$tag_coud_size=0;
$tag_could='';
foreach ($favorite_keywords as $key => $value) {
if ($tag_coud_size<$max_tag_could_size){
$tag_coud_size+=1;
$tag_could.='<font size="'.(3+log($value)).'">'.$key.', </font>';
}else{
continue;
} # code...
}
$output= '<h3>'.$num_favorite.' favorite items </h3>'.$tag_could.'<br/>'.$output;
echo $output;
function imagestar($score,$factor,$twjs) {
// produit le html des images de score
$star_image = '';
if ($score > .5) {
$star_image = '';
for ($s = 0; $s < min(5,$score/$factor); $s++) {
$star_image.='<img src="img/star.gif" border="0" >';
}
} else {
$star_image.='<img src="img/stargrey.gif" border="0">';
}
return $star_image;
}
?>
<?php
include('parameters_details.php');
$db = $gexf_db[$gexf];
$base = new PDO("sqlite:../" .$db);
$output = "<ul>"; // string sent to the javascript for display
#http://localhost/branch_ademe/php/test.php?type=social&query=[%22marwah,%20m%22]
$type = $_GET["type"];
$query = str_replace( '__and__', '&', $_GET["query"] );
$terms_of_query=json_decode($_GET["query"]);
$elems = json_decode($query);
// nombre d'item dans les tables
$sql='SELECT COUNT(*) FROM ISIABSTRACT';
foreach ($base->query($sql) as $row) {
$table_size=$row['COUNT(*)'];
}
$table = "";
$column = "";
$id="";
$twjs="API_CNRS/"; // submod path of TinaWebJS
if($type=="social"){
$table = "ISIAUTHOR";
$column = "data";
$id = "id";
$restriction='';
$factor=10;// factor for normalisation of stars
}
if($type=="semantic"){
$table = "ISItermsListV1";
$column = "data";
$id = "id";
$restriction='';
$factor=10;
}
$sql = 'SELECT count(*),'.$id.'
FROM '.$table.' where (';
foreach($elems as $elem){
$sql.=' '.$column.'="'.$elem.'" OR ';
}
#$querynotparsed=$sql;#####
$sql = substr($sql, 0, -3);
$sql = str_replace( ' & ', '" OR '.$column.'="', $sql );
$sql.=')'.$restriction.'
GROUP BY '.$id.'
ORDER BY count('.$id.') DESC
LIMIT 1000';
#$queryparsed=$sql;#####
$wos_ids = array();
$sum=0;
//The final query!
// array of all relevant documents with score
foreach ($base->query($sql) as $row) {
// on pondère le score par le nombre de termes mentionnés par l'article
//$num_rows = $result->numRows();
$wos_ids[$row[$id]] = $row["count(*)"];
$sum = $row["count(*)"] +$sum;
}
//arsort($wos_ids);
$number_doc=ceil(count($wos_ids)/3);
$count=0;
foreach ($wos_ids as $id => $score) {
if ($count<1000){
// retrieve publication year
$sql = 'SELECT data FROM ISIpubdate WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$pubdate=$row['data'];
}
// to filter under some conditions
$to_display=true;
if ($to_display){
$count+=1;
$output.="<li title='".$score."'>";
$output.=imagestar($score,$factor,$twjs).' ';
$sql = 'SELECT data FROM ISITITLE WHERE id='.$id." group by data";
foreach ($base->query($sql) as $row) {
$output.='<a href="default_doc_details.php?gexf='.urlencode($gexf).'&type='.urlencode($_GET["type"]).'&query='.urlencode($query).'&id='.$id.'">'.$row['data']." </a> ";
//this should be the command:
//$output.='<a href="JavaScript:newPopup(\''.$twjs.'php/default_doc_details.php?db='.urlencode($datadb).'&id='.$id.' \')">'.$row['data']." </a> ";
//the old one:
//$output.='<a href="JavaScript:newPopup(\''.$twjs.'php/default_doc_details.php?id='.$id.' \')">'.$row['data']." </a> ";
$external_link="<a href=http://scholar.google.com/scholar?q=".urlencode('"'.$row['data'].'"')." target=blank>".' <img width=20px src="img/gs.png"></a>';
//$output.='<a href="JavaScript:newPopup(''php/doc_details.php?id='.$id.''')"> Link</a>';
}
// get the authors
$sql = 'SELECT data FROM ISIAUTHOR WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.=strtoupper($row['data']).', ';
}
//<a href="JavaScript:newPopup('http://www.quackit.com/html/html_help.cfm');">Open a popup window</a>'
$output.=$external_link."</li><br>";
}
}else{
continue;
}
}
$output= '<h3>'.$count.' items related to: '.implode(' OR ', $elems).'</h3>'.$output;
echo $output;
function imagestar($score,$factor,$twjs) {
// produit le html des images de score
$star_image = '';
if ($score > .5) {
$star_image = '';
for ($s = 0; $s < min(5,$score/$factor); $s++) {
$star_image.='<img src="img/star.gif" border="0" >';
}
} else {
$star_image.='<img src="img/stargrey.gif" border="0">';
}
return $star_image;
}
?>
<?php
include('parameters_details.php');
$db = $gexf_db[$gexf];
$base = new PDO("sqlite:../" ."data/terrorism/data.db");
echo "sqlite:../" ."data/terrorism/data.db";
$output = "<ul>"; // string sent to the javascript for display
#http://localhost/branch_ademe/php/test.php?type=social&query=[%22marwah,%20m%22]
$type = $_GET["type"];
$query = str_replace( '__and__', '&', $_GET["query"] );
$terms_of_query=json_decode($_GET["query"]);
$elems = json_decode($query);
// nombre d'item dans les tables
$sql='SELECT COUNT(*) FROM ISIABSTRACT';
foreach ($base->query($sql) as $row) {
$table_size=$row['COUNT(*)'];
}
$table = "";
$column = "";
$id="";
$twjs="pasteurapi/"; // submod path of TinaWebJS
if($type=="social"){
$table = "ISIAUTHOR";
$column = "data";
$id = "id";
$restriction='';
$factor=10;// factor for normalisation of stars
}
if($type=="semantic"){
$table = "ISItermsListV1";
$column = "data";
$id = "id";
$restriction='';
$factor=10;
}
$sql = 'SELECT count(*),'.$id.'
FROM '.$table.' where (';
foreach($elems as $elem){
$sql.=' '.$column.'="'.$elem.'" OR ';
}
#$querynotparsed=$sql;#####
$sql = substr($sql, 0, -3);
$sql = str_replace( ' & ', '" OR '.$column.'="', $sql );
$sql.=')'.$restriction.'
GROUP BY '.$id.'
ORDER BY count('.$id.') DESC
LIMIT 1000';
#$queryparsed=$sql;#####
$wos_ids = array();
$sum=0;
//The final query!
// array of all relevant documents with score
foreach ($base->query($sql) as $row) {
// on pondère le score par le nombre de termes mentionnés par l'article
//$num_rows = $result->numRows();
$wos_ids[$row[$id]] = $row["count(*)"];
$sum = $row["count(*)"] +$sum;
}
//arsort($wos_ids);
$number_doc=ceil(count($wos_ids)/3);
$count=0;
foreach ($wos_ids as $id => $score) {
if ($count<1000){
// retrieve publication year
$sql = 'SELECT data FROM ISIpubdate WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$pubdate="2014";
}
// to filter under some conditions
$to_display=true;
if ($to_display){
$count+=1;
$output.="<li title='".$score."'>";
$output.=imagestar($score,$factor,$twjs).' ';
$sql = 'SELECT data FROM ISITITLE WHERE id='.$id." group by data";
foreach ($base->query($sql) as $row) {
$output.='<a href="default_doc_details2.php?gexf='.urlencode($gexf).'&type='.urlencode($_GET["type"]).'&query='.urlencode($query).'&id='.$id.'">'.$row['data']." </a> ";
//this should be the command:
//$output.='<a href="JavaScript:newPopup(\''.$twjs.'php/default_doc_details.php?db='.urlencode($datadb).'&id='.$id.' \')">'.$row['data']." </a> ";
//the old one:
//$output.='<a href="JavaScript:newPopup(\''.$twjs.'php/default_doc_details.php?id='.$id.' \')">'.$row['data']." </a> ";
$external_link="<a href=http://scholar.google.com/scholar?q=".urlencode('"'.$row['data'].'"')." target=blank>".' <img width=20px src="img/gs.png"></a>';
//$output.='<a href="JavaScript:newPopup(''php/doc_details.php?id='.$id.''')"> Link</a>';
}
// get the authors
$sql = 'SELECT data FROM ISIAUTHOR WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.=strtoupper($row['data']).', ';
}
//<a href="JavaScript:newPopup('http://www.quackit.com/html/html_help.cfm');">Open a popup window</a>'
$output.=$external_link."</li><br>";
}
}else{
continue;
}
}
$output= '<h3>'.$count.' items related to: '.implode(' OR ', $elems).'</h3>'.$output;
echo $output;
function imagestar($score,$factor,$twjs) {
// produit le html des images de score
$star_image = '';
if ($score > .5) {
$star_image = '';
for ($s = 0; $s < min(5,$score/$factor); $s++) {
$star_image.='<img src="img/star.gif" border="0" >';
}
} else {
$star_image.='<img src="img/stargrey.gif" border="0">';
}
return $star_image;
}
?>
<?php
include('parameters_details.php');
$db= $_GET["db"];//I receive the specific database as string!
$query=$_GET["query"];
$gexf=$_GET["gexf"];
$base = new PDO("sqlite:" .$mainpath.$db);
$temp=explode('/',$db);
$project_folder=$temp[1];
$corpora=$temp[count($temp)-2];
$corporadb = new PDO("sqlite:" .$mainpath.'data/'.$corpora.'/'.$corpora.'.sqlite'); //data base with complementary data
$output = "<ul>"; // string sent to the javascript for display
#http://localhost/branch_ademe/php/test.php?type=social&query=[%22marwah,%20m%22]
$type = $_GET["type"];
$query = str_replace( '__and__', '&', $_GET["query"] );
$elems = json_decode($query);
// nombre d'item dans les tables
$sql='SELECT COUNT(*) FROM ISIABSTRACT';
foreach ($base->query($sql) as $row) {
$table_size=$row['COUNT(*)'];
}
///// Specific to rock //////////
// Other restrictions
// extracting the project folder and the year
if (strpos($gexf,'2013')>0){
$year='2013';
$year_filter=true;
}elseif (strpos($gexf,'2012')>0){
$year='2012';
$year_filter=true;
}else{
$year_filter=false;
}
// identification d'une année pour echoing
if($project_folder=='nci'){
$year_filter=true;
}
$table = "";
$column = "";
$id="";
$twjs="tinawebJS/"; // submod path of TinaWebJS
if($type=="social"){
$table = "ISIAUTHOR";
$column = "data";
$id = "id";
$restriction='';
$factor=10;// factor for normalisation of stars
}
if($type=="semantic"){
$table = "ISItermsListV1";
$column = "data";
$id = "id";
$restriction='';
$factor=10;
}
// identification d'une année pour echoing
if($project_folder=='nci'){
$restriction.=" AND ISIpubdate='2013'";
}
$sql = 'SELECT sum(tfidf),id
FROM tfidf where (';
foreach($elems as $elem){
$sql.=' term="'.$elem.'" OR ';
}
#$querynotparsed=$sql;#####
$sql = substr($sql, 0, -3);
$sql = str_replace( ' & ', '" OR term="', $sql );
$sql.=')'.//$restriction.
'GROUP BY '.$id.'
ORDER BY sum(tfidf) DESC
LIMIT 1000';
//echo $sql;
#$queryparsed=$sql;#####
$wos_ids = array();
$sum=0;
//echo $sql;//The final query!
// array of all relevant documents with score
$count=0;
foreach ($corporadb ->query($sql) as $row) {
//if ($count<4*$max_item_displayed){
$wos_ids[$row[$id]] = $row['sum(tfidf)'];//$row["count(*)"];
$sum = $row["count(*)"] +$sum;
//}else{
// continue;
//}
}
//arsort($wos_ids);
$number_doc=ceil(count($wos_ids)/3);
$count=0;
foreach ($wos_ids as $id => $score) {
if ($count<1000){
// retrieve publication year
$sql = 'SELECT data FROM ISIpubdate WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$pubdate=$row['data'];
}
// to filter under some conditions
$to_display=true;
if ($project_folder=='echoing'){
if ($year_filter){
if ($pubdate!=$year){
$to_display=false;
}
}
}elseif($project_folder=='nci'){
if ($year_filter){
if ($pubdate!='2013'){
$to_display=false;
}
}
}
if ($to_display){
$count+=1;
$output.="<li title='".$score."'>";
$output.=imagestar($score,$factor,$twjs).' ';
$sql = 'SELECT data FROM ISITITLE WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.='<a href="default_doc_details.php?db='.urlencode($db).'&type='.urlencode($_GET["type"]).'&query='.urlencode($query).'&id='.$id.'">'.$row['data']." </a> ";
//this should be the command:
//$output.='<a href="JavaScript:newPopup(\''.$twjs.'php/default_doc_details.php?db='.urlencode($datadb).'&id='.$id.' \')">'.$row['data']." </a> ";
//the old one:
//$output.='<a href="JavaScript:newPopup(\''.$twjs.'php/default_doc_details.php?id='.$id.' \')">'.$row['data']." </a> ";
$external_link="<a href=http://scholar.google.com/scholar?q=".urlencode('"'.$row['data'].'"')." target=blank>".' <img width=20px src="img/gs.png"></a>';
//$output.='<a href="JavaScript:newPopup(''php/doc_details.php?id='.$id.''')"> Link</a>';
}
// get the authors
$sql = 'SELECT data FROM ISIAUTHOR WHERE id='.$id;
foreach ($base->query($sql) as $row) {
$output.=strtoupper($row['data']).', ';
}
if($project_folder!='nci'){
$output.='('.$pubdate.') ';
}else {
$output.='(2013) ';
}
//<a href="JavaScript:newPopup('http://www.quackit.com/html/html_help.cfm');">Open a popup window</a>'
$output.=$external_link."</li><br>";
}
}else{
continue;
}
}
$output= '<h3>'.$count.' items related to: '.implode(' OR ', $elems).'</h3>'.$output;
echo $output;
function imagestar($score,$factor,$twjs) {
// produit le html des images de score
$star_image = '';
if ($score > .5) {
$star_image = '';
for ($s = 0; $s < min(5,$score/$factor); $s++) {
$star_image.='<img src="img/star.gif" border="0" >';
}
} else {
$star_image.='<img src="img/stargrey.gif" border="0">';
}
return $star_image;
}
?>
<?php
// manage the dynamical additional information in the left panel.
// ini_set('display_errors',1);
// ini_set('display_startup_errors',1);
// error_reporting(-1);
include('parameters_details.php');
$max_item_displayed=6;
$base = new PDO("sqlite:../" .$graphdb);
include('default_div.php');
/*
* This function gets the first db name in the data folder
* IT'S NOT SCALABLE! (If you want to use several db's)
*/
function getDB ($directory) {
//$results = array();
$result = "";
$handler = opendir($directory);
while ($file = readdir($handler)) {
if ($file != "." && $file != ".."
&&
((strpos($file,'.db~'))==false && (strpos($file,'.db'))==true )
||
((strpos($file,'.sqlite~'))==false && (strpos($file,'.sqlite'))==true)
) {
//$results[] = $file;
$result = $file;
break;
}
}
closedir($handler);
//return $results;
return $result;
}
?>
<?php
// manage the dynamical additional information in the left panel.
// include('parameters_details.php');
$gexf= str_replace('"','',$_GET["gexf"]);
$max_item_displayed=6;
$type = $_GET["type"];
$TITLE="ISITITLE";
$query = str_replace( '__and__', '&', $_GET["query"] );
$elems = json_decode($query);
$table = "";
$column = "";
$id="";
$twjs="API_CNRS/"; // submod path of TinaWebJS
if($type=="semantic"){
$table = "ISItermsListV1";
$column = "data";
$id = "id";
$restriction='';
$factor=10;
}
$restriction='';
$factor=10;
$sql="";
if (count($elems)==1){// un seul mot est sélectionné, on compte les mots multiples
$sql = 'SELECT count(*),'.$id.'
FROM '.$table.' where (';
foreach($elems as $elem){
$sql.=' '.$column.'="'.$elem.'" OR ';
}
#$querynotparsed=$sql;#####
$sql = substr($sql, 0, -3);
$sql = str_replace( ' & ', '" OR '.$column.'="', $sql );
$sql.=')'.$restriction.'
GROUP BY '.$id.'
ORDER BY count('.$id.') DESC
LIMIT 1000';
}else{// on compte une seule fois un mot dans un article
$factor=ceil(count($elems)/5); //les scores sont moins haut
$sql='';
foreach($elems as $elem){
$sql.=' '.$column.'="'.$elem.'" OR ';
}
$sql=substr($sql, 0, -3);
$sql='SELECT count(*),id,data FROM (SELECT *
FROM '.$table.' where ('.$sql.')'.$restriction.'
group by id,data) GROUP BY '.$id.'
ORDER BY count('.$id.') DESC
LIMIT 1000 COLLATE NOCASE';
}
// echo $sql."<br>";
$base = new PDO("sqlite:../data/terrorism/data.db");
$wos_ids = array();
$sum=0;
//The final query!
// array of all relevant documents with score
foreach ($base->query($sql) as $row) {
// on pondère le score par le nombre de termes mentionnés par l'article
//$num_rows = $result->numRows();
$wos_ids[$row[$id]] = $row["count(*)"];
$sum = $row["count(*)"] +$sum;
}
// /// nombre de document associés $related
$total_count=0;
$count_max=500;
$number_doc=count($wos_ids);
$count=0;
$all_terms_from_selected_projects=array();// list of terms for the top 6 project selected
// to filter under some conditions
$to_display=true;
$count=0;
foreach ($wos_ids as $id => $score) {
if ($total_count<$count_max) {
// retrieve publication year
if ($to_display){
$total_count+=1;
if ($count<=$max_item_displayed){
$count+=1;
$sql = 'SELECT data FROM ISITITLE WHERE id='.$id.' group by data';
foreach ($base->query($sql) as $row) {
$external_link="<a href=http://google.com/webhp?#q=".urlencode('"'.utf8_decode($row['data']).'"')." target=blank>".' <img width=15px src="'.$twjs.'img/google.png"></a>';
$output.="<li title='".$score."'>";
$output.=$external_link.imagestar($score,$factor,$twjs).' ';
$output.='<a href="JavaScript:newPopup(\''.$twjs.'default_doc_details2.php?gexf='.urlencode($gexf).'&query='.urlencode($query).'&type='.urlencode($_GET["type"]).'&id='.$id.' \')">'.htmlentities($row['data'], ENT_QUOTES, "UTF-8")." </a> ";
// $output.='<a>'.htmlentities($row['data'], ENT_QUOTES, "UTF-8")." </a> ";
}
$sql = 'SELECT data FROM ISIDOI WHERE id='.$id.' group by data';
foreach ($base->query($sql) as $row) {
$output.=$external_link.imagestar($score,$factor,$twjs).' ';
$output.='<a href="JavaScript:newPopup(\''.$twjs.'default_doc_details2.php?gexf='.urlencode($gexf).'&query='.urlencode($query).'&type='.urlencode($_GET["type"]).'&id='.$id.' \')">'.htmlentities($row['data'], ENT_QUOTES, "UTF-8")." </a> ";
} // get the authors
$sql2 = 'SELECT data FROM ISIAUTHOR WHERE id='.$id. ' group by data';
foreach ($base->query($sql2) as $row2) {
$output.=(str_replace("\r", "", $row2['data'])).', ';
}
$output = rtrim($output, ", ");
$output.="</li><br>";
}
}
} else{
continue;
}
}
if ($total_count<$count_max){
$related .= $total_count;
}else{
$related .= ">".$count_max;
}
$output .= "</ul>"; #####
// echo $output."<br>";
if($max_item_displayed>$related) $max_item_displayed=$related;
echo $news.'<br/><h4><font color="#0000FF"> Full text of top '.$max_item_displayed.'/'.$related.' related grant proposals:</font></h4>'.$output;
//pt - 301 ; 15.30
/*
* This function gets the first db name in the data folder
* IT'S NOT SCALABLE! (If you want to use several db's)
*/
function getDB ($directory) {
//$results = array();
$result = "";
$handler = opendir($directory);
while ($file = readdir($handler)) {
if ($file != "." && $file != ".."
&&
((strpos($file,'.db~'))==false && (strpos($file,'.db'))==true )
||
((strpos($file,'.sqlite~'))==false && (strpos($file,'.sqlite'))==true)
) {
//$results[] = $file;
$result = $file;
break;
}
}
closedir($handler);
//return $results;
return $result;
}
function imagestar($score,$factor,$twjs) {
// produit le html des images de score
$star_image = '';
if ($score > .5) {
$star_image = '';
for ($s = 0; $s < min(5,$score/$factor); $s++) {
$star_image.='<img src="'.$twjs.'img/star.gif" border="0" >';
}
} else {
$star_image.='<img src="'.$twjs.'img/stargrey.gif" border="0">';
}
return $star_image;
}
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
header ("Content-Type:application/json");
//$string = getcwd();
//$string = str_replace("/php","",$string);
$string=dirname(dirname(getcwd())); // ProjectExplorer folder name: /var/www/ademe
//$files = getDirectoryList($string."/data");
include("DirectoryScanner.php");
$projectFolderPat = dirname(dirname(getcwd())) . "/";
$instance = new scanTree($projectFolderPat);
$instance->getDirectoryTree("data");
$gexfs=$instance->gexf_folder;
$files=array();
foreach($gexfs as $key => $value){
array_push($files,$key);
}
$filesSorted=array();
foreach($files as $file){
array_push($filesSorted,$file);
}
sort($filesSorted);
echo json_encode($filesSorted);
function getDirectoryList ($directory) {
$results = array();
$handler = opendir($directory);
while ($file = readdir($handler)) {
if ($file != "." && $file != ".." &&
(strpos($file,'.gexf~'))==false &&
(strpos($file,'.gexf'))==true) {
$results[] = $file;
}
}
closedir($handler);
return $results;
}
?>
<?php
$gexf_db = array();
$gexf_db["data/medq1/20141208_MED_01_bi.gexf"] = "data/medq1/01_medline-query1.db";
$gexf_db["data/medq2/20141128_MED_02_bi.gexf"] = "data/medq2/02_medline-query2.db";
$gexf_db["data/medq2/20141128_MED_03_bi.gexf"] = "data/medq2/02_medline-query2.db";
$gexf_db["data/medq2/20141208_MED_Author_name-ISItermsjulien_index.gexf"] = "data/medq2/02_medline-query2.db";
$gexf_db["data/20141128_GPs_03_bi.gexf"] = "data/00_grantproposals.db";
$gexf_db["data/20141215_GPs_04.gexf"] = "data/00_grantproposals.db";
# new stuff
$gexf_db["data/terrorism/terrorism_mono.gexf"] = "data/terrorism/data.db";
$gexf_db["data/terrorism/terrorism_bi.gexf"] = "data/terrorism/data.db";
# new stuff2
$gexf_db["data/ClimateChange/hnetwork-2014_2015hhn-wosclimatechange2014_2015top509-ISItermsListV3bis-ISItermsListV3bis-distributionalcooc-99999-oT0.36-20-louTrue.gexf"] = "data/ClimateChange/wosclimatechange-61715-1-wosclimatechange-db(2).db";
$gexf_db["data/ClimateChange/ClimateChangeV1.gexf"] = "data/ClimateChange/wosclimatechange-61715-1-wosclimatechange-db(2).db";
$gexf_db["data/ClimateChange/hnetwork-2014_2015hn-wosclimatechange2014_2015top509-ISItermsListV3bis-ISItermsListV3bis-distributionalcooc-99999-oT0.36-20-louTrue.gexf"] = "data/ClimateChange/wosclimatechange-61715-1-wosclimatechange-db(2).db";
$gexf= str_replace('"','',$_GET["gexf"]);
$mainpath=dirname(getcwd())."/";
$graphdb = $gexf_db[$gexf];
?>
<?php
echo '<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>';
// compute the tfidf score for each terms for each document for cortext like databases and store them in a specific table
//include('parameters_details.php');
$db = new PDO("sqlite:graph.db");
$database_name='echoing.sqlite';
$project_base = new PDO("sqlite:" .$database_name);
// Table creation
// efface la base existante
$project_base->exec("DROP TABLE IF EXIST tfidf");
pt("creation of tfidf table");
//on crée un table pour les infos de clusters
$project_base->exec("CREATE TABLE tfidf (id NUMERIC,term TEXT,tfidf NUMERIC)");
//generating number of mention of terms in the corpora
$terms_freq=array();
pt('processing terms frequency');
$sql='SELECT count(*),data FROM ISItermsListV1 group by data';
foreach ($db->query($sql) as $term) {
$terms_freq[$term['data']]=$term['count(*)'];
}
pt('processing number of doc');
// nombre d'iterator_apply(iterator, function)em dans les tables
$sql='SELECT COUNT(*) FROM ISIABSTRACT';
foreach ($db->query($sql) as $row) {
$table_size=$row['COUNT(*)'];
}
pt($table_size.' documents in database');
// select all the doc
$sql='SELECT * FROM ISIABSTRACT';
foreach ($db->query($sql) as $doc) {
$id=$doc['id'];
pt($id);
//select all the terms of that document with their occurrences
$sql2="SELECT count(*),data FROM ISItermsListV1 where id='".$id."' group by data";
// for each term we compute the tfidf
foreach ($db->query($sql2) as $term_data) {
$term=$term_data['data'];
$term_occ_in_doc=$term_data['count(*)'];
$terms_tfidf=log(1+$term_occ_in_doc)*log($table_size/$terms_freq[$term]);
$query='INSERT INTO tfidf (id,term,tfidf) VALUES ('.$id.',"'.$term.'",'.$terms_tfidf.')';
$project_base->query($query);
}
}
function pt ($string) {
echo $string.'<br/>';
}
?>
{
"data/ClimateChange": {
"dbname":"wosclimatechange-61490-1-wosclimatechange-db.db",
"title":"ISITITLE",
"date":"ISIpubdate",
"abstract":"ISIABSTRACT",
"gexfs": {
"hnetwork-2014_2015hn-wosclimatechange2014_2015top509-ISItermsListV3bis-ISItermsListV3bis-distributionalcooc-99999-oT0.36-20-louTrue.gexf": {
"social": { "table":"ISIAUTHOR" , "textCol":"data","forkeyCol":"id"},
"semantic": { "table":"ISItermsListV3bis" , "textCol":"data","forkeyCol":"id"}
},
"ClimateChangeV1.gexf": {
"social": { "table":"ISIAUTHOR" , "textCol":"data","forkeyCol":"id"},
"semantic": { "table":"ISItermsListV3bis" , "textCol":"data","forkeyCol":"id"}
}
}
},"data/terrorism": {
"dbname":"data.db",
"title":"ISITITLE",
"date":"ISIpubdate",
"abstract":"ISIABSTRACT",
"gexfs": {
"terrorism_bi.gexf": {
"social": { "table":"ISIAUTHOR" , "textCol":"data","forkeyCol":"id"},
"semantic": { "table":"ISItermsListV1" , "textCol":"data","forkeyCol":"id"}
},
"terrorism_mono.gexf":{
"semantic": { "table":"ISItermsListV1" , "textCol":"data","forkeyCol":"id"}
}
}
},
"data/medq2/": {
"dbname":"02_medline-query2.db",
"title":"ArticleTitle",
"date":"ISIpubdate",
"abstract":"Abstract",
"gexfs": {
"20141208_MED_Author_name-ISItermsjulien_index.gexf": {
"social": { "table":"Author_name" , "textCol":"data","forkeyCol":"id"},
"semantic": { "table":"ISItermsBigWL" , "textCol":"data","forkeyCol":"id"}
}
}
}
}
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
#heatgraph {
/*border: 1px solid #000;*/
width: 700px;
height:50px;
bottom: 10px;
position:absolute;
left: 0;
right: 0;
margin: 0 auto;
}
.loader{
text-align:center;
transform: translate(0, 50%) !important;
......@@ -24,6 +35,70 @@
float:left;
}
.clusters_legend {
position:absolute;
bottom:1px;
left:1px;
border:solid 1px red;
font-size:xx-small;
}
.my-legend {
position:absolute;
bottom:5px;
left:5px;
background-color:white;
opacity: 0.8;
color:#250587;
margin: 7px;
padding: 5px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-border-radius: 3px;
-moz-box-shadow: 0px 2px 6px #000;
-webkit-box-shadow: 0px 2px 6px #000;
box-shadow: 0px 2px 6px #000;
}
.my-legend .legend-title {
text-align: left;
margin-bottom: 5px;
font-weight: bold;
font-size: 90%;
}
.my-legend .legend-scale ul {
margin: 0;
margin-bottom: 5px;
padding: 0;
float: left;
list-style: none;
}
.my-legend .legend-scale ul li {
font-size: 80%;
list-style: none;
margin-left: 0;
line-height: 18px;
margin-bottom: 2px;
}
.my-legend ul.legend-labels li span {
display: block;
float: left;
height: 16px;
width: 30px;
margin-right: 5px;
margin-left: 0;
border: 1px solid #999;
}
.my-legend .legend-source {
font-size: 70%;
color: #999;
clear: both;
}
.my-legend a {
color: #777;
}
/*.btn-sm[normal] {*/
/* background-image: -webkit-linear-gradient(#5f8ab9, #3e648d 50%, #385a7f);*/
......@@ -38,10 +113,6 @@
display: inline-block;
}
@-moz-document url-prefix() {
#category-A ul li { margin: 0 12px 12px 0; }
#category-B ul li { margin: 0 12px 12px 0; }
}
/*.modal-vertical-centered {*/
......@@ -121,6 +192,23 @@
}
#topProposals{
margin: 7px;
padding: 10px 0px 10px 10px;
border-style:solid;
background-color:white;
color:black;
margin: 7px;
border: 1px solid #666;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-border-radius: 3px;
-moz-box-shadow: 0px 2px 6px #000;
-webkit-box-shadow: 0px 2px 6px #000;
box-shadow: 0px 2px 6px #000;
}
.grey {
color: #cccccc; font-style: italic;
}
......@@ -136,7 +224,7 @@
/* ZOOM IN OUT */
#ctlzoom {
position: absolute; right: 400px; bottom: 5px; list-style: none; padding: 0; margin: 0;/*EDIT*/
position: absolute; right: 300px; bottom: 5px; list-style: none; padding: 0; margin: 0;/*EDIT*/
}
#ctlzoom li {
......@@ -291,4 +379,4 @@
.tab.active { background: #fff; padding-top: 6px; position: relative; top: 1px; border-color: #666; }
.tab a.active { font-weight: bold; }
.tab-container .panel-container { background: #fff; border: solid #666 1px; padding: 10px; -moz-border-radius: 0 4px 4px 4px; -webkit-border-radius: 0 4px 4px 4px; }
.panel-container { margin-bottom: 10px; }
\ No newline at end of file
.panel-container { margin-bottom: 10px; }
......@@ -23,12 +23,12 @@ box-shadow: 0px 0px 3px 0px #888888;
#leftcolumn {
overflow-y: scroll;
margin-right: -400px;
margin-right: -300px;
margin-left: 0px;
padding-bottom: 10px;
padding-left: 5px;
right: 400px;
width: 400px;
right: 300px;
width: 300px;
position: fixed;
height: 100%;
border: 1px #888888 solid;
......
......@@ -4,13 +4,35 @@
// ============ < DEVELOPER OPTIONS > ============
var geomap=false;
var colorByAtt = false;
var twittertimeline = false;
var minimap=false;
var getAdditionalInfo=true;//for topPapers div
var mainfile=false;
getUrlParam.file = window.location.origin+"/"+$("#graphid").html();
var mainfile = ["db.json"];
// // var mainfile = "api.json";
// var mainfile = [
// "data/2-Terms-Authors-300nodes.gexf",
// "data/0-terms-terms-MainNodes.gexf",
// "data/maziyar2.json",
// "data/3-Terms-Countries-300nodes.gexf",
// // "data/noclimatechange_mnodes.gexf",
// "data/20150518t1052_phylograph.json",
// // "data/phylograph_6.json",
// // "data/maziyar.json",
// // "data/20141128_GPs_03_bi.gexf",
// // "data/example.json",
// // "data/Elisa__Omodei.gexf",
// ];
// getUrlParam.file = window.location.origin+"/"+$("#graphid").html(); // garg exclusive
// var corpusesList = {} // garg exclusive -> corpus comparison
// getUrlParam.file = "data/testgraph.json";
if($("#graphid").length>0) // just Garg
getUrlParam.file = window.location.origin+"/"+$("#graphid").html(); // just Garg
var corpusesList = {}
var Clusters = [];
var dataFolderTree = {};
var gexfDict={};
......@@ -18,13 +40,39 @@ var egonode = {}
var iwantograph = "";
var bridge={};
external="";
var external="";
//external="http://tina.iscpif.fr/explorerjs/";//Just if you want to use the server-apps from tina.server
bridge["forFilteredQuery"] = external+"php/bridgeClientServer_filter.php";
bridge["forNormalQuery"] = external+"php/bridgeClientServer.php";
var clusters = [];
var gexfDict={};
// gexfDict["data/terrorism/terrorism_mono.gexf"] = "[2001-2014] TERRORISM (1-partite graph)";
// gexfDict["data/terrorism/terrorism_bi.gexf"] = "[2001-2014] TERRORISM (2-partite graph)";
var field = {}
// field["data/20141128_GPs_03_bi.gexf"] = "ISItermsfirstindexing";
// field["data/20141215_GPs_04.gexf"] = "ISItermsfirstindexing";
// field["data/medq2/20141128_MED_02_bi.gexf"] = "ISItermsBigWL";
// field["data/medq2/20141128_MED_03_bi.gexf"] = "ISItermsBigWL";
// field["data/medq2/20141208_MED_Author_name-ISItermsjulien_index.gexf"] = "ISItermsjulien_index";
// field["data/medq1/20141208_MED_01_bi.gexf"] = "ISItermsfirstindex";
// field["data/terrorism/terrorism_mono.gexf"] = "ISItermsListV1";
// field["data/terrorism/terrorism_bi.gexf"] = "ISItermsListV1";
var ParseCustom = function () {};
var SigmaUtils = function () {};
var TinaWebJS = function () {};
var Relations = {}
var SystemStates = {}
SystemStates.level = true;
SystemStates.type = [ true ] //[ true , false ]; //social activated!
SystemStates.selections = [];
SystemStates.opposites = [];
ircNick="";
ircCHN="";
......@@ -89,7 +137,7 @@ var sigmaJsGraphProperties = {
};
var sigmaJsMouseProperties = {
minRatio:0.1,
maxRatio: 15
maxRatio: 50
};
// ============ < / SIGMA.JS PROPERTIES > ============
......@@ -122,19 +170,13 @@ var swMacro=true;
var socsemFlag=false;
var constantNGramFilter;
// var nodeFilterA_past = ""
// var nodeFilterA_now = ""
// var nodeFilterB_past = ""
// var nodeFilterB_now = ""
var lastFilter = []
lastFilter["#sliderBNodeWeight"] = "-"
lastFilter["#sliderAEdgeWeight"] = "-"
lastFilter["#sliderBEdgeWeight"] = "-"
lastFilter["#slidercat0nodesweight"] = {"orig":"-" , "last":"-"}
lastFilter["#slidercat1nodesweight"] = {"orig":"-" , "last":"-"}
lastFilter["#slidercat0edgesweight"] = {"orig":"-" , "last":"-"}
lastFilter["#slidercat1edgesweight"] = {"orig":"-" , "last":"-"}
// var edgeFilterB_past = ""
// var edgeFilterB_now = ""
var Filters = {}
......@@ -164,10 +206,10 @@ var oposMAX;
var matches = [];
var nodes1 = [];
var nodes2 = [];
var bipartiteD2N = [];
var bipartiteN2D = [];
var nodes1 = {};
var nodes2 = {};
var bipartiteD2N = {};
var bipartiteN2D = {};
var flag=0;
var firstime=0;
......
......@@ -27,7 +27,10 @@ function getGexfLegend(gexfPath){
}
function jsActionOnGexfSelector(gexfLegend){
window.location=window.location.origin+window.location.pathname+"?file="+encodeURIComponent(getGexfPath(gexfLegend));
if(getGexfPath[gexfLegend])
window.location=window.location.origin+window.location.pathname+"?file="+encodeURIComponent(getGexfPath(gexfLegend));
else
window.location=window.location.origin+window.location.pathname+"?file="+encodeURIComponent( gexfLegend );
}
function listGexfs(){
......@@ -44,7 +47,7 @@ function listGexfs(){
javs='onchange="'+'jsActionOnGexfSelector(this.value);'+'"';
html+=javs;
html+=">";
html+='<option selected>[Select your Graph]</option>';
html+='<option selected>[More Graphs]</option>';
for(var i in data){
//pr("path: "+data[i]);
//pr("legend: "+getGexfLegend(data[i]));
......
This diff is collapsed.
This diff is collapsed.
......@@ -4,6 +4,10 @@ function pr(msg) {
console.log(msg);
}
function print(msg) {
console.log(msg);
}
//to general utils
function getClientTime(){
var totalSec = new Date().getTime() / 1000;
......@@ -192,3 +196,20 @@ function componentToHex(c) {
function rgbToHex(r, g, b) {
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
}
/**
* function to load a given css file
*/
loadCSS = function(href) {
var cssLink = $("<link rel='stylesheet' type='text/css' href='"+href+"'>");
$("head").append(cssLink);
};
/**
* function to load a given js file
*/
loadJS = function(src) {
var jsLink = $("<script type='text/javascript' src='"+src+"'>");
$("head").append(jsLink);
};
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
function draw1Circle(ctx , x , y , r , color) {
function draw1Circle(ctx , x , y , color) {
ctx.strokeStyle = '#000';
ctx.lineWidth = 1;
ctx.fillStyle = color;
ctx.globalAlpha = 0.5;
ctx.beginPath();
ctx.arc(x, y, r, 0, Math.PI * 2, true);
ctx.arc(x, y, 10, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
ctx.stroke();
......@@ -46,7 +46,9 @@ function trackMouse() {
}
}
}
partialGraph.draw(2,1,2);
if(partialGraph.forceatlas2 && partialGraph.forceatlas2.count<=1) {
partialGraph.draw(2,2,2);
}
} else {
for(var i in partialGraph._core.graph.nodesIndex){
n=partialGraph._core.graph.nodesIndex[i];
......@@ -58,7 +60,9 @@ function trackMouse() {
} else partialGraph._core.graph.nodesIndex[i].forceLabel=false;
}
}
partialGraph.draw(2,1,2);
if(partialGraph.forceatlas2 && partialGraph.forceatlas2.count<=1) {
partialGraph.draw(2,2,2);
}
}
ctx.arc(x, y, cursor_size, 0, Math.PI * 2, true);
//ctx.arc(partialGraph._core.width/2, partialGraph._core.height/2, 4, 0, 2 * Math.PI, true);/*todel*/
......
# jCPM
Clique Percolation Method on JS
This is a javascript implementation of the CPM overlapping-community detection algorithm
Palla et al. 2008 http://dx.doi.org/10.1007/978-3-540-69395-6_9
Mainly based on:
- http://sociograph.blogspot.fr/2011/11/clique-percolation-in-few-lines-of.html
- https://networkx.github.io
Author: Samuel Castillo (http://github.com/pksm3)
IE CNRS - @Institut des Systèmes Complexes de Paris Île-de-France
samuel.castillo@iscpif.fr
This diff is collapsed.
This diff is collapsed.
......@@ -2,6 +2,7 @@
// (requires sigma.js to be loaded)
var minx=1000.0, maxx=0.0, miny=1000.0, maxy=0.0;
var first_time=true;
sigma.forceatlas2 = sigma.forceatlas2 || {};
sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
......@@ -38,7 +39,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
jitterTolerance: 1,
barnesHutOptimize: false,
barnesHutTheta: 1.2,
speed: 1,
speed: 20,
outboundAttCompensation: 1,
totalSwinging: 0,
swingVSnode1: 0,
......@@ -1111,20 +1112,9 @@ sigma.publicPrototype.startForceAtlas2 = function() {
//if(!this.forceatlas2) {
if(fa2enabled) {
pr("\t\t\t\t\tFA2 started")
pr("nodes.length:")
pr(this._core.graph.nodes.length)
pr("edges.length:")
pr(this._core.graph.edges.length)
var V = 10;
var E = 100;
// for(var c in clusters) {
// cid = ""+clusters[c]
// if(isUndef(getn("c"+cid)))
// partialGraph.dropNode("c"+cid)
// }
this.forceatlas2 = new sigma.forceatlas2.ForceAtlas2(this._core.graph , V, E);
this.forceatlas2.setAutoSettings();
this.forceatlas2.init();
......@@ -1149,9 +1139,10 @@ sigma.publicPrototype.startForceAtlas2 = function() {
return true;
});
var present = partialGraph.states.slice(-1)[0]
// fixing anomaly in forceatlas2
$.doTimeout(250,function (){
if( !swMacro && partialGraph.forceatlas2.active && partialGraph.forceatlas2.count==0) {
if( !present.level && partialGraph.forceatlas2.active && partialGraph.forceatlas2.count==0) {
pr("SUPER JUTSU!!")
partialGraph.startForceAtlas2();
return;
......@@ -1162,73 +1153,48 @@ sigma.publicPrototype.startForceAtlas2 = function() {
};
sigma.publicPrototype.stopForceAtlas2 = function() {
pr("\t\t\t\t\tFA2 Stopped")
this.removeGenerator('forceatlas2');
var present = partialGraph.states.slice(-1)[0]
if(this.forceatlas2) {
this.forceatlas2.active=false;
this.forceatlas2.count=0;
if(swMacro) {
for(var n in partialGraph._core.graph.nodesIndex) {
var x = partialGraph._core.graph.nodesIndex[n].x;
var y = partialGraph._core.graph.nodesIndex[n].y;
Nodes[n].x = x;
Nodes[n].y = y;
if(this.forceatlas2.count) {
pr("\t\t\t\t\tFA2 Stopped: "+this.forceatlas2.count)
if(present.level && this.forceatlas2.count>2) {
// not-save-positions if an edge-filter is ON
first_state = present.type;
for(var i in first_state) {
if(first_state[i]) {
for(var j in Filters[i]) {
original = lastFilter[j]["orig"]
thelast = lastFilter[j]["last"]
if(thelast!="-") {
if(original==thelast) {
for(var i in partialGraph._core.graph.nodesIndex){
Nodes[i].x = partialGraph._core.graph.nodesIndex[i].x;
Nodes[i].y = partialGraph._core.graph.nodesIndex[i].y;
}
}
}
}
}
}
}
}
this.forceatlas2.active=false;
this.forceatlas2.count=0;
}
this.removeGenerator('forceatlas2');
updateMap();
partialGraph.refresh();
if(minimap) $("#overviewzone").show();
if(first_time) {
$.doTimeout(100,function (){
pr("\t\t\t\t\tFirst time FA2 Stopped")
for(var i in partialGraph._core.graph.nodesIndex){
Nodes[i].x = partialGraph._core.graph.nodesIndex[i].x;
Nodes[i].y = partialGraph._core.graph.nodesIndex[i].y;
}
});
first_time=false;
}
// $.doTimeout(1000,function (){
// for(var c in clusters) {
// cid = ""+clusters[c]
// neighs = nodes1[cid].neighbours
// pr(cid)
// pr(neighs)
// var min_x=9999.0, max_x=-9999.0, min_y=9999.0, max_y=-9999.0;
// for(var n in neighs) {
// nid = neighs[n]+"";
// pr(nid)
// var x = partialGraph._core.graph.nodesIndex[nid].x
// var y = partialGraph._core.graph.nodesIndex[nid].y
// if(parseFloat(x) < parseFloat(min_x)) min_x= x;
// if(parseFloat(x) > parseFloat(max_x)) max_x= x;
// if(parseFloat(y) < parseFloat(min_y)) min_y= y;
// if(parseFloat(y) > parseFloat(max_y)) max_y= y;
// }
// pr("min_x: "+min_x + " | max_x: " + max_x + " | min_y: " + min_y + " | max_y: " + max_y)
// pr("")
// var Ox = (min_x+max_x)/2;
// var Oy = (min_y+max_y)/2;
// var Px = min_x;
// var Py = min_y;
// var R = Math.sqrt( Math.pow((Ox-Px), 2) + Math.pow((Oy-Py), 2) );
// R = R * 1.2;
// pr(hex2rga(colorList[c]))
// var node = ({
// id: "c"+cid ,
// label:"",
// size:R,
// x:getn(cid).x,
// y:getn(cid).y,
// color: colorList[c]
// }); // The graph node
// partialGraph.addNode("c"+cid,node);
// }
// });
partialGraph.draw()
};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
function FA2gephi {
for f in gexfs/*.gexf
do
if [[ "$f" != *_.gexf* ]]
then
java -jar tinaviz-2.0-SNAPSHOT.jar "$f" 10 &
break;
fi
done
}
function testing {
for f in gexfs/*.gexf
do
if [[ "$f" != *_.gexf* ]]
then
variable=`cat $f | grep "<description>Carla__Taramasco"`
if [[ "$variable" != "" ]]
then
echo $f
fi
fi
done
}
# Usage:
# ./zearcher.sh "extension" "the query"
function test2 {
extension=$1
query=$2
# echo "lala $extension , $query"
iter=`find . -name "*.$extension" -print`
counter=0
for f in $iter
do
filename=`echo $f | sed s/"\.\/"//g`
variable=`cat $filename | grep "$query"`
if [[ "$variable" != "" ]]
then
echo $filename
counter=$((counter + 1));
fi
done
if [ $counter -eq 0 ]
then
echo "Nothing found. Die."
fi
}
test2 $1 $2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment