]> matita.cs.unibo.it Git - helm.git/commitdiff
The cache now supports different RDF URI schema at the same time.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 24 Oct 2001 10:35:32 +0000 (10:35 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 24 Oct 2001 10:35:32 +0000 (10:35 +0000)
helm/http_getter/http_getter.pl.in

index 6c6a7340e7bdcc039064cf71b250db26938934b3..fd88194bf417b1860a675cd7c094cd5405cd1cae 100755 (executable)
@@ -144,12 +144,20 @@ while (my $c = $d->accept) {
             }
 
             my $filename = $inputuri;
+            my $prefix;
             if (not isRdfUri($inputuri)) { # standad cic: or theory: uri
              $filename =~ s/^cic:(.*)/$1/;
              $filename =~ s/^theory:(.*)/$1/;
             } else { # rdf uri
+             # The "helm:rdf/<<...>>//cic:" prefix is kept, but quoted
+             # (so that a "helm:rdf/<<...>>//cic:" dir is created
+             $prefix = $filename;
              $filename =~ s/^(.*)\/\/cic:(.*)/$2/;
              $filename =~ s/^(.*)\/\/theory:(.*)/$2/;
+             $prefix =~ s/\Q$filename\E//;
+             $prefix =~ s/_/__/g;
+             $prefix =~ s/\//_/g;
+             $filename = $prefix.$filename;
             }
 
             my $url = resolve ($inputuri); # resolve uri in url
@@ -170,7 +178,7 @@ while (my $c = $d->accept) {
               if (not isRdfUri ($inputuri)) { # save in uri std cache dir
                $filename = $helm_dir.$filename.$extension;
               } else { # save in rdf metadata cache dir
-               $filename = $helm_rdf_dir.$filename.$extension;
+               $filename = $helm_rdf_dir."/".$filename.$extension;
               }
 
               print_request($inputuri,$url,$filename);
@@ -734,6 +742,7 @@ sub helm_wget {
 }
 
 sub update {
+# retie dbs
  untie %map;
  tie(%map, 'DB_File', $uris_dbm.".db", O_RDWR, 0664);
  untie %rdf_map;
@@ -819,3 +828,6 @@ sub update_dbs {
  tie(%rdf_map, 'DB_File', $rdf_dbm.".db", O_RDWR, 0664);
 } # update_dbs
 
+# vim modline: do not remove!
+# vim: set ft=perl:
+