You are here

public function EasyRdfConverter::description in Schema.org configuration tool (RDF UI) 8

Gets the description of the resource.

Parameters

string $uri: URI of the resource (eg: schema:Person).

Return value

string|null Description of the resource or null.

File

src/EasyRdfConverter.php, line 215

Class

EasyRdfConverter
Extracts details of RDF resources from an RDFa document.

Namespace

Drupal\rdfui

Code

public function description($uri) {
  if (empty($uri)) {
    \Drupal::messenger()
      ->addStatus($this
      ->t("Invalid uri"));
    return NULL;
  }
  $comment = $this->graph
    ->get($uri, "rdfs:comment");
  if (!empty($comment)) {
    return $comment
      ->getValue();
  }
  return NULL;
}