Last updated 18 February 2008. Created on 18 February 2008.
Edited by Arto. Log in to edit this page.

The SPARQL API exposes the following Drupal hooks that third-party extension modules can implement to provide extended functionality:

hook_sparql()

Allows modules to modify SPARQL queries before they are executed. This could be said to be the RDF equivalent of db_rewrite_sql().

Example of usage

/**
 * Implementation of hook_sparql().
 */
function mymodule_sparql($op, &$query) {
  switch ($op) {
    case 'ask':
      // An ASK query is being executed
      break;
    case 'select':
      // A SELECT query is being executed
      break;
    case 'construct':
      // A CONSTRUCT query is being executed
      break;
    case 'describe':
      // A DESCRIBE query is being executed
      break;
  }
}

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.