You are here

function _rdfx_get_vocabulary_details in RDF Extensions 7.2

1 call to _rdfx_get_vocabulary_details()
_rdfx_extract_schema in ./rdfx.terms.inc
Queries a set of triples for classes and properties, and builds an associative array describing the vocabulary and any classes and properties found.

File

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

Code

function _rdfx_get_vocabulary_details(&$model, $ns_uri) {
  $query_predicates = array(
    'title' => array(
      'http://www.w3.org/2000/01/rdf-schema#label',
      'http://purl.org/dc/elements/1.1/title',
      'http://purl.org/dc/terms/title',
    ),
    'description' => array(
      'http://www.w3.org/2000/01/rdf-schema#comment',
      'http://purl.org/dc/elements/1.1/description',
      'http://purl.org/dc/terms/description',
    ),
  );
  if (substr($ns_uri, -1) == '#') {
    $uri = substr($ns_uri, 0, -1);
  }
  foreach ($query_predicates as $query_element => $predicates) {
    foreach ($predicates as $predicate) {
      $queries[$query_element][] = array(
        $ns_uri,
        $predicate,
        '?',
      );

      //       if ($uri !== NULL) {
      //         $queries[$query_element][] = array($uri, $predicate, '?');
      //       }
    }
    $details[$query_element] = _rdfx_query_find_literal($model, $queries[$query_element]);
  }
  return $details;
}