Event Handlers

struct SerdBaseEvent

Event for base URI changes.

Emitted whenever the base URI changes.

SerdEventType type

SerdEventType.SERD_BASE

const SerdNode *uri

Base URI.

struct SerdPrefixEvent

Event for namespace definitions.

Emitted whenever a prefix is defined.

SerdEventType type

SerdEventType.SERD_PREFIX

const SerdNode *name

Prefix name.

const SerdNode *uri

Namespace URI.

struct SerdStatementEvent

Event for statements.

Emitted for every statement.

SerdEventType type

SerdEventType.SERD_STATEMENT

SerdStatementFlags flags

Flags for pretty-printing.

const SerdStatement *statement

Statement.

struct SerdEndEvent

Event for the end of anonymous node descriptions.

This is emitted to indicate that the given anonymous node will no longer be described. This is used by the writer which may, for example, need to write a delimiter.

SerdEventType type

SerdEventType.SERD_END

const SerdNode *node

Anonymous node that is finished.

union SerdEvent

An event in a data stream.

Streams of data are represented as a series of events. Events represent everything that can occur in an RDF document, and are used to plumb together different components. For example, when parsing a document, a reader emits a stream of events which can be sent to a writer to serialise a document, or to an inserter to build a model in memory.

SerdEventType type

Event type (always set)

SerdBaseEvent base

Base URI changed.

SerdPrefixEvent prefix

New namespace prefix.

SerdStatementEvent statement

Statement.

SerdEndEvent end

End of anonymous node.

enum SerdEventType

Type of a SerdEvent.

enumerator SERD_BASE

Base URI changed.

enumerator SERD_PREFIX

New URI prefix.

enumerator SERD_STATEMENT

Statement.

enumerator SERD_END

End of anonymous node.

typedef SerdStatus (*SerdEventFunc)(void *handle, const SerdEvent *event)

Function for handling events.