class SchemaOrgConverter in Schema.org configuration tool (RDF UI) 8
Extracts details of RDF resources from Schema.org.
Hierarchy
- class \Drupal\rdfui\EasyRdfConverter
- class \Drupal\rdfui\SchemaOrgConverter
Expanded class hierarchy of SchemaOrgConverter
4 files declare their use of SchemaOrgConverter
- ContentBuilderForm.php in rdf_builder/
src/ Form/ ContentBuilderForm.php - EasyRdfConverterTest.php in src/
Tests/ EasyRdfConverterTest.php - FieldMappings.php in src/
Form/ FieldMappings.php - rdfui.install in ./
rdfui.install
File
- src/
SchemaOrgConverter.php, line 9
Namespace
Drupal\rdfuiView source
class SchemaOrgConverter extends EasyRdfConverter {
/**
* Cache id.
*
* @var string
*/
private $cid = 'schema.org_converter';
/**
* Constructor.
*/
public function __construct() {
parent::__construct();
$this
->create();
}
/**
* {@inheritdoc}
*/
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);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EasyRdfConverter:: |
protected | property | EasyRdf Graph of the loaded resource. | |
EasyRdfConverter:: |
protected | property | List of Properties specified in Schema.org as string. | |
EasyRdfConverter:: |
protected | property | List of Types specified in Schema.org as string. | |
EasyRdfConverter:: |
private | function | Adds Property label to list. | |
EasyRdfConverter:: |
private | function | Adds Type label to list. | |
EasyRdfConverter:: |
protected | function | Creates an \EasyRdf\Graph object from the given URI. | |
EasyRdfConverter:: |
public | function | Gets the description of the resource. | |
EasyRdfConverter:: |
public | function | Gets a list of Schema.org properties. | |
EasyRdfConverter:: |
public | function | Gets a list of Schema.org types. | |
EasyRdfConverter:: |
private | function | Recursive function to extract properties. | |
EasyRdfConverter:: |
public | function | Gets data types in range of the property. | |
EasyRdfConverter:: |
public | function | Extracts properties of a given type. | |
EasyRdfConverter:: |
private | function | Identifies all types and properties of the graph separately. | |
EasyRdfConverter:: |
public | function | Gets label of the resource. | |
SchemaOrgConverter:: |
private | property | Cache id. | |
SchemaOrgConverter:: |
private | function | ||
SchemaOrgConverter:: |
public | function |
Constructor. Overrides EasyRdfConverter:: |