This is the code for a simple WWW front end to RDFDB.
#!/usr/bin/perl

use CGI qw(:standard);
use IO::Socket;


my $term = param('term');
my $db   = param('db');

sub conn {
    my $q = shift;
    my $s = IO::Socket::INET->new(PeerAddr=>"localhost:7000");
    print $s $q."\n";
    while (<$s>) {
	chomp;
	last if ($_ eq "0");
	my ($prop, $value);
	($prop, $value) = split(/\t/, $_);
	$value =~ s/#/\%23/g;
	print "<tr><td>".$prop."</td><td> <a href=/cgi-bin/br.pl?db=".$db."&term=".$value.">".$value."</a></td></tr>\n";	
    }
    print $s "<quit>\n";
    close($s);
}



print header;
print "<h3>All arcs out of ".$term." in database ".$db."</h3>\n";
print "<table border=yes width=100%><tr><td>Property</td><td>Value</td></tr>\n";
conn("select ?prop, ?value from ".$db." where (?prop ".$term." ?value) output tab-limited </>");
print "</table>";

print "<h3>All arcs into ".$term." in database ".$db."</h3>\n";
print "<table border=yes width=100%><tr><td>Property</td><td>Value</td></tr>\n";
conn("select ?prop, ?value from ".$db." where (?prop ?value ".$term.") output tab-limited </>");
print "</table>";