SchemaOrgConverter.php in Schema.org configuration tool (RDF UI) 8
File
src/SchemaOrgConverter.php
View source
<?php
namespace Drupal\rdfui;
class SchemaOrgConverter extends EasyRdfConverter {
private $cid = 'schema.org_converter';
public function __construct() {
parent::__construct();
$this
->create();
}
private function create() {
$uri = "https://schema.org/version/latest/schemaorg-current-http.rdf";
$type = "rdfa";
if ($cache = \Drupal::cache()
->get($this->cid)) {
$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);
}
}
}