--- ../projectblogs/contributions/modules/rdfproxy/rdfproxy.module	2009-06-21 14:39:53.000000000 +0100
+++ sites/all/modules/contributions/modules/rdfproxy/rdfproxy.module	2009-12-03 16:30:47.000000000 +0000
@@ -100,11 +101,11 @@ function rdfproxy_lookup($profile) {
   // Build a node based on the RDF graph.
   // Get the content type to be created.
   foreach ($sparql_res as $triple) {
-    if ($triple[1] == rdf_qname_to_uri('rdf:type')) {
-      $found = preg_match('/.*#(.*)/', $triple[2], $matches);
+    if ($triple['p'] == rdf_qname_to_uri('rdf:type')) {
+      $found = preg_match('/.*#(.*)/', $triple['o'], $matches);
       if (isset($matches[1])) {
         $content_type_name = strtolower($matches[1]);
-        $instances["$triple[0]"]['type'] = $content_type_name;
+        $instances['"'.$triple['s'].'"']['type'] = $content_type_name;
       }
       else {
         drupal_set_message('The RDF proxy lookup was not able to find a suitable local content type.', 'error');
@@ -115,20 +116,18 @@ function rdfproxy_lookup($profile) {
 
   // Get values of the instances and their associated field name.
   // TODO embed these values in RDF CCK instead of guessing them here.
-  $values = array();
   foreach ($sparql_res as $triple) {
     // TODO add check on the site ns.
     //var_dump($triple);
-    $found = preg_match('/.*#[a-z_]*([A-Z])(.*)/', $triple[1], $matches);
+    $found = preg_match('/.*#[a-z_]*([A-Z])(.*)/', $triple['p'], $matches);
     if ($matches[2]) {
       $field_name = strtolower($matches[1] . $matches[2]);
       $field_name = ($field_name == 'title' || $field_name == 'body') ? $field_name : 'field_' . $field_name;
-      $value = rdf_val_to_str($triple[2]);
-      $instances["$triple[0]"]['values']["$field_name"][] = $value;
+      $value = rdf_val_to_str($triple['o']);
+      $instances['"'.$triple['s'].'"']['values']["$field_name"][] = $value;
     }
   }
 //var_dump($instances);
-//var_dump($values);
   foreach ($instances as $uri => $instance) {
     _rdfproxy_node_save($uri, $instance['type'], $instance['values'], $profile);
   }