Parser options

There are several options that can be set on parsers. The exact list of options can be found at run time via the Querying Functionality or in the API reference for raptor_option.

Options are integer enumerations of the raptor_option enum and have typed values that are either booleans, integers or strings. The function that sets options for parsers is raptor_parser_set_option() used as follows:

  /* Set a boolean or integer valued option to value 1 */
  raptor_parser_set_option(rdf_parser, option, NULL, 1);

  /* Set a string valued option to value "abc" */
  raptor_parser_set_option(rdf_parser, option, "abc", -1);

There is a corresponding function for reading the values of parser option raptor_parser_get_option() which takes the option enumeration parameter and returns the boolean / integer or string value correspondingly into the appropriate pointer argument.

  /* Get a boolean or integer option value */
  int int_var;
  raptor_parser_get_option(rdf_parser, option, NULL, &int_var);

  /* Get a string option value */
  char* string_var;
  raptor_parser_get_option(rdf_parser, option, &string_var, NULL);



Navigation: Redland Home Page

Copyright 2000-2023 Dave Beckett