|
Volksdata 1.0b7
RDF library
|

Data Structures | |
| struct | NSEntry |
| Prefix / Namespace pair. More... | |
Macros | |
| #define | PFX_LEN 8 |
| Namespace prefix length, including terminator. | |
Typedefs | |
| typedef char | VOLK_ns_pfx[PFX_LEN] |
| Namespace prefix type. | |
Functions | |
| VOLK_rc | VOLK_nsmap_add (const char *pfx, const char *nsstr) |
| Add a prefix -> namespace pair to the map or update it. | |
| VOLK_rc | VOLK_nsmap_remove (const char *pfx) |
| Remove a prefix -> namespace pair from a map. | |
| const char * | VOLK_nsmap_get_ns (const char *pfx) |
| Get the namespace for a prefix. | |
| const char * | VOLK_nsmap_get_pfx (const char *ns) |
| Get the prefix for a namespace. | |
| VOLK_rc | VOLK_nsmap_normalize_uri (const char *pfx_uri, char **fq_uri) |
| Convert a namespace-prefixed string to a FQ URI sring if mapped. | |
| VOLK_rc | VOLK_nsmap_denormalize_uri (const char *fq_uri, char **pfx_uri) |
| Convert a FQ URI string to a prefixed string if the prefix is found. | |
| const char *** | VOLK_nsmap_dump (void) |
| Dump all entries of the namespace map. | |
Variables | |
| struct hashmap * | VOLK_default_nsm |
| Default namespace prefix map. | |
| #define PFX_LEN 8 |
Namespace prefix length, including terminator.
Definition at line 16 of file namespace.h.
| typedef char VOLK_ns_pfx[PFX_LEN] |
Namespace prefix type.
Definition at line 21 of file namespace.h.
| VOLK_rc VOLK_nsmap_add | ( | const char * | pfx, |
| const char * | nsstr ) |
Add a prefix -> namespace pair to the map or update it.
If the prefix already exists, it is quietly updated with the new value.
| [in] | pfx | The namespace prefix. |
| [in] | nsstr | Fully qualified namespace. |
Definition at line 42 of file namespace.c.
| VOLK_rc VOLK_nsmap_remove | ( | const char * | pfx | ) |
Remove a prefix -> namespace pair from a map.
| [in] | pfx | The namespace prefix to remove. |
Definition at line 70 of file namespace.c.
| const char * VOLK_nsmap_get_ns | ( | const char * | pfx | ) |
Get the namespace for a prefix.
| [in] | pfx | The prefix to look up. |
Definition at line 85 of file namespace.c.
| const char * VOLK_nsmap_get_pfx | ( | const char * | ns | ) |
Get the prefix for a namespace.
| [in] | ns | The namespace to look up. |
Definition at line 96 of file namespace.c.
| VOLK_rc VOLK_nsmap_normalize_uri | ( | const char * | pfx_uri, |
| char ** | fq_uri ) |
Convert a namespace-prefixed string to a FQ URI sring if mapped.
| [in] | pfx_uri | URI string to denormalize. |
| [out] | fq_uri | String pointer to be filled with the FQ URI. The caller is in charge of freeing the memory. If the namespace is not in the map or an error occurred, this will be NULL. This is to inform the caller that the result is not normalized and a TERM_NS_IRIREF should not be construed with it. |
Definition at line 110 of file namespace.c.
| VOLK_rc VOLK_nsmap_denormalize_uri | ( | const char * | fq_uri, |
| char ** | pfx_uri ) |
Convert a FQ URI string to a prefixed string if the prefix is found.
| [in] | fq_uri | URI string to normalize. |
| [out] | pfx_uri | String pointer to be filled with the prefixed URI. The caller is in charge of freeing the memory. If the namespace is not in the map or an error occurred, this will be NULL. This is to inform the caller that the result is not denormalized and a TERM_IRIREF should not be construed with it. |
Definition at line 153 of file namespace.c.
| const char *** VOLK_nsmap_dump | ( | void | ) |
Dump all entries of the namespace map.
const char ***nsm_data = VOLK_nsmap_dump (nsm);
// [...]
for (size_t i = 0; nsm_data[i] != NULL; i++)
free (nsm_data[i]);
free (nsm_data);
Definition at line 191 of file namespace.c.
|
extern |
Default namespace prefix map.
This is a singleton. It gets created with VOLK_init() and freed with VOLK_done().
API.
Definition at line 38 of file namespace.c.