#!/usr/local/bin/perl -w

use RDF::Pool;

# object-style usage, parameter is default RDF identifier prefix
my $pool = RDF::Pool->new("http://sample.com/cars#");

# set a combination: perl_prefix, rdf_prefix, xml_prefix
# (the xml_prefix is advisory, for use in output; not used on input)
$pool->add_prefix("_color_", "http://sample.com/color#", "color");
    
# construct objects as you like, 
$car = { colorName=>"Blue", make=>"Honda", model=>"Civic", year=>"1991" };
$pool->add($car);

print "<!-- Pool without Perl Object Type (bless) -->\n" . $pool->as_rdfxml();

bless $car, Car;

print "\n\n<!-- Pool with Perl Object Type (bless) -->\n" . $pool->as_rdfxml();

my $blue = bless { _color_name=>"Blue" }, _color_Color;
$car->{colorObject} = $blue;

# add something to the pool ($blue will be included automatically because
# it's needed by $car)

print "\n\n<!-- Pool with Nested Object -->\n" . $pool->as_rdfxml();

my $radio = bless {}, Radio;
my $powerWindows = bless {}, PowerWindows;
$car->{'@feature'} = [$radio, $powerWindows];

print "\n\n<!-- With Multiple-Valued Property -->\n" . $pool->as_rdfxml();


#$car->{featureList} = [$radio, $powerWindows];
#print "\n\n<!-- With List -->\n" . $pool->as_rdfxml();
