#!/bin/env perl print "==== Example 1 - fetch a metadata record, print in RDF/XML\n" ; # Much the same as getting making the HTTP request and printing the # contents of the response but this shows that the WebAPI works as # RDF models. require Joseki ; require RDF::Core::Model ; require RDF::Core::Model::Serializer ; my $kbURL = 'http://jena.hpl.hp.com:2020/books' ; if ( $#ARGV != -1 ) { $kbURL = shift ; print "Data source = $kbURL\n" ; } my $bookRef = 'http://example.org/book/book2' ; my $model = Joseki->fetch($kbURL, $bookRef) ; my $xml = '' ; my $serializer = new RDF::Core::Model::Serializer(Model=>$model, Output=>\$xml, BaseURI => 'URI://BASE/' ); $serializer->serialize; print "$xml\n";