You are here

function _rdfx_extract_schema in RDF Extensions 7.2

Queries a set of triples for classes and properties, and builds an associative array describing the vocabulary and any classes and properties found.

Parameters

array $model An ARC2-style array of triples an RDFS vocabulary or OWL ontology:

array $namespaces Associative array of namespaces parsed from the RDF file:

string $ns_prefix Namespace prefix for the vocabulary:

string $ns_uri Only terms in this namespace will be considered:

Return value

array Array describing the vocabulary, its classes and properties.

1 call to _rdfx_extract_schema()
evoc_fetch_vocabulary in evoc/evoc.module
Fetches the classes and properties of an external RDF vocabulary.

File

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

Code

function _rdfx_extract_schema(&$model, $namespaces, $ns_prefix, $ns_uri) {
  $vocabulary_details = _rdfx_get_vocabulary_details($model, $ns_uri);
  $terms = _rdfx_fetch_terms($model);
  $vocabulary = array(
    'uri' => $ns_uri,
    'title' => $vocabulary_details['title'],
    'description' => $vocabulary_details['description'],
    'terms' => $terms,
    'namespaces' => $namespaces,
  );
  return $vocabulary;
}