| Top |
Representation of RDF statements inside Raptor. They are
a 3 or 4-tuple of raptor_term which cover the RDF terms of
URI (RAPTOR_TERM_TYPE_URI),
Literal (RAPTOR_TERM_TYPE_LITERAL) and
Blank Node (RAPTOR_TERM_TYPE_BLANK).
raptor_term * raptor_new_term_from_blank (raptor_world *world,const unsigned char *blank);
raptor_term * raptor_new_term_from_counted_blank (raptor_world *world,const unsigned char *blank,size_t length);
raptor_term * raptor_new_term_from_literal (raptor_world *world,const unsigned char *literal,raptor_uri *datatype,const unsigned char *language);
raptor_term * raptor_new_term_from_counted_literal (raptor_world *world,const unsigned char *literal,size_t literal_len,raptor_uri *datatype,const unsigned char *language,unsigned char language_len);
raptor_term * raptor_new_term_from_counted_uri_string (raptor_world *world,const unsigned char *uri_string,size_t length);
raptor_term * raptor_new_term_from_uri (raptor_world *world,raptor_uri *uri);
raptor_term * raptor_new_term_from_uri_string (raptor_world *world,const unsigned char *uri_string);
raptor_term * raptor_new_term_from_counted_string (raptor_world *world,unsigned char *string,size_t length);
unsigned char * raptor_term_to_counted_string (raptor_term *term,size_t *len_p);
int raptor_term_ntriples_write (const raptor_term *term,raptor_iostream *iostr);
raptor_term_ntriples_write is deprecated and should not be used in newly-written code.
unsigned char * raptor_term_to_turtle_counted_string (raptor_term *term,raptor_namespace_stack *nstack,raptor_uri *base_uri,size_t *len_p);
unsigned char * raptor_term_to_turtle_string (raptor_term *term,raptor_namespace_stack *nstack,raptor_uri *base_uri);
int raptor_term_turtle_write (raptor_iostream *iostr,raptor_term *term,raptor_namespace_stack *nstack,raptor_uri *base_uri);
raptor_statement * raptor_new_statement_from_nodes (raptor_world *world,raptor_term *subject,raptor_term *predicate,raptor_term *object,raptor_term *graph);
int raptor_statement_compare (const raptor_statement *s1,const raptor_statement *s2);
int raptor_statement_equals (const raptor_statement *s1,const raptor_statement *s2);
void raptor_statement_init (raptor_statement *statement,raptor_world *world);
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,int write_graph_term);
Type of term in a raptor_statement
Node type 3 is unused but exists to preserve numeric compatibility with librdf_node_type values.
typedef struct {
raptor_world* world;
int usage;
raptor_term_type type;
raptor_term_value value;
} raptor_term;
An RDF statement term
raptor_world * |
world |
|
usage reference count (if >0) |
||
raptor_term_type |
term type |
|
raptor_term_value |
term values per type |
Term value - this typedef exists solely for use in raptor_term
raptor_uri * |
uri value when term type is RAPTOR_TERM_TYPE_URI |
|
raptor_term_literal_value |
literal value when term type is RAPTOR_TERM_TYPE_LITERAL |
|
raptor_term_blank_value |
blank value when term type is RAPTOR_TERM_TYPE_BLANK |
typedef struct {
unsigned char *string;
unsigned int string_len;
} raptor_term_blank_value;
Blank term value - this typedef exists solely for use in raptor_term
typedef struct {
unsigned char *string;
unsigned int string_len;
raptor_uri *datatype;
unsigned char *language;
unsigned char language_len;
} raptor_term_literal_value;
Literal term value - this typedef exists solely for use in raptor_term
Either datatype
or language
may be non-NULL but not both.
literal string |
||
length of string |
||
raptor_uri * |
datatype URI (or NULL) |
|
literal language (or NULL) |
||
length of language |
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 |
||
raptor_term * |
statement subject |
|
raptor_term * |
statement predicate |
|
raptor_term * |
statement object |
|
raptor_term * |
statement graph name (or NULL if not present) |