| Raptor RDF Syntax Parsing and Serializing Library Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
enum raptor_genid_type; enum raptor_term_type; raptor_term* raptor_new_term_from_blank (raptor_world *world, unsigned char *blank); raptor_term* raptor_new_term_from_literal (raptor_world *world, unsigned char *literal, raptor_uri *datatype, unsigned char *language); raptor_term* raptor_new_term_from_uri (raptor_world *world, raptor_uri *uri); raptor_term* raptor_term_copy (raptor_term *term); void raptor_free_term (raptor_term *term); unsigned char* raptor_term_as_counted_string (raptor_term *term, size_t *len_p); unsigned char* raptor_term_as_string (raptor_term *term); int raptor_term_ntriples_write (const raptor_term *term, raptor_iostream *iostr); raptor_statement; int raptor_statement_compare (const raptor_statement *s1, const raptor_statement *s2); void raptor_statement_init (raptor_statement *statement, raptor_world *world); void raptor_free_statement (raptor_statement *statement); int raptor_statement_print (const raptor_statement *statement, FILE *stream); int raptor_statement_print_as_ntriples (const raptor_statement *statement, FILE *stream); int raptor_statement_ntriples_write (const raptor_statement *statement, raptor_iostream *iostr);
Representation of RDF triples inside Raptor. They are a sequence
of three raptor_identifier which cover the RDF terms of
URI (RAPTOR_IDENTIFIER_TYPE_RESOURCE),
Literal (RAPTOR_IDENTIFIER_TYPE_LITERAL) and
Blank Node (RAPTOR_IDENTIFIER_TYPE_ANONYMOUS).
Some other raptor_identifer_type forms exist but are deprecated.
typedef enum {
RAPTOR_GENID_TYPE_BNODEID,
RAPTOR_GENID_TYPE_BAGID
} raptor_genid_type;
Intended type for a generated identifier asked for by the handler
registered with raptor_parser_set_generate_id_handler().
typedef enum {
RAPTOR_TERM_TYPE_UNKNOWN,
RAPTOR_TERM_TYPE_URI,
RAPTOR_TERM_TYPE_BLANK,
RAPTOR_TERM_TYPE_LITERAL
} raptor_term_type;
Type of term in a raptor_statement
raptor_term* raptor_new_term_from_blank (raptor_world *world, unsigned char *blank);
Constructor - create a new blank node statement term
Takes a copy of the passed in blank
|
raptor world |
|
blank node identifier |
Returns : |
new term or NULL on failure |
raptor_term* raptor_new_term_from_literal (raptor_world *world, unsigned char *literal, raptor_uri *datatype, unsigned char *language);
Constructor - create a new literal statement term
Takes copies of the passed in literal, datatype, language
|
raptor world |
|
literal data |
|
literal datatype URI (or NULL) |
|
literal language (or NULL) |
Returns : |
new term or NULL on failure |
raptor_term* raptor_new_term_from_uri (raptor_world *world, raptor_uri *uri);
Constructor - create a new URI statement term
Takes a copy (reference) of the passed in uri
|
raptor world |
|
uri |
Returns : |
new term or NULL on failure |
raptor_term* raptor_term_copy (raptor_term *term);
Copy constructor - get a copy of a statement term
|
raptor term |
Returns : |
new term object or NULL on failure |
void raptor_free_term (raptor_term *term);
Destructor - destroy a raptor_term object.
|
raptor_term object |
unsigned char* raptor_term_as_counted_string (raptor_term *term, size_t *len_p);
Turns part of raptor term into a N-Triples format counted string.
Turns the given term into an N-Triples escaped string using all the
escapes as defined in http://www.w3.org/TR/rdf-testcases/ntriples
This function uses raptor_term_ntriples_write() to write to an
raptor_iostream which is the prefered way to write formatted
output.
|
raptor_term |
|
Pointer to location to store length of new string (if not NULL) |
Returns : |
the new string or NULL on failure. The length of
the new string is returned in *len_p if len_p is not NULL.
|
unsigned char* raptor_term_as_string (raptor_term *term);
Turns part of raptor statement into a N-Triples format string.
Turns the given term into an N-Triples escaped string using all the
escapes as defined in http://www.w3.org/TR/rdf-testcases/ntriples
|
raptor_term |
Returns : |
the new string or NULL on failure. |
int raptor_term_ntriples_write (const raptor_term *term, raptor_iostream *iostr);
Write a raptor_term formatted in N-Triples format to a raptor_iostream
|
term to write |
|
raptor iostream |
Returns : |
non-0 on failure |
typedef struct {
raptor_world* world;
int usage;
raptor_term* subject;
raptor_term* predicate;
raptor_term* object;
raptor_term* graph;
} raptor_statement;
An RDF triple with optional graph name (quad)
See raptor_term for a description of how the fields may be used. As returned by a parser statement_handler.
raptor_world * |
world pointer |
| usage count | |
| statement subject | |
| statement predicate | |
| statement object | |
| statement graph name (or NULL if not present) |
int raptor_statement_compare (const raptor_statement *s1, const raptor_statement *s2);
Compare a pair of raptor_statement
Uses raptor_term_compare() to check ordering between subjects,
predicates and objects of statements.
|
first statement |
|
second statement |
Returns : |
<0 if s1 is before s2, 0 if equal, >0 if s1 is after s2 |
void raptor_statement_init (raptor_statement *statement, raptor_world *world);
Initialize a static raptor_statement.
|
statement to initialize |
|
raptor world |
void raptor_free_statement (raptor_statement *statement);
Destructor
|
statement |
int raptor_statement_print (const raptor_statement *statement, FILE *stream);
Print a raptor_statement to a stream.
|
raptor_statement object to print |
|
FILE* stream |
Returns : |
non-0 on failure |
int raptor_statement_print_as_ntriples (const raptor_statement *statement, FILE *stream);
Print a raptor_statement in N-Triples form.
|
raptor_statement to print |
|
FILE* stream |
Returns : |
non-0 on failure |
int raptor_statement_ntriples_write (const raptor_statement *statement, raptor_iostream *iostr);
Write a raptor_statement formatted in N-Triples format to a raptor_iostream
|
statement to write |
|
raptor iostream |
Returns : |
non-0 on failure |
Navigation: Redland Home Page