Serd C API¶
-
struct
SerdBuffer
¶ A mutable buffer in memory
-
void *
buf
¶ Buffer.
-
size_t
len
¶ Size of buffer in bytes.
-
void *
-
enum
SerdStatementFlag
¶ Flags indicating inline abbreviation information for a statement.
-
enumerator
SERD_EMPTY_S
¶ Empty blank node subject.
-
enumerator
SERD_ANON_S
¶ Start of anonymous subject.
-
enumerator
SERD_ANON_O
¶ Start of anonymous object.
-
enumerator
SERD_LIST_S
¶ Start of list subject.
-
enumerator
SERD_LIST_O
¶ Start of list object.
-
enumerator
SERD_TERSE_S
¶ Terse serialisation of new subject.
-
enumerator
SERD_TERSE_O
¶ Terse serialisation of new object.
-
enumerator
-
enum
SerdSerialisationFlag
¶ Flags that control the style of a model serialisation.
-
enumerator
SERD_NO_INLINE_OBJECTS
¶ Disable object inlining.
-
enumerator
-
enum
SerdNodeType
¶ Type of a node.
An RDF node, in the abstract sense, can be either a resource, literal, or a blank. This type is more precise, because syntactically there are two ways to refer to a resource (by URI or CURIE). Serd also has support for variable nodes to support some features, which are not RDF nodes.
There are also two ways to refer to a blank node in syntax (by ID or anonymously), but this is handled by statement flags rather than distinct node types.
-
enumerator
SERD_LITERAL
¶ Literal value. A literal optionally has either a language, or a datatype (not both).
-
enumerator
SERD_URI
¶ URI (absolute or relative). Value is an unquoted URI string, which is either a relative reference with respect to the current base URI (e.g. “foo/bar”), or an absolute URI (e.g. “http://example.org/foo”). RFC3986
-
enumerator
SERD_CURIE
¶ CURIE, a shortened URI. Value is an unquoted CURIE string relative to the current environment, e.g. “rdf:type”. CURIE Syntax 1.0
-
enumerator
SERD_BLANK
¶ A blank node. Value is a blank node ID without any syntactic prefix, like “id3”, which is meaningful only within this serialisation. RDF 1.1 Turtle
-
enumerator
SERD_VARIABLE
¶ A variable node. Value is a variable name without any syntactic prefix, like “name”, which is meaningful only within this serialisation. SPARQL 1.1 Query Language
-
enumerator
-
enum
SerdField
¶ Index of a node in a statement.
-
enumerator
SERD_SUBJECT
¶ Subject.
-
enumerator
SERD_PREDICATE
¶ Predicate (“key”)
-
enumerator
SERD_OBJECT
¶ Object (“value”)
-
enumerator
SERD_GRAPH
¶ Graph (“context”)
-
enumerator
-
enum
SerdStatementOrder
¶ Statement ordering.
-
enumerator
SERD_ORDER_SPO
¶ Subject, Predicate, Object.
-
enumerator
SERD_ORDER_SOP
¶ Subject, Object, Predicate.
-
enumerator
SERD_ORDER_OPS
¶ Object, Predicate, Subject.
-
enumerator
SERD_ORDER_OSP
¶ Object, Subject, Predicate.
-
enumerator
SERD_ORDER_PSO
¶ Predicate, Subject, Object.
-
enumerator
SERD_ORDER_POS
¶ Predicate, Object, Subject.
-
enumerator
SERD_ORDER_GSPO
¶ Graph, Subject, Predicate, Object.
-
enumerator
SERD_ORDER_GSOP
¶ Graph, Subject, Object, Predicate.
-
enumerator
SERD_ORDER_GOPS
¶ Graph, Object, Predicate, Subject.
-
enumerator
SERD_ORDER_GOSP
¶ Graph, Object, Subject, Predicate.
-
enumerator
SERD_ORDER_GPSO
¶ Graph, Predicate, Subject, Object.
-
enumerator
SERD_ORDER_GPOS
¶ Graph, Predicate, Object, Subject.
-
enumerator
-
enum
SerdModelFlag
¶ Flags that control model storage and indexing.
-
enumerator
SERD_INDEX_SPO
¶ Subject, Predicate, Object.
-
enumerator
SERD_INDEX_SOP
¶ Subject, Object, Predicate.
-
enumerator
SERD_INDEX_OPS
¶ Object, Predicate, Subject.
-
enumerator
SERD_INDEX_OSP
¶ Object, Subject, Predicate.
-
enumerator
SERD_INDEX_PSO
¶ Predicate, Subject, Object.
-
enumerator
SERD_INDEX_POS
¶ Predicate, Object, Subject.
-
enumerator
SERD_INDEX_GRAPHS
¶ Support multiple graphs in model.
-
enumerator
SERD_STORE_CURSORS
¶ Store original cursor of statements.
-
enumerator
-
enum
SerdReaderFlag
¶ Reader options.
-
enumerator
SERD_READ_LAX
¶ Tolerate invalid input where possible.
-
enumerator
SERD_READ_VARIABLES
¶ Support variable nodes.
-
enumerator
SERD_READ_EXACT_BLANKS
¶ Allow clashes with generated blanks.
-
enumerator
SERD_READ_PREFIXED
¶ Do not expand prefixed names.
-
enumerator
SERD_READ_RELATIVE
¶ Do not expand relative URI references.
-
enumerator
-
enum
SerdWriterFlag
¶ Writer style options.
These flags allow more precise control of writer output style. Note that some options are only supported for some syntaxes, for example, NTriples does not support abbreviation and is always ASCII.
-
enumerator
SERD_WRITE_ASCII
¶ Escape all non-ASCII characters.
-
enumerator
SERD_WRITE_UNQUALIFIED
¶ Do not shorten URIs into CURIEs.
-
enumerator
SERD_WRITE_UNRESOLVED
¶ Do not make URIs relative.
-
enumerator
SERD_WRITE_TERSE
¶ Write terser output without newlines.
-
enumerator
SERD_WRITE_LAX
¶ Tolerate lossy output.
-
enumerator
-
typedef struct SerdWorldImpl
SerdWorld
¶ Global library state.
-
typedef struct SerdNodesImpl
SerdNodes
¶ Hashing node container for interning and simplified memory management.
-
typedef struct SerdStatementImpl
SerdStatement
¶ A subject, predicate, and object, with optional graph context.
-
typedef struct SerdCursorImpl
SerdCursor
¶ The origin of a statement in a document.
-
typedef struct SerdEnvImpl
SerdEnv
¶ Lexical environment for relative URIs or CURIEs (base URI and namespaces)
-
typedef struct SerdModelImpl
SerdModel
¶ An indexed set of statements.
-
typedef struct SerdIterImpl
SerdIter
¶ An iterator that points to a statement in a model.
-
typedef struct SerdRangeImpl
SerdRange
¶ A range of statements in a model.
-
typedef struct SerdReaderImpl
SerdReader
¶ Streaming parser that reads a text stream and writes to a sink.
-
typedef struct SerdWriterImpl
SerdWriter
¶ Streaming serialiser that writes a text stream as statements are pushed.
-
typedef struct SerdSinkImpl
SerdSink
¶ An interface that receives a stream of RDF data.
-
typedef uint32_t
SerdStatementFlags
¶ Bitwise OR of SerdStatementFlag values.
-
typedef uint32_t
SerdSerialisationFlags
¶ Bitwise OR of SerdStatementFlag values.
-
typedef uint32_t
SerdModelFlags
¶ Bitwise OR of SerdModelFlag values.
-
typedef struct SerdNodeImpl
SerdNode
¶ An RDF node.
-
typedef uint32_t
SerdReaderFlags
¶ Bitwise OR of SerdReaderFlag values.
-
typedef uint32_t
SerdWriterFlags
¶ Bitwise OR of SerdWriterFlag values.
-
void
serd_free
(void *ptr)¶ Free memory allocated by Serd.
This function exists because some systems require memory allocated by a library to be freed by code in the same library. It is otherwise equivalent to the standard C free() function.