commit 5a3f84bf10b9cd11c918c72d26df3f439678ce3e
parent a48e0cc45384d0171ed7c1241048b921525fd938
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date: Sun, 27 Mar 2011 20:34:21 +0200
Correction d'un bug : ne pas avoir les noeuds qui commencent avec '::' comme mot central. (non testé).
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/code/serveur/dump2sqlite.sh b/code/serveur/dump2sqlite.sh
@@ -31,6 +31,7 @@ create table game(gid integer primary key autoincrement, eid_central_word, relat
create table game_cloud(gid, num, difficulty, eid_word, totalWeight, probaR1, probaR2, probaR0, probaTrash);
create table played_game(pgid integer primary key autoincrement, gid, login, timestamp);
create table played_game_cloud(pgid, gid, type, num, relation, weight, score);
+create table colon_nodes(eid);
create table random_cloud_node(eid,nbneighbors);
create table random_center_node(eid);
@@ -61,15 +62,21 @@ create index i_relation_type on relation(type);
create index i_relation_start_type on relation(start,type);
create index i_relation_end_type on relation(end,type);
create index i_played_game_all on played_game(pgid, gid, login, timestamp);
+create index i_colon_nodes_eid on colon_nodes(eid);
+
+insert into colon_nodes(eid) select eid from node where name glob '::*';
+
insert into random_cloud_node(eid,nbneighbors) select eid,sum(nb) from (
select (select type from node where node.eid = relation.start) as type,
start as eid,
- count(start) as nb from relation where type not in (4, 12, 36, 18, 29, 45, 46, 47, 48, 1000, 1001)
+ count(start) as nb from relation
+ where type not in (4, 12, 36, 18, 29, 45, 46, 47, 48, 1000, 1001) and start not in colon_nodes
group by start
union
select (select type from node where node.eid = relation.start) as type,
end as eid,
- count(end) as nb from relation where type not in (4, 12, 36, 18, 29, 45, 46, 47, 48, 1000, 1001)
+ count(end) as nb from relation
+ where type not in (4, 12, 36, 18, 29, 45, 46, 47, 48, 1000, 1001) and start not in colon_nodes
group by end
) where type = 1 group by eid;
create index i_random_cloud_node_nbneighbors on random_cloud_node(nbneighbors);