aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd/serd.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-01-13 16:13:46 +0100
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:05 -0500
commit6bcd18ae60482790b645a345f718e7099250f261 (patch)
tree154fa41e8540ff03d43c9a1fa69568e0af5483d2 /include/serd/serd.h
parent8f84a055c88c2c271abe9cf86e998a3e5d0a4ced (diff)
downloadserd-6bcd18ae60482790b645a345f718e7099250f261.tar.gz
serd-6bcd18ae60482790b645a345f718e7099250f261.tar.bz2
serd-6bcd18ae60482790b645a345f718e7099250f261.zip
Simplify literal construction API
Diffstat (limited to 'include/serd/serd.h')
-rw-r--r--include/serd/serd.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 41ee9993..16c600ef 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -557,14 +557,23 @@ serd_new_string(SerdStringView string);
/**
Create a new literal node from `str`.
- Either `datatype_uri` or `lang` can be given, but not both, unless
- `datatype_uri` 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_ALLOCATED
-serd_new_literal(SerdStringView string,
- SerdStringView datatype_uri,
- SerdStringView lang);
+serd_new_plain_literal(SerdStringView str, SerdStringView 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_ALLOCATED
+serd_new_typed_literal(SerdStringView str, SerdStringView datatype_uri);
/// Create a new blank node
SERD_API