1

I'm trying to extract RDFa data from an html page using EasyRDF. But it doesn't seem to work. E.g., I've tried:

$work = new EasyRdf_Graph("http://example.com/");
$work->load();
echo $work;
$title = $work->primaryTopic();
echo "Title: ".$title->get('dc:title')."\n";

This is the error I get:

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'EasyRdf_Http_Client only supports the 'http' and 'https' schemes.'

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
slwr
  • 1,105
  • 6
  • 16
  • 35
  • I don't see any error messages or unexpected output. What makes you think it's not working? "Questions concerning problems with code you've written must describe the specific problem — and **include valid code to reproduce it** — in the question itself." example.com isn't real; you can't get data from it, so this doesn't count as valid code. "Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, **why they didn't work, and the expected results**." What did you _expect_ this code to produce? What did it actually produce? – Joshua Taylor Nov 06 '13 at 13:23
  • Also, looking at http://www.easyrdf.org/, I don't see any mention of RDFa. Do you have reason to believe that it would extract RDF from an RDFa document, and would do it automatically at that? RDFa is a specification for _embedding_ RDF into XHTML. Typically you might use an [RDFa distiller](http://www.w3.org/2012/pyRdfa/) to extract the RDF from an RDFa document, and then work with the RDF afterward. – Joshua Taylor Nov 06 '13 at 13:24
  • 3
    EasyRdf 0.8 does support RDFa, but it's still in beta. you can use the converter at http://easyrdf-converter.aelius.com/ to test it out. Also, what version of EasyRdf are you using with your code above? – scor Nov 06 '13 at 13:26
  • 2
    I'm using version (0.7.2). I had reasons to believe RDFa would work automatically because I read it here: http://rdfa.info/dev/ «EasyRDF is a PHP library for extracting RDFa and working with RDF, in general.» – slwr Nov 06 '13 at 14:51
  • 2
    good point, I will fix the rdfa.info page to say that the version 0.8 should be used. – scor Nov 06 '13 at 16:05

0 Answers0