You are here

private function SchemaOrgConverter::create in Schema.org configuration tool (RDF UI) 8

1 call to SchemaOrgConverter::create()
SchemaOrgConverter::__construct in src/SchemaOrgConverter.php
Constructor.

File

src/SchemaOrgConverter.php, line 28

Class

SchemaOrgConverter
Extracts details of RDF resources from Schema.org.

Namespace

Drupal\rdfui

Code

private function create() {
  $uri = "https://schema.org/version/latest/schemaorg-current-http.rdf";
  $type = "rdfa";
  if ($cache = \Drupal::cache()
    ->get($this->cid)) {

    // Fetch cached copy of graph & lists.
    $data = $cache->data;
    $this->graph = $data['graph'];
    $this->listProperties = $data['listProperties'];
    $this->listTypes = $data['listTypes'];
  }
  else {
    $this
      ->createGraph($uri, $type);
    $data = array(
      'graph' => $this->graph,
      'listProperties' => $this->listProperties,
      'listTypes' => $this->listTypes,
    );
    \Drupal::cache()
      ->set($this->cid, $data);
  }
}