cormanaz has asked for the wisdom of the Perl Monks concerning the following question:

Good day bros. I am trying to do a simple parse of RDF docs returned by OpenCalais. I tried installing RDF::Parser from CPAN, but it's hosed. I tried manually installing it despite the make test fail, and when I try to run it, I get
could not find ParserDetails.ini in C:/Perl/site/lib/XML/SAX Unable to provide required features
Is there a way to get this to work or another option for parsing RDF? RDF::Core looks like it has a pretty serious learning curve, and all I really want to do is what this mod is supposed to do, i.e. retrieve a list of triples from the RDF doc.

Thx...

Steve

Replies are listed 'Best First'.
Re: RDF::Parser install problems--other option?
by Khen1950fx (Canon) on Feb 09, 2010 at 23:28 UTC
    If all you want is a list of tuples, then you're using the wrong module. Try this instead:

    RDF::Simple::Parser.

      My mistake. RDF::Simple, which contains RDF::Simple::Parser is what I tried to install. It fails on make test.
        It shouldn't be failing on you. For me, all the tests passed. I did notice a prereq problem though. One of the prereqs is Regexp::Common. I didn't have it installed. There's also a recommends for XML::SAX::Expat. I didn't have that, and make didn't ask if I wanted to install it. I threw this script together to check for and install the dependencies and the recommend:
        #!/usr/bin/perl use strict; use warnings; use CPAN; my @prereqs = ( "Class::MakeMethods", "File::Slurp", "IO::CaptureOutput", "LWP::UserAgent", "Regexp::Common", "Test::File", "URI::Escape", "XML::SAX", "XML::SAX::Expat"); foreach my $prereq( @prereqs) { system("pmpath $prereq"); } CPAN::Shell->install(@prereqs);
Re: RDF::Parser install problems--other option?
by cormanaz (Deacon) on Feb 11, 2010 at 11:35 UTC
    I never could get RDF::Simple to work. Don't know what the problem is, but if anyone else is messing around wih OpenCalais I recommend using the JSON output format. If you call it with outputFormat application/json you can do
    use JSON; open(IN,"calaisresultsjson.txt"); my $buffer; while(<IN>) { $buffer .= $_; } close IN; my $json = from_json($buffer);
    and you get everything back in a nice keyed hash, no muss no fuss.

    If I had written my query better, maybe some monk would have told me that and saved me several hours of frustration. :-/