From bd0acf4e61bad9444b75d8f9822cf68eef06b69e Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Wed, 20 Nov 2002 17:48:03 +0000 Subject: [PATCH] * New metadata for refSort and refRel * New metadata schema --- helm/metadata/create_V7_mowgli/Makefile | 4 +++- helm/metadata/create_V7_mowgli/fix_rdf.pl | 8 ++++++- helm/metadata/create_V7_mowgli/invert.pl | 29 +++++++++++++---------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/helm/metadata/create_V7_mowgli/Makefile b/helm/metadata/create_V7_mowgli/Makefile index c0a94dd09..1397397ee 100644 --- a/helm/metadata/create_V7_mowgli/Makefile +++ b/helm/metadata/create_V7_mowgli/Makefile @@ -6,6 +6,8 @@ forward: 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") ; mkdir -p forward/`dirname $$i | sed "s/cic:\///"` && zcat tmp/downloaded.xml.gz > tmp/type.xml && zcat tmp/downloaded_body.xml.gz > tmp/body.xml ; METADATA/meta $$i > forward/`echo $$i | sed "s/cic:\///"`.xml && rm -f tmp/downloaded.xml.gz tmp/downloaded_body.xml.gz tmp/type.xml tmp/body.xml ; done > log 2>&1 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") && mkdir -p forward/`dirname $$i | sed "s/cic:\///"` && zcat tmp/downloaded.xml.gz > tmp/inductive_type.xml && METADATA/meta_ind forward/`echo $$i | sed "s/cic:\///"` $$i && rm tmp/downloaded.xml.gz tmp/inductive_type.xml ; done >> log 2>&1 (cd forward ; ../mkindex.sh forward) + cat forward_rel_or_sort_header.txt forward_rel.xml forward_rel_or_sort_footer.txt > forward_rel.xml.tmp && mv forward_rel.xml.tmp forward_rel.xml + cat forward_rel_or_sort_header.txt forward_sort.xml forward_rel_or_sort_footer.txt > forward_sort.xml.tmp && mv forward_sort.xml.tmp forward_sort.xml backward: time for i in `cat all_objects.txt` ; do touch/touch.opt $$i ; done @@ -20,7 +22,7 @@ compress: (cd backward ; ../mkindex.sh backward) clean-forward: - rm -rf forward/* + rm -rf forward_rel.xml forward_sort.xml forward/* clean-backward: rm -rf backward/* diff --git a/helm/metadata/create_V7_mowgli/fix_rdf.pl b/helm/metadata/create_V7_mowgli/fix_rdf.pl index 3d52c0fc9..23b4b7fda 100755 --- a/helm/metadata/create_V7_mowgli/fix_rdf.pl +++ b/helm/metadata/create_V7_mowgli/fix_rdf.pl @@ -12,7 +12,13 @@ open(HEADER,">>$outputfile"); print HEADER < - + + + + + ]> + EOT close(HEADER); diff --git a/helm/metadata/create_V7_mowgli/invert.pl b/helm/metadata/create_V7_mowgli/invert.pl index df3450649..a20e52d9d 100755 --- a/helm/metadata/create_V7_mowgli/invert.pl +++ b/helm/metadata/create_V7_mowgli/invert.pl @@ -4,21 +4,23 @@ my $inputfile = $ARGV[0]; print "Now splitting file $inputfile\n"; open(IN, "<$inputfile") or die "Error opening file $inputfile"; -$dummy = ; # -$dummy = ; # -$dummy = ; # -$where = ; # +my $where; +while(($where = ) && not ($where =~ /$/$1/; -while(($line1 = ) && not ($line1 =~ /<\/h:Object>/)) { - $line2 = ; # - $line3 = ; # value - $line4 = ; # value - $line5 = ; # - $line6 = ; # +while(($line1 = ) && not ($line1 =~ /<\/h:Object>/)) { # ; # + $position = $line2; + chomp($position); + $position =~ s/^[ \t]*[^"]*"&hns;([^"]*)"\/>/$1/; + if ($position eq 'MainHypothesis' || $position eq 'MainConclusion') { + $line3 = ; # value + } + $line4 = ; # + $line5 = ; # $uri = $line4; chomp($uri); - $uri =~ s/^[ \t]*([^<]*)<\/h:occurrence>$/$1/; + $uri =~ s/^[ \t]*<\/h:occurrence>$/$1/; $who = $uri; $who =~ s/^cic:/backward/; $who =~ s/#xpointer\(1\/([^\/]*)\/([^\/]*)\)/,$1,$2/; @@ -28,9 +30,10 @@ while(($line1 = ) && not ($line1 =~ /<\/h:Object>/)) { open(OUT, ">>$who") or die "Error opening file $who"; print OUT "\t\t\n"; print OUT $line2; - print OUT $line3; + if ($position eq 'MainHypothesis' || $position eq 'MainConclusion') { + print OUT $line3; + } print OUT $line4; - print OUT $line5; print OUT "\t\t\n"; close(OUT); } -- 2.39.2