Volksdata 1.0b7
RDF library
Loading...
Searching...
No Matches
term.c File Reference
#include "volksdata/term.h"
Include dependency graph for term.c:

Go to the source code of this file.

Data Structures

struct  KeyedTerm
 Key-term pair in term set. More...
 Single link between a term and a term set. More...
struct  VOLK_LinkMapIterator
 Opaque link map iterator. More...
struct  VOLK_LinkMap

Macros

#define MAX_VALID_TERM_TYPE   VOLK_TERM_BNODE /* For type validation. */

Functions

VOLK_TermVOLK_term_new (VOLK_TermType type, const char *data, void *metadata)
 Create a new term.
VOLK_TermVOLK_term_copy (const VOLK_Term *src)
 Copy a term.
VOLK_TermVOLK_term_new_from_buffer (const VOLK_Buffer *sterm)
 See notes in VOLK_term_serialize function body for format info.
VOLK_TermVOLK_iriref_new_abs (const VOLK_Term *root, const VOLK_Term *iri)
 Create a new absolute IRI from a path relative to a root IRI.
VOLK_TermVOLK_iriref_new_rel (const VOLK_Term *root, const VOLK_Term *iri)
 Create a new relative IRI from an absolute IRI and a web root IRI.
VOLK_BufferVOLK_term_serialize (const VOLK_Term *term)
 Serialize a term into a buffer.
VOLK_Key VOLK_term_hash (const VOLK_Term *term)
 Hash a buffer.
void VOLK_term_free (VOLK_Term *term)
char * VOLK_iriref_prefix (const VOLK_Term *iri)
 Get the prefix portion of a IRI ref.
char * VOLK_iriref_path (const VOLK_Term *iri)
 Get the path portion of a IRI ref.
char * VOLK_iriref_frag (const VOLK_Term *iri)
 Get the fragment portion of a IRI ref.
VOLK_TripleVOLK_triple_new (VOLK_Term *s, VOLK_Term *p, VOLK_Term *o)
 Create a new triple from three terms.
VOLK_TripleVOLK_triple_new_from_btriple (const VOLK_BufferTriple *sspo)
VOLK_BufferTripleVOLK_triple_serialize (const VOLK_Triple *spo)
VOLK_rc VOLK_triple_init (VOLK_Triple *spo, VOLK_Term *s, VOLK_Term *p, VOLK_Term *o)
 Initialize internal term pointers in a heap-allocated triple.
void VOLK_triple_done (VOLK_Triple *spo)
 Free the internal pointers of a triple.
void VOLK_triple_free (VOLK_Triple *spo)
 Free a triple and all its internal pointers.
VOLK_TermSetVOLK_term_set_new ()
 Create a new term set.
VOLK_rc VOLK_term_set_add (VOLK_TermSet *ts, VOLK_Term *term, VOLK_Term **existing)
 Add term to a term set.
const VOLK_TermVOLK_term_set_get (VOLK_TermSet *ts, VOLK_Key key)
 Get a term from a term set.
VOLK_rc VOLK_term_set_next (VOLK_TermSet *ts, size_t *i, VOLK_Term **term)
 Iterate trough a term set.
void VOLK_term_set_free (VOLK_TermSet *ts)
 Free a term set.
size_t VOLK_term_set_size (VOLK_TermSet *ts)
 Size of a term set.
VOLK_LinkMapVOLK_link_map_new (const VOLK_Term *linked_term, VOLK_LinkType type)
 New link map.
void VOLK_link_map_free (VOLK_LinkMap *lm)
 Free a link map.
VOLK_LinkType VOLK_link_map_type (const VOLK_LinkMap *map)
 Return the link map type.
VOLK_rc VOLK_link_map_add (VOLK_LinkMap *lmap, VOLK_Term *term, VOLK_TermSet *tset)
 Add a term - term set pair to a link map.
VOLK_LinkMapIterator * VOLK_link_map_iter_new (const VOLK_LinkMap *lmap)
 Create a new iterator to loop through a link map.
void VOLK_link_map_iter_free (VOLK_LinkMapIterator *it)
 Free a link map iterator.
VOLK_rc VOLK_link_map_next (VOLK_LinkMapIterator *it, VOLK_Term **lt, VOLK_TermSet **ts)
 Iterate through a link map.
VOLK_rc VOLK_link_map_triples (VOLK_LinkMapIterator *it, VOLK_Triple *spo)
 Iterate over a link map and generate triples.
VOLK_rc VOLK_parse_iri (char *iri_str, VOLK_IRIInfo *iri_info)
 scan an IRI string and parse IRI parts.
VOLK_TermVOLK_iriref_new (const char *data)
 Create an IRI reference.
VOLK_TermVOLK_iriref_new_ns (const char *data)
 Create an IRI reference from a namespace-prefixed string.
VOLK_TermVOLK_literal_new (const char *data, VOLK_Term *datatype)
 Shortcut to create a literal term.
VOLK_TermVOLK_lt_literal_new (const char *data, char *lang)
 Shortcut to create a language-tagged literal term.
VOLK_TermVOLK_bnode_new (const char *data)
 Shortcut to create a blank node.
bool VOLK_term_equals (const VOLK_Term *term1, const VOLK_Term *term2)
 Compare two terms.
VOLK_TermVOLK_triple_pos (const VOLK_Triple *trp, VOLK_TriplePos n)
 Get triple by term position.
VOLK_Key VOLK_triple_hash (const VOLK_Triple *trp)
 Hash a triple.

Variables

uint32_t VOLK_default_dtype_key = 0
 Compiled hash of default literal data type.
VOLK_TermVOLK_default_ctx = NULL
 Default context.
VOLK_TermVOLK_default_datatype = NULL
 Default literal data type URI.
VOLK_TermSetVOLK_term_cache = NULL
 Global term cache.

Macro Definition Documentation

◆ MAX_VALID_TERM_TYPE

#define MAX_VALID_TERM_TYPE   VOLK_TERM_BNODE /* For type validation. */

Definition at line 3 of file term.c.