diff options
author | David Robillard <d@drobilla.net> | 2018-06-16 10:26:47 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-28 21:57:29 -0500 |
commit | 8b1ad067d9450b4c9c4384b6bf2859c70a6b0cce (patch) | |
tree | 2a5cc8b0031658a472c44b8fd8e95cb583d24fc7 /doc/cpp/nodes.rst | |
parent | 3f74afa8c0e60a778566db975894044c67a3b386 (diff) | |
download | serd-8b1ad067d9450b4c9c4384b6bf2859c70a6b0cce.tar.gz serd-8b1ad067d9450b4c9c4384b6bf2859c70a6b0cce.tar.bz2 serd-8b1ad067d9450b4c9c4384b6bf2859c70a6b0cce.zip |
[WIP] Add C++ bindings
Diffstat (limited to 'doc/cpp/nodes.rst')
-rw-r--r-- | doc/cpp/nodes.rst | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/cpp/nodes.rst b/doc/cpp/nodes.rst new file mode 100644 index 00000000..c59bbd0d --- /dev/null +++ b/doc/cpp/nodes.rst @@ -0,0 +1,38 @@ +Nodes +===== + +.. default-domain:: cpp +.. highlight:: cpp +.. namespace:: serd + +Nodes are the basic building blocks of data. +Nodes are essentially strings, +but also have a :enum:`type <NodeType>`, +and optionally either a datatype or a language. + +In the abstract, a node is either a literal, a URI, or blank. +Serd also has a type for variable nodes, +which are used for some features but not present in RDF data. + +Construction +------------ + +Several convenient construction functions are provided that return nodes: + +- :func:`make_token` +- :func:`make_uri` +- :func:`make_file_uri` +- :func:`make_literal` +- :func:`make_boolean` +- :func:`make_decimal` +- :func:`make_double` +- :func:`make_float` +- :func:`make_integer` +- :func:`make_base64` + +Accessors +--------- + +The datatype or language of a node can be retrieved with :func:`~NodeWrapper::datatype` or :func:`~NodeWrapper::language`, respectively. +Note that only literals can have a datatype or language, +but never both at once. |