]> matita.cs.unibo.it Git - helm.git/commitdiff
* New metadata for refSort and refRel
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 20 Nov 2002 17:48:03 +0000 (17:48 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 20 Nov 2002 17:48:03 +0000 (17:48 +0000)
* New metadata schema

helm/metadata/create_V7_mowgli/Makefile
helm/metadata/create_V7_mowgli/fix_rdf.pl
helm/metadata/create_V7_mowgli/invert.pl

index c0a94dd09d986350aaf5603750ad85c77ab99bd8..1397397eebebf87bc805f68c055cb7c7ceaa6802 100644 (file)
@@ -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/*
index 3d52c0fc90294bc6e97dcb54c06d27e8935dab60..23b4b7fda2f6f438dd039eae7d1d7f687b96c10b 100755 (executable)
@@ -12,7 +12,13 @@ open(HEADER,">>$outputfile");
 print HEADER <<EOT;
 <?xml version="1.0" encoding="ISO-8859-1"?>
 
-<rdf:RDF xml:lang="en" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:h="http://www.cs.unibo.it/helm/schemas/mattone.rdf#">
+<!DOCTYPE rdf:RDF [
+        <!ENTITY rdfns 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
+        <!ENTITY hthns 'http://www.cs.unibo.it/helm/schemas/schema-helmth#'>
+        <!ENTITY hns 'http://www.cs.unibo.it/helm/schemas/schema-helm#'>
+
+   ]>
+<rdf:RDF xml:lang="en" xmlns:rdf="&rdfns;" xmlns:h="&hns;" xmlns:hth="&hthns;">
        <h:Object rdf:about="$uri">
 EOT
 close(HEADER);
index df345064965eef4048f339c0df172b63a23878b0..a20e52d9d9977c3e0b5c92a708028700bade07c4 100755 (executable)
@@ -4,21 +4,23 @@ my $inputfile = $ARGV[0];
 
 print "Now splitting file $inputfile\n";
 open(IN, "<$inputfile") or die "Error opening file $inputfile";
-$dummy = <IN>;  # <?xml version="1.0" encoding="ISO-8859-1"?>
-$dummy = <IN>;  #
-$dummy = <IN>;  # <rdf:RDF .../>
-$where = <IN>;  # <h:Object rdf:about="...">
+my $where;
+while(($where = <IN>) && not ($where =~ /<h:Object/)) {}
 chomp($where);
 $where =~ s/^[^"]*"([^"]*)">$/$1/;
-while(($line1 = <IN>) && not ($line1 =~ /<\/h:Object>/)) {
-  $line2 = <IN>; # <h:Occurrence>
-  $line3 = <IN>; # <h:position>value</h:position>
-  $line4 = <IN>; # <h:occurrence>value</h:occurrence>
-  $line5 = <IN>; # </h:Occurrence>
-  $line6 = <IN>; # </refObj>
+while(($line1 = <IN>) && not ($line1 =~ /<\/h:Object>/)) { # <h:refObj
+  $line2 = <IN>; # <h:position rdf:resource="&hns;value"/>
+  $position = $line2;
+  chomp($position);
+  $position =~ s/^[ \t]*[^"]*"&hns;([^"]*)"\/>/$1/;
+  if ($position eq 'MainHypothesis' || $position eq 'MainConclusion') {
+     $line3 = <IN>; # <h:depth>value</h:depth>
+  }
+  $line4 = <IN>; # <h:occurrence><h:Object rdf:about="value"/></h:occurrence>
+  $line5 = <IN>; # </h:refObj>
   $uri = $line4;
   chomp($uri);
-  $uri =~ s/^[ \t]*<h:occurrence>([^<]*)<\/h:occurrence>$/$1/;
+  $uri =~ s/^[ \t]*<h:occurrence><h:Object rdf:about="([^"]*)"\/><\/h:occurrence>$/$1/;
   $who = $uri;
   $who =~ s/^cic:/backward/;
   $who =~ s/#xpointer\(1\/([^\/]*)\/([^\/]*)\)/,$1,$2/;
@@ -28,9 +30,10 @@ while(($line1 = <IN>) && not ($line1 =~ /<\/h:Object>/)) {
   open(OUT, ">>$who") or die "Error opening file $who";
   print OUT "\t\t<h:backPointer>\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</h:backPointer>\n";
   close(OUT);
 }