]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/http_getter/http_getter.pl.in
debian release -3
[helm.git] / helm / http_getter / http_getter.pl.in
index c9cac35f2904741994c5b3cc67bdbb34738c7324..f4c11e172a94d466f5395242afaf292ba6fdc634 100755 (executable)
@@ -318,6 +318,14 @@ while (my $c = $d->accept) {
             # send back all the keys in xml
             print "BASEURI $baseuri, FORMAT $outype\n";
             $cont = getalluris();
+            answer($c,$cont,"text/xml","");
+
+                                 # "/getallrdfuris"
+        } elsif ($http_method eq 'GET' and $http_path eq "/getallrdfuris") {
+            # send back all the keys in xml
+            my $class = $cgi->param('class');
+            print "BASEURI $baseuri, FORMAT $outype, CLASS $class\n";
+            $cont = getallrdfuris($class);
             answer($c,$cont,"text/xml","");
 
         } elsif ($http_method eq 'GET' and $http_path eq "/ls") {
@@ -468,6 +476,30 @@ sub getalluris { # get all the keys whose prefix is cic
  return $content;
 }
 
+sub getallrdfuris {
+ my $class = $_[0];
+ my $content = "";
+ my ($uri);
+ my $debug=1; # for debug
+
+  $content .= '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n";
+  $content .= "<!DOCTYPE allrdfuris SYSTEM ";
+  $content .= "\"$myownurl/getdtd?uri=alluris.dtd\">" . "\n\n";
+  $content .= "<allrdfuris>\n";
+  foreach $uri (sort (keys(%rdf_map))) {
+   if ($class eq "forward" &&
+        $uri =~ /^helm:rdf:www.cs.unibo.it\/helm\/rdf\/forward/
+       ||
+        $class eq "backward" &&
+         $uri =~ /^helm:rdf:www.cs.unibo.it\/helm\/rdf\/backward/) {
+      print "GETALLRDFURI: $uri\n" if defined($debug);
+      $content .= "\t<uri value=\"$uri\"/>\n";
+   }
+  }
+  $content .= "</allrdfuris>\n";
+ return $content;
+}
+
 sub finduris { # find uris for cic and theory trees generation
  my ($uritype,$uripattern,$format) = @_;
  my $content = "";