#!/usr/bin/perl
$REVISION = '$Id: rdf_browser,v 1.23 2004/06/08 06:51:00 eric Exp $ ';

use strict;
#BEGIN {unshift@INC,('../../..');}
use W3C::Rdf::RdfApp;
package rdf_browser;
@rdf_browser::ISA = qw(W3C::Rdf::RdfApp);
use W3C::Util::Exception;
use W3C::Rdf::TkVisualizer;

eval {
    my $tester = new rdf_browser;
    $tester->addCommands([1, '-noColumns', \ $tester->{BROWSER_ARGS}{-noColumns}, 
			  'don\'t use Columns.pm', 0, ['no columns'], [1, 'no columns']]);
    $tester->execute(\@ARGV);
}; if ($@) {if ($@) {if (my $ex = &catch('W3C::Util::Exception')) {
    die $ex->toString;
} else {die $@;}}}

sub render {
    my ($self) = @_;
    my %parmPack = (-RdfApp => $self, -RdfDB => $self->{RDF_DB}, 
		    -algae => $self->{ARGS}{-algae}, 
		    -namespace => $self->{ARGS}{-namespace}, 
		    -namespaceHandler => $self->{NAMESPACE_HANDLER}, 
		    -attributionsByInputSource => $self->{ATTRIBUTIONS}, 
		    -systemId => $self->{RDF_PARSER}->getSystemId, 
		    -noColumns => $self->{BROWSER_ARGS}{-noColumns}, 
		    -queryOptions => {-sourceOnly => $self->{ARGS}{-sourceOnly}});
    my $rdfVisualizer = new W3C::Rdf::TkVisualizer(-mainWinTitle => 'RDF Browser', %parmPack);
    $rdfVisualizer->browse;
    return;
}

exit 0;

__END__

=head1 NAME

rdf_browser - parse and visualize RDF triples.

=head1 SYNOPSIS

B<rdf_browser> [B<-a> algae queries] [B<-ns> namespace declarations] [B<-d> rdf database] [B<-p> XML parser] [B<-s> source only] [B<-ByPredicate>] [B<-BySubjectType>] [B<-BySubject>] [B<-noColumns>] [B<-set> variable=value] B<url or filename> ...

=head1 DESCRIPTION

I<rdf_browser> B<GET>s each C<url or filename>, parses them with the 
C<XML parser>, and displays the results with a set of PerlTk widgets.

=head1 OPTIONS

=over 5

=item B<-a> algae queries

.

=item B<-ns> namespace declarations

.

=item B<-d> rdf database

.

=item B<-p> XML parser

.

=item B<-s> source only

.

=item B<-ByPredicate>

.

=item B<-BySubjectType>

.

=item B<-BySubject>

.

=item B<-noColumns>

.

=item B<-set> variable=value

.

=item B<url or filename>

.


=back

=head1 ENVIRONMENT

It helps to have rdf_browser in the C<PATH> environment variables.

=head1 ARCHITECTURE

Some of this is fact, other merely intended fact. Such is the road to
hell documented.

Each RdfDB is passed to the RdfAggregater used as a datasource and potential algae assertion target. Initially, B<rdf_browser> displays the statements that emerged from the command line C<url>s. 

=head1 AUTHOR

Eric Prud'hommmeaux <eric@w3.org>

=cut

#
# Version 1.20: $Id: rdf_browser,v 1.23 2004/06/08 06:51:00 eric Exp $
#       documenting and fixing RdfDB interface
