You are here

function rdfx_get_tid in RDF Extensions 7.2

1 call to rdfx_get_tid()
rdfx_save_terms in ./rdfx.terms.inc
Saves vocabulary terms.

File

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

Code

function rdfx_get_tid($term_uri, $graph_main_ns) {
  $nsids = rdfx_get_nsids($graph_main_ns);
  list($term_ns, $term_local_name) = rdfx_split_uri($term_uri);
  if (isset($nsids[$term_ns])) {
    $tid = db_query("SELECT tid FROM {rdfx_terms} WHERE nsid = :nsid AND local_name = :localname", array(
      ':nsid' => $nsids[$term_ns],
      ':localname' => $term_local_name,
    ))
      ->fetchField();
    return $tid;
  }
  else {
    return NULL;
  }
}