Volksdata 1.0b7
RDF library
Loading...
Searching...
No Matches

Prototype for initializing a dataset decoding loop. More...

#include <codec_interface.h>

Collaboration diagram for VOLK_Codec:

Data Fields

decode_ds_fn_t decode_dset
 dataset decoder initialization.
decode_gr_fn_t decode_graph
 Graph decoder function.
decode_term_fn_t decode_term
 Term decoder function.
encode_ds_done_fn_t encode_dset_done
 dataset encoder finalization.
encode_ds_init_fn_t encode_dset_init
 dataset encoder initialization.
encode_ds_iter_fn_t encode_dset_iter
 dataset encoder iteration.
encode_gr_done_fn_t encode_graph_done
 Graph encoder finalization.
encode_gr_init_fn_t encode_graph_init
 Graph encoder initialization.
encode_gr_iter_fn_t encode_graph_iter
 Graph encoder iteration.
encode_store_done_fn_t encode_store_done
 store encoder finalization.
encode_store_init_fn_t encode_store_init
 store encoder initialization.
encode_store_iter_fn_t encode_store_iter
 store encoder iteration.
encode_term_fn_t encode_term
 Feature flags.
char extension [8]
 Serialized file extension.
VOLK_CodecFeatures features
char mimetype [32]
 MIME type associated with the codec.
char name [16]
 Name of the codec.

Detailed Description

Prototype for initializing a dataset decoding loop.

@TODO remove in favor of one-pass dataset encoding.

Parameters
[in]fhOpen file handle pointing to the RDF data. Implementations MUST NOT close the file handle. This is exclusive with sh.
[in]shstring handle for the RDF data. This is exclusive with fh. If both are specified, fh has precedence.
Returns
Pointer to opaque data to be passed to #decode_ds_iter_fn_t and #decode_ds_done_fn_t.

Prototype for decoding one graph in a dataset.

@TODO remove in favor of one-pass dataset encoding.

Parameters
[in]itOpaque iterator handle obtained by #decode_ds_init_fn_t.
[out]grGraph handle pointer to be populated with decoded graphs. The handle MUST NOT be initialized.
[out]ctIf not NULL, it MAY be populated with the number of triples parsed (which may be different from the resulting graph size). Implementations MAY choose not not use this.
[out]errPointer to error info string. If no error occurs, it yields NULL.
Returns
Implementations MUST return VOLK_OK on success and a negative value on parsing error.

Prototype for finalizing a dataset decoder iterator.

@TODO remove in favor of one-pass dataset encoding.

Parameters
[in]itOpaque iterator handle obtained by #decode_ds_init_fn_t.

Codec structure.

An instance of this structure is a singleton defined at compile time (see examples in "include/codec_*.h" and "src/codec_*.c") and MUST have the following defined:

  • name: A brief (15-char max), human-readable name for the codec.
  • mimetype: MIME type (31-char max) associated with the codec.
  • extension: File extension associated with the serialized file.

Additionally, it MAY implement any of the following encoding and decoding functions, depending on the scope of the codec:

  • encode_term: Encode a single term.
  • encode_graph_init: Initialize a graph decoding loop.
  • encode_graph_iter: Run one iteration of encoding on one or more triples.
  • encode_graph_done: Finalize the encoding loop and free the support data.
  • encode_dset_*: encode a dataset with zero or more graphs.
  • decode_term: Decode a single term.
  • decode_graph: Decode a RDF document into a graph.
  • decode_dset: Decode a RDF document into a dataset with zero or more graphs.

For documentation on the individual encoding and decoding callbacks, see the related function prototypes.

This interface is abstracted by the high-level codec module. That module handles non-implemented functionality gracefully by returning VOLK_NOT_IMPL_ERR.

Note
Functions in the high-level codec module do not check if a function is defined, they only look at the features flags to decide whether a function can be called. Therefore, implementers must be careful to match the implemented functions with the feature flags.

Definition at line 552 of file codec_interface.h.

Field Documentation

◆ decode_dset

decode_ds_fn_t VOLK_Codec::decode_dset

dataset decoder initialization.

Definition at line 578 of file codec_interface.h.

◆ decode_graph

decode_gr_fn_t VOLK_Codec::decode_graph

Graph decoder function.

Definition at line 576 of file codec_interface.h.

◆ decode_term

decode_term_fn_t VOLK_Codec::decode_term

Term decoder function.

Definition at line 574 of file codec_interface.h.

◆ encode_dset_done

encode_ds_done_fn_t VOLK_Codec::encode_dset_done

dataset encoder finalization.

Definition at line 567 of file codec_interface.h.

◆ encode_dset_init

encode_ds_init_fn_t VOLK_Codec::encode_dset_init

dataset encoder initialization.

Definition at line 565 of file codec_interface.h.

◆ encode_dset_iter

encode_ds_iter_fn_t VOLK_Codec::encode_dset_iter

dataset encoder iteration.

Definition at line 566 of file codec_interface.h.

◆ encode_graph_done

encode_gr_done_fn_t VOLK_Codec::encode_graph_done

Graph encoder finalization.

Definition at line 563 of file codec_interface.h.

◆ encode_graph_init

encode_gr_init_fn_t VOLK_Codec::encode_graph_init

Graph encoder initialization.

Definition at line 561 of file codec_interface.h.

◆ encode_graph_iter

encode_gr_iter_fn_t VOLK_Codec::encode_graph_iter

Graph encoder iteration.

Definition at line 562 of file codec_interface.h.

◆ encode_store_done

encode_store_done_fn_t VOLK_Codec::encode_store_done

store encoder finalization.

Definition at line 571 of file codec_interface.h.

◆ encode_store_init

encode_store_init_fn_t VOLK_Codec::encode_store_init

store encoder initialization.

Definition at line 569 of file codec_interface.h.

◆ encode_store_iter

encode_store_iter_fn_t VOLK_Codec::encode_store_iter

store encoder iteration.

Definition at line 570 of file codec_interface.h.

◆ encode_term

encode_term_fn_t VOLK_Codec::encode_term

Feature flags.

Term encoder function.

Definition at line 559 of file codec_interface.h.

◆ extension

char VOLK_Codec::extension[8]

Serialized file extension.

Definition at line 555 of file codec_interface.h.

◆ features

VOLK_CodecFeatures VOLK_Codec::features

Definition at line 556 of file codec_interface.h.

◆ mimetype

char VOLK_Codec::mimetype[32]

MIME type associated with the codec.

Definition at line 554 of file codec_interface.h.

◆ name

char VOLK_Codec::name[16]

Name of the codec.

Definition at line 553 of file codec_interface.h.


The documentation for this struct was generated from the following file: