my $xslt_indexname = $ENV{'HTTP_GETTER_XSLT_INDEXNAME'} ||
"xslt_index.txt";
$servers_file = $ENV{'HTTP_GETTER_SERVERS_FILE'} || $servers_file;
+$uris_dbm = $ENV{'HTTP_GETTER_URIS_DBM'} || $uris_dbm;
# </move_to_conf_file>
print " done\n";
html_nice_answer($c,"Update done");
- # "/ls" does not work with rdf uris
+ # "/getalluris" does not work with rdf uris
+ } elsif ($http_method eq 'GET' and $http_path eq "/getalluris") {
+ # 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") {
# send back keys that begin with a given uri
my ($uritype,$uripattern,$uriprefix);
}
}
+sub getalluris { # get all the keys whose prefix is cic
+ my $content = "";
+ my ($uri);
+ my $debug=1; # for debug
+
+ $content .= '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n";
+ $content .= "<!DOCTYPE alluris SYSTEM ";
+ $content .= "\"$myownurl/getdtd?uri=alluris.dtd\">" . "\n\n";
+ $content .= "<alluris>\n";
+ foreach $uri (sort (keys(%xml_map))) { # select matching uris
+ if ($uri =~ /^cic:/ && not $uri =~ /.types$/) {
+ print "GETALLURI: $uri\n" if defined($debug);
+ $content .= "\t<uri value=\"$uri\"/>\n";
+ }
+ }
+ $content .= "</alluris>\n";
+ 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 = "";