Convert a node into an associate array @ignore
protected function nodeToArray($node) {
$object = array();
$object['type'] = EasyRdf_Parser_Redland::nodeTypeString($node);
if ($object['type'] == 'uri') {
$object['value'] = EasyRdf_Parser_Redland::nodeUriString($node);
}
elseif ($object['type'] == 'bnode') {
$object['value'] = '_:' . librdf_node_get_blank_identifier($node);
}
elseif ($object['type'] == 'literal') {
$object['value'] = librdf_node_get_literal_value($node);
$lang = librdf_node_get_literal_value_language($node);
if ($lang) {
$object['lang'] = $lang;
}
$datatype = librdf_node_get_literal_value_datatype_uri($node);
if ($datatype) {
$object['datatype'] = librdf_uri_to_string($datatype);
}
}
else {
throw new EasyRdf_Exception("Unsupported type: " . $object['type']);
}
return $object;
}