Set RDF triple callback handler

The main reason to parse a syntax is to get RDF triples returned and this is done by a callback function which is called with parameters of a user data pointer and the triple itself. The handler is set with raptor_set_statement_handler() as follows:

  void
  triples_handler(void* user_data, const raptor_statement* triple) 
  {
    /* do something with the triple */
  }

  raptor_set_statement_handler(rdf_parser, user_data, triples_handler);

It is optional to set a handler function for triples, which does have some uses if just counting triples or validating a syntax.



Navigation: Redland Home Page

Copyright 2000-2010 Dave Beckett