diff options
Diffstat (limited to 'serd/serd.h')
-rw-r--r-- | serd/serd.h | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/serd/serd.h b/serd/serd.h index 33196da1..6b11739d 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -351,7 +351,7 @@ serd_strtod(const char* str, size_t* end); /** Decode a base64 string. This function can be used to deserialise a blob node created with - serd_node_new_blob(). + serd_new_blob(). @param str Base64 string to decode. @param len The length of `str`. @@ -525,33 +525,42 @@ serd_uri_serialise_relative(const SerdURI* uri, */ SERD_API SerdNode* -serd_node_new_string(const char* str); +serd_new_string(const char* str); /** - Create a new literal node from `str`. + Create a new plain literal node from `str`. - Either `datatype` or `lang` can be given, but not both, unless `datatype` is - rdf:langString in which case it is ignored. + A plain literal has no datatype, but may have a language tag. The `lang` + may be NULL, in which case this is equivalent to `serd_new_string()`. */ SERD_API SerdNode* -serd_node_new_literal(const char* str, - const SerdNode* datatype, - const char* lang); +serd_new_plain_literal(const char* str, const char* lang); + +/** + Create a new typed literal node from `str`. + + A typed literal has no language tag, but may have a datatype. The + `datatype` may be NULL, in which case this is equivalent to + `serd_new_string()`. +*/ +SERD_API +SerdNode* +serd_new_typed_literal(const char* str, const SerdNode* datatype); /** Create a new blank node. */ SERD_API SerdNode* -serd_node_new_blank(const char* str); +serd_new_blank(const char* str); /** Create a new CURIE node. */ SERD_API SerdNode* -serd_node_new_curie(const char* str); +serd_new_curie(const char* str); /** Return a deep copy of `node`. @@ -572,14 +581,14 @@ serd_node_equals(const SerdNode* a, const SerdNode* b); */ SERD_API SerdNode* -serd_node_new_uri(const char* str); +serd_new_uri(const char* str); /** Create a new URI from a string, resolved against a base URI. */ SERD_API SerdNode* -serd_node_new_resolved_uri(const char* str, const SerdNode* base); +serd_new_resolved_uri(const char* str, const SerdNode* base); /** Resolve `node` against `base`. @@ -602,7 +611,7 @@ serd_node_resolve(const SerdNode* node, const SerdNode* base); */ SERD_API SerdNode* -serd_node_new_file_uri(const char* path, const char* hostname, bool escape); +serd_new_file_uri(const char* path, const char* hostname, bool escape); /** Create a new URI from a string, relative to a base URI. @@ -619,9 +628,9 @@ serd_node_new_file_uri(const char* path, const char* hostname, bool escape); */ SERD_API SerdNode* -serd_node_new_relative_uri(const char* str, - const SerdNode* base, - const SerdNode* root); +serd_new_relative_uri(const char* str, + const SerdNode* base, + const SerdNode* root); /** Create a new node by serialising `d` into an xsd:decimal string. @@ -644,7 +653,7 @@ serd_node_new_relative_uri(const char* str, */ SERD_API SerdNode* -serd_node_new_decimal(double d, unsigned frac_digits, const SerdNode* datatype); +serd_new_decimal(double d, unsigned frac_digits, const SerdNode* datatype); /** Create a new node by serialising `i` into an xsd:integer string. @@ -656,7 +665,7 @@ serd_node_new_decimal(double d, unsigned frac_digits, const SerdNode* datatype); */ SERD_API SerdNode* -serd_node_new_integer(int64_t i, const SerdNode* datatype); +serd_new_integer(int64_t i, const SerdNode* datatype); /** Create a node by serialising `buf` into an xsd:base64Binary string. @@ -673,10 +682,11 @@ serd_node_new_integer(int64_t i, const SerdNode* datatype); type xsd:base64Binary. */ SERD_API -SerdNode* serd_node_new_blob(const void* buf, - size_t size, - bool wrap_lines, - const SerdNode* datatype); +SerdNode* +serd_new_blob(const void* buf, + size_t size, + bool wrap_lines, + const SerdNode* datatype); /** Return the type of a node (SERD_URI, SERD_BLANK, or SERD_LITERAL). |