Nodes¶
-
LilvNode *
lilv_new_uri(LilvWorld *world, const char *uri)¶ Create a new URI value.
Returned value must be freed by caller with
lilv_node_free().
-
LilvNode *
lilv_new_file_uri(LilvWorld *world, const char *host, const char *path)¶ Create a new file URI value.
Relative paths are resolved against the current working directory. Note that this may yield unexpected results if
hostis another machine.- Parameters
world – The world.
host – Host name, or NULL.
path – Path on host.
- Returns
A new node that must be freed by caller.
-
LilvNode *
lilv_new_string(LilvWorld *world, const char *str)¶ Create a new string value (with no language).
Returned value must be freed by caller with
lilv_node_free().
-
LilvNode *
lilv_new_int(LilvWorld *world, int val)¶ Create a new integer value.
Returned value must be freed by caller with
lilv_node_free().
-
LilvNode *
lilv_new_float(LilvWorld *world, float val)¶ Create a new floating point value.
Returned value must be freed by caller with
lilv_node_free().
-
LilvNode *
lilv_new_bool(LilvWorld *world, bool val)¶ Create a new boolean value.
Returned value must be freed by caller with
lilv_node_free().
-
bool
lilv_node_equals(const LilvNode *value, const LilvNode *other)¶ Return whether two values are equivalent.
-
char *
lilv_node_get_turtle_token(const LilvNode *value)¶ Return this value as a Turtle/SPARQL token.
Returned value must be freed by caller with
lilv_free().Example tokens:
QName: doap:name
String: “this is a string”
Float: 1.0
Integer: 1
Boolean: true
-
const char *
lilv_node_as_uri(const LilvNode *value)¶ Return this value as a URI string, like “http://example.org/foo”.
Valid to call only if
lilv_node_is_uri(value)returns true. Returned value is owned byvalueand must not be freed by caller.
-
bool
lilv_node_is_blank(const LilvNode *value)¶ Return whether the value is a blank node (resource with no URI).
-
const char *
lilv_node_as_blank(const LilvNode *value)¶ Return this value as a blank node identifier, like “genid03”.
Valid to call only if
lilv_node_is_blank(value)returns true. Returned value is owned byvalueand must not be freed by caller.
-
bool
lilv_node_is_literal(const LilvNode *value)¶ Return whether this value is a literal (that is, not a URI).
Returns true if
valueis a string or numeric value.
-
bool
lilv_node_is_string(const LilvNode *value)¶ Return whether this value is a string literal.
Returns true if
valueis a string value (and not numeric).
-
char *
lilv_node_get_path(const LilvNode *value, char **hostname)¶ Return the path of a file URI node.
Returns NULL if
valueis not a file URI. Returned value must be freed by caller withlilv_free().
-
float
lilv_node_as_float(const LilvNode *value)¶ Return
valueas a float.Valid to call only if
lilv_node_is_float(value)orlilv_node_is_int(value)returns true.