You are here

function rdfx_get_gid in RDF Extensions 7.2

3 calls to rdfx_get_gid()
rdfx_get_nsids in ./rdfx.terms.inc
rdfx_save_terms in ./rdfx.terms.inc
Saves vocabulary terms.
_rdfx_save_vocabulary in ./rdfx.terms.inc
Saves the main namespace mapping for a vocabulary graph and the additional namespace mappings as defined in the document.

File

./rdfx.terms.inc, line 465
Functions for managing RDF Terms.

Code

function rdfx_get_gid($main_ns) {
  $gids = db_select('rdfx_namespaces', 'rdfns', array());
  $gids
    ->join('rdfx_vocabulary_graphs', 'rdfvg', 'rdfvg.main_ns = rdfns.nsid');
  $gids
    ->fields('rdfns', array(
    'gid',
  ))
    ->condition('rdfns.uri', $main_ns);

  // @todo There should only be one result if there is a matching vocab source.
  // However, perhaps we should test to make sure and throw an error?
  $gid = $gids
    ->execute()
    ->fetchField();
  return $gid;
}