function _node($node) { $r = array(); if (librdf_node_is_resource($node)) { $r['type'] = 'uri'; $r['value'] = librdf_uri_to_string(librdf_node_get_uri($node)); } elseif (librdf_node_is_literal($node)) { $r['type'] = 'literal'; $r['value'] = librdf_node_get_literal_value($node); $dt = librdf_node_get_literal_value_datatype_uri($node); if ($dt) { $r['datatype'] = librdf_uri_to_string($dt); } } elseif (librdf_node_is_blank($node)) { $r['type'] = 'bnode'; $r['value'] = librdf_node_get_blank_identifier($node); } return $r; }
/** * Return the number of errors during parsing * @ignore */ protected function parserErrorCount($parser) { $errorUri = librdf_new_uri($this->_world, self::LIBRDF_PARSER_FEATURE_ERROR_COUNT); $errorNode = librdf_parser_get_feature($parser, $errorUri); $errorCount = librdf_node_get_literal_value($errorNode); librdf_free_uri($errorUri); return $errorCount; }
/** * @return string */ public function getValue() { return librdf_node_get_literal_value($this->redlandNode); }