]> matita.cs.unibo.it Git - helm.git/commitdiff
- added no_hyp table
authorStefano Zacchiroli <zack@upsilon.cc>
Fri, 22 Apr 2005 08:30:30 +0000 (08:30 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Fri, 22 Apr 2005 08:30:30 +0000 (08:30 +0000)
- changed constants number integer type to small int
- added comments describing tables

helm/metadata/sql/create_mowgli_tables.mysql.sql
helm/metadata/sql/fill_inconcl_aux.sql
helm/metadata/sql/fill_no_concl_hyp.sql
helm/metadata/sql/fill_no_hyp.sql [new file with mode: 0644]

index e2195891accf7bbd0ddb274b65f5b1ab3811fb75..bc2e2846004955089f0a71b3e22e689d5b303c26 100644 (file)
@@ -22,11 +22,19 @@ CREATE TABLE objectName (
 );
 CREATE TABLE no_inconcl_aux (
     source varchar(255) binary not null,
-    no tinyint(4) not null
+    no smallint(6) not null
 );
 CREATE TABLE no_concl_hyp (
     source varchar(255) binary not null,
-    no tinyint(4) not null
+    no smallint(6) not null
+);
+CREATE TABLE no_hyp (
+    source varchar(255) binary unique not null,
+    no smallint(6) not null
+);
+CREATE TABLE owners (
+    source varchar(255) binary not null,
+    owner varchar(255) binary not null
 );
 
 CREATE INDEX refObj_source ON refObj (source);
@@ -38,4 +46,8 @@ CREATE INDEX no_inconcl_aux_source ON no_inconcl_aux (source);
 CREATE INDEX no_inconcl_aux_no ON no_inconcl_aux (no);
 CREATE INDEX no_concl_hyp_source ON no_concl_hyp (source);
 CREATE INDEX no_concl_hyp_no ON no_concl_hyp (no);
+CREATE INDEX no_hyp_no ON no_hyp (no);
+CREATE INDEX no_hyp_source ON no_hyp (source);
+CREATE INDEX owners_owner ON owners (owner);
+CREATE INDEX owners_source ON owners (source);
 
index 2e7140e18b4ffd226b240b1c1ce14f90299de702..50146e0fd5d42642f512894b7000ff8fd87fead6 100644 (file)
@@ -1,4 +1,5 @@
 
+-- table mapping sources to number of distinct constants occurring in conclusion
 INSERT INTO no_inconcl_aux
 SELECT source, COUNT(h_occurrence)
 FROM refObj
index 3294fe12102980ab8484dc81310cf3830b3912fe..3c82358a23b0376b8c4cc54813fb48867e6ce3dd 100644 (file)
@@ -1,4 +1,6 @@
 
+-- table mapping sources to number of distinct constants occurring everywhere
+-- except body
 INSERT INTO no_concl_hyp
 SELECT source, COUNT(DISTINCT h_occurrence)
 FROM refObj
diff --git a/helm/metadata/sql/fill_no_hyp.sql b/helm/metadata/sql/fill_no_hyp.sql
new file mode 100644 (file)
index 0000000..b920e1c
--- /dev/null
@@ -0,0 +1,15 @@
+
+-- table mapping sources to number of distinct constants occurring in hypothesis
+INSERT INTO no_hyp
+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
+SELECT source, 0
+FROM refObj
+WHERE NOT (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;