Uncaught exception 'EasyRdf_Exception' with message 'No URI given to load() and the graph does not have a URI.' in C:\wamp\www\app\rdf\EasyRdf\Graph.php on line 275

25 views
Skip to first unread message

Rabia Majeed

unread,
Nov 8, 2017, 5:47:13 PM11/8/17
to EasyRdf Discussion
after using local rdf xml file, i got this error
code is

$graph = new EasyRdf_Graph(); 
     $graph->parseFile("profile.rdf"); 
$graph->load();
$me = $graph->primaryTopic();
echo "My name is: ".$me->get('fd:name')."\n";

Nicholas Humfrey

unread,
Nov 8, 2017, 5:58:38 PM11/8/17
to EasyRdf Discussion
Hello Rabia,

$graph->load() is used to download RDF from a URL - it is not needed when parsing a local file.
$graph->parseFile("profile.rdf") will do what you need it to do.

Without seeing the contents of profile.rdf is is hard to know exactly what is going wrong.
However 'fd' is not a standard namespace that EasyRDF knows about.

There is a list of default namespaces in RdfNamespace.php:

Maybe you meant to use foaf?


nick.

Rabia Majeed

unread,
Nov 9, 2017, 12:54:28 AM11/9/17
to EasyRdf Discussion
these are some contents of rdf file

<?xml version="1.0"?>
<rdf:RDF
<rdf:Description
 
  <fd:post>HOD, CIIT Islamabad</fd:post>
  <fd:email>majid...@abc.com</fd:email>
  <fd:phone>+92 51 1234 5678</fd:phone>
   
</rdf:Description>

</rdf:RDF>
Reply all
Reply to author
Forward
0 new messages