aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/serd/node.h24
-rw-r--r--include/serd/reader.h3
2 files changed, 23 insertions, 4 deletions
diff --git a/include/serd/node.h b/include/serd/node.h
index b308a507..1faba160 100644
--- a/include/serd/node.h
+++ b/include/serd/node.h
@@ -38,9 +38,14 @@ typedef struct SerdNodeImpl SerdNode;
/**
Type of a node.
- An abstract RDF node can be either a resource or a literal. This type is
- more precise to preserve syntactic differences and support additional
- features.
+ Note that this set of types is both more precise than, and extended from,
+ the possible types of an abstract RDF node. Not all types can occur in all
+ contexts, for example, a Turtle document can't contain a variable node.
+
+ The string value of a node never contains quoting or other type indicators.
+ For example, the blank node `_:id3` and the plain literal `"id3"` from a
+ Turtle document would both have the same string, "id3", returned by
+ #serd_node_string.
*/
typedef enum {
/**
@@ -82,6 +87,19 @@ typedef enum {
Turtle](http://www.w3.org/TR/turtle/#grammar-production-BLANK_NODE_LABEL)
*/
SERD_BLANK = 4,
+
+ /**
+ A variable node.
+
+ A variable's identity is, like blank nodes, local to its context.
+ Variables are typically used in interfaces for querying, rather than
+ present in data (there is no concept of a variable in RDF or its standard
+ syntaxes).
+
+ @see [SPARQL 1.1 Query
+ Language](https://www.w3.org/TR/sparql11-query/#rVar)
+ */
+ SERD_VARIABLE = 5,
} SerdNodeType;
/// Node flags, which ORed together make a #SerdNodeFlags
diff --git a/include/serd/reader.h b/include/serd/reader.h
index 4c669342..040f3398 100644
--- a/include/serd/reader.h
+++ b/include/serd/reader.h
@@ -29,7 +29,8 @@ typedef struct SerdReaderImpl SerdReader;
/// Reader options
typedef enum {
- SERD_READ_LAX = 1U << 0U, ///< Tolerate invalid input where possible
+ SERD_READ_LAX = 1U << 0U, ///< Tolerate invalid input where possible
+ SERD_READ_VARIABLES = 1U << 1U, ///< Support variable nodes
} SerdReaderFlag;
/// Bitwise OR of SerdReaderFlag values