value varchar(255) binary not null
);
CREATE TABLE no_inconcl_aux (
- source varchar(255) binary not null,
+ source varchar(255) binary unique not null,
no smallint(6) not null
);
CREATE TABLE no_concl_hyp (
- source varchar(255) binary not null,
+ source varchar(255) binary unique not null,
no smallint(6) not null
);
CREATE TABLE no_hyp (
owner varchar(255) binary not null
);
+CREATE TABLE count (
+ source varchar(255) binary unique not null,
+ conclusion smallint(6) not null,
+ hypothesis smallint(6) not null,
+ statement smallint(6) not null
+);
+
CREATE INDEX refObj_source ON refObj (source);
CREATE INDEX refObj_target ON refObj (h_occurrence);
CREATE INDEX refObj_position ON refObj (h_position);
--- /dev/null
+CREATE TABLE no_inconcl_aux_tmp (
+ source varchar(255) binary unique not null,
+ no smallint(6) not null
+);
+CREATE TABLE no_concl_hyp_tmp (
+ source varchar(255) binary unique not null,
+ no smallint(6) not null
+);
+CREATE TABLE no_hyp_tmp (
+ source varchar(255) binary unique not null,
+ no smallint(6) not null
+);
+
+INSERT INTO no_inconcl_aux_tmp
+SELECT source, COUNT(h_occurrence)
+FROM refObj
+WHERE
+ h_position='http://www.cs.unibo.it/helm/schemas/schema-helm#InConclusion'
+ OR h_position='http://www.cs.unibo.it/helm/schemas/schema-helm#MainConclusion'
+GROUP BY source;
+
+INSERT IGNORE INTO no_inconcl_aux_tmp
+SELECT source, 0
+FROM refObj
+GROUP BY source;
+
+INSERT INTO no_concl_hyp_tmp
+SELECT source, COUNT(DISTINCT h_occurrence)
+FROM refObj
+WHERE NOT (h_position="http://www.cs.unibo.it/helm/schemas/schema-helm#InBody")
+GROUP BY source;
+
+INSERT IGNORE INTO no_concl_hyp_tmp
+SELECT source, 0
+FROM refObj
+GROUP BY source;
+
+INSERT INTO no_hyp_tmp
+SELECT source, COUNT(DISTINCT h_occurrence)
+FROM refObj
+WHERE (h_position="http://www.cs.unibo.it/helm/schemas/schema-helm#MainHypothesis"
+ OR h_position="http://www.cs.unibo.it/helm/schemas/schema-helm#InHypothesis")
+GROUP BY source;
+
+INSERT IGNORE INTO no_hyp_tmp
+SELECT source, 0
+FROM refObj
+GROUP BY source;
+
+INSERT INTO count
+SELECT no_hyp_tmp.source,
+ no_inconcl_aux_tmp.no,
+ no_hyp_tmp.no,
+ no_concl_hyp_tmp.no
+FROM no_hyp_tmp, no_concl_hyp_tmp, no_inconcl_aux_tmp
+WHERE no_hyp_tmp.source = no_concl_hyp_tmp.source AND
+ no_hyp_tmp.source = no_inconcl_aux_tmp.source;
+
+DROP TABLE no_hyp_tmp;
+DROP TABLE no_inconcl_aux_tmp;
+DROP TABLE no_concl_hyp_tmp;
+
+
+