aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/cpp/doc/nodes.rst
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-06-16 10:26:47 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit8fb8b922fb7575d7aed2f2184a02586b56ba873a (patch)
tree06ea3a48cefb5cb221359b17911380460e68e7c8 /bindings/cpp/doc/nodes.rst
parent74ddf7934336f16dcdce688333040d82972817fc (diff)
downloadserd-8fb8b922fb7575d7aed2f2184a02586b56ba873a.tar.gz
serd-8fb8b922fb7575d7aed2f2184a02586b56ba873a.tar.bz2
serd-8fb8b922fb7575d7aed2f2184a02586b56ba873a.zip
[WIP] Add C++ bindings
Diffstat (limited to 'bindings/cpp/doc/nodes.rst')
-rw-r--r--bindings/cpp/doc/nodes.rst38
1 files changed, 38 insertions, 0 deletions
diff --git a/bindings/cpp/doc/nodes.rst b/bindings/cpp/doc/nodes.rst
new file mode 100644
index 00000000..4726d738
--- /dev/null
+++ b/bindings/cpp/doc/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 constructors are provided that build nodes:
+
+- :func:`make_token`
+- :func:`make_uri`
+- :func:`make_file_uri`
+- :func:`make_literal`
+- :func:`make_decimal`
+- :func:`make_integer`
+- :func:`make_base64`
+
+Literal nodes for number types (`bool`, `double`, `int32_t`, and so on) can be constructed with the generic :func:`make` template.
+
+
+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.