Volksdata 1.0b7
RDF library
Loading...
Searching...
No Matches
RDF encoder & decoder module
Collaboration diagram for RDF encoder & decoder module:

Functions

const VOLK_CodecVOLK_codec_from_fmt (const char *fmt)
 Get a codec by its format string.
VOLK_rc VOLK_codec_decode_str (const char *data, const char *fmt, VOLK_Graph *gr)
 Populate a graph from a RDF string.
VOLK_rc VOLK_codec_decode_file (FILE *fh, const char *fmt, VOLK_Graph *gr)
 Populate a graph from a RDF file handle.

Detailed Description

Function Documentation

◆ VOLK_codec_from_fmt()

const VOLK_Codec * VOLK_codec_from_fmt ( const char * fmt)
inline

Get a codec by its format string.

Parameters
[in]fmtFormat string such as nt, ttl, etc.
Returns
Pointer to the codec singleton.

Definition at line 52 of file codec.h.

◆ VOLK_codec_decode_str()

VOLK_rc VOLK_codec_decode_str ( const char * data,
const char * fmt,
VOLK_Graph * gr )
inline

Populate a graph from a RDF string.

Parameters
[in]dataRDF string.
[in]fmtRDF format string, such as nt, ttl, etc.
[in]grGraph to populate. It MUST be initialized and it MAY be non- empty.
Returns
New graph, or NULL on error. Must be freed with VOLK_graph_free().

Definition at line 73 of file codec.h.

◆ VOLK_codec_decode_file()

VOLK_rc VOLK_codec_decode_file ( FILE * fh,
const char * fmt,
VOLK_Graph * gr )
inline

Populate a graph from a RDF file handle.

Parameters
[in]fhOpen RDF document file handle. The function will close the handle in all cases.
[in]fmtRDF format string, such as nt, ttl, etc.
[in]grGraph to populate. It MUST be initialized and it MAY be non- empty.
Returns
New graph, or NULL on error. Must be freed with VOLK_graph_free().

Definition at line 94 of file codec.h.