![]() |
![]() |
![]() |
Redland RDF Application Framework Manual | ![]() |
---|---|---|---|---|
char* librdf_heuristic_gen_name (char *name); int librdf_heuristic_is_blank_node (char *node); char* librdf_heuristic_get_blank_node (char *node); int librdf_heuristic_object_is_literal (char *object);
Various utility functions for performing heuristics such as generating a name, guessing if a string is a URI or RDF literal.
char* librdf_heuristic_gen_name (char *name);
Generate a new name from an existing name.
Adds an integer or increases the integer at the end of the name in order to generate a new one
name : |
the name |
Returns : | a new name or NULL on failure |
int librdf_heuristic_is_blank_node (char *node);
Try to guess if an node string is a blank node identifier.
The guessing is done by assuming the object is a blank node if it matches ^_: like N-Triples, N3 and related.
node : |
string object to guess type |
Returns : | non 0 if node is probably a blank node identifier |
char* librdf_heuristic_get_blank_node (char *node);
Get a blank node identifier from a node string.
Picks the blank node identifier out of a string. Looks for things like _:ABC
node : |
string object to guess type |
Returns : | the blank node identifer string or NULL if the node does not seem to be a blank node identifier |
int librdf_heuristic_object_is_literal (char *object);
Try to guess if an object string is a literal or a resource.
The guessing is done by assuming the object is a URL if it matches
^[isalnum()
]+:[^isblank()
]+$
This will be fooled by literals of form 'thing:non-blank-thing' but is good enough.
object : |
string object to guess type |
Returns : | non 0 if object is probably a literal |