You are here

function evoc_fetch_vocabulary in RDF Extensions 7.2

Fetches the classes and properties of an external RDF vocabulary.

Parameters

$vocabulary_uri: The namespace of the vocabulary to be fetched. Note most of the time this URI should end with / or #, e.g. http://rdfs.org/sioc/ns#

$vocabulary_prefix: Prefix used system-wide for referring to this namespace.

$vocabulary_location: URL of the vocabulary if the vocabulary namespace does not dereference and is not available at the namespace. Optionnal.

Return value

An array of fetched terms.

1 call to evoc_fetch_vocabulary()
evoc_import_vocabulary in evoc/evoc.module

File

evoc/evoc.module, line 74
Allows to import external Vocabularies in order to map them to Drupal data structure.

Code

function evoc_fetch_vocabulary($vocabulary_uri, $vocabulary_prefix, $vocabulary_location = NULL) {

  // Uses the vocabulary namespace URI if no specific location is given.
  $vocabulary_location = $vocabulary_location ? $vocabulary_location : $vocabulary_uri;
  module_load_include('inc', 'evoc', 'evoc.load_vocab');
  list($triples, $namespaces) = rdfx_fetch_rdf($vocabulary_uri, $vocabulary_prefix);
  $vocabulary = _rdfx_extract_schema($triples, $namespaces, $vocabulary_prefix, $vocabulary_uri);
  return $vocabulary;
}