+FILLDB=fill_db.sql
+
all:
- rm -f fill_db.sql
- time for i in `cat tipi_induttivi.txt` ; do (cd tmp ; wget -t 1 -O downloaded.xml.gz "http://mowgli.cs.unibo.it:58081/getxml?format=gz&uri=$$i") ; zcat tmp/downloaded.xml.gz > tmp/inductive_type.xml ; extractor/meta_ind $$i "tmp/inductive_type.xml" >> fill_db.sql ; rm -f tmp/downloaded.xml.gz tmp/inductive_type.xml; done > log 2>&1
- time for i in `cat costanti_e_variabili.txt` ; do (cd tmp ; wget -t 1 -O downloaded.xml.gz "http://mowgli.cs.unibo.it:58081/getxml?format=gz&uri=$$i" ; wget -t 1 -O downloaded_body.xml.gz "http://mowgli.cs.unibo.it:58081/getxml?format=gz&uri=$$i.body"); zcat tmp/downloaded.xml.gz > tmp/type.xml ; zcat tmp/downloaded_body.xml.gz > tmp/body.xml ; extractor/meta $$i "tmp/body.xml" "tmp/type.xml" >> fill_db.sql ; rm -f tmp/downloaded.xml.gz tmp/downloaded_body.xml.gz tmp/type.xml tmp/body.xml ; done > log 2>&1
+ rm -f $(FILLDB)
+ time for i in `cat tipi_induttivi.txt` ; do (cd tmp ; wget -t 1 -O downloaded.xml.gz "http://mowgli.cs.unibo.it:58081/getxml?format=gz&uri=$$i") ; zcat tmp/downloaded.xml.gz > tmp/inductive_type.xml ; extractor/meta_ind $$i "tmp/inductive_type.xml" >> $(FILLDB) ; rm -f tmp/downloaded.xml.gz tmp/inductive_type.xml; done > log 2>&1
+ time for i in `cat costanti_e_variabili.txt` ; do (cd tmp ; wget -t 1 -O downloaded.xml.gz "http://mowgli.cs.unibo.it:58081/getxml?format=gz&uri=$$i" ; wget -t 1 -O downloaded_body.xml.gz "http://mowgli.cs.unibo.it:58081/getxml?format=gz&uri=$$i.body"); zcat tmp/downloaded.xml.gz > tmp/type.xml ; zcat tmp/downloaded_body.xml.gz > tmp/body.xml ; extractor/meta $$i "tmp/body.xml" "tmp/type.xml" >> $(FILLDB) ; rm -f tmp/downloaded.xml.gz tmp/downloaded_body.xml.gz tmp/type.xml tmp/body.xml ; done > log 2>&1
+
+drop_tables:
+ cat sql/drop_mowgli_tables.sql | mysql -pbjIcRpru -u helmadmin mowgli
+
+create_tables:
+ cat sql/create_mowgli_tables.sql | mysql -pbjIcRpru -u helmadmin mowgli
+
+fill_db:
+ cat $(FILLDB) | mysql -pbjIcRpru -u helmadmin mowgli
-.PHONY: all
+.PHONY: all create_tables drop_tables fill_db
--- /dev/null
+
+CREATE TABLE refObj (
+ source varchar(255),
+ h_occurrence varchar(255),
+ h_position varchar(255),
+ h_depth integer
+);
+CREATE TABLE refSort (
+ source varchar(255),
+ h_position varchar(255),
+ h_depth integer,
+ h_sort varchar(255)
+);
+CREATE TABLE refRel (
+ source varchar(255),
+ h_position varchar(255),
+ h_depth integer
+);
+CREATE TABLE objectName (
+ source varchar(255),
+ value varchar(255)
+);
+
+CREATE INDEX refObj_source ON refObj (source);
+CREATE INDEX refObj_target ON refObj (h_occurrence);
+CREATE INDEX refSort_source ON refSort (source);
+CREATE INDEX objectName_value ON objectName (value);
+