I had an issue of parsing rdf with PHP, getting the data into a local variable.
The idea is to get rdf into a SimpleXML object withoud colons then use JSON decode.
<?php
$sentic = file_get_contents(“http://sentic.net/api/en/concept/love/”);
$sentic_replace = str_replace(“rdf:”, “”, $sentic); // delete all rdf: values to manipulate input with SimpleXml object
$xml = simplexml_load_string($sentic_replace); // load a SimpleXML object
$xml_to_json = json_decode(json_encode($xml), 1); // use json to get all values into an array
// print_r($xml_to_json);
// echo $xml_to_json[“Description”][“polarity”];
?>
And it’s done.