You are here

protected function RdfParsingTrait::getElementRdfType in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/rdf/tests/src/Traits/RdfParsingTrait.php \Drupal\Tests\rdf\Traits\RdfParsingTrait::getElementRdfType()
  2. 10 core/modules/rdf/tests/src/Traits/RdfParsingTrait.php \Drupal\Tests\rdf\Traits\RdfParsingTrait::getElementRdfType()

Gets type of RDF Element.

Parameters

\Drupal\Core\Url $url: URL of the document.

string $base_uri: The base URI for the html being parsed.

string $resource_uri: The URI of the resource from where to get element.

Return value

string|null The type of resource or NULL if the resource has no type.

Throws

\EasyRdf\Exception

6 calls to RdfParsingTrait::getElementRdfType()
StandardProfileTest::assertRdfaCommonNodeProperties in core/modules/rdf/tests/src/Functional/StandardProfileTest.php
Tests output for properties held in common between articles and pages.
StandardProfileTest::assertRdfaNodeCommentProperties in core/modules/rdf/tests/src/Functional/StandardProfileTest.php
Tests output for comment properties on nodes in full page view mode.
StandardProfileTest::doArticleRdfaTests in core/modules/rdf/tests/src/Functional/StandardProfileTest.php
Tests that article data is exposed using RDFa.
StandardProfileTest::doPageRdfaTests in core/modules/rdf/tests/src/Functional/StandardProfileTest.php
Tests that page data is exposed using RDFa.
StandardProfileTest::doTermRdfaTests in core/modules/rdf/tests/src/Functional/StandardProfileTest.php
Tests that term data is exposed on term page.

... See full list

File

core/modules/rdf/tests/src/Traits/RdfParsingTrait.php, line 119

Class

RdfParsingTrait
Defines a trait for parsing RDF properties from HTML.

Namespace

Drupal\Tests\rdf\Traits

Code

protected function getElementRdfType(Url $url, $base_uri, $resource_uri) {
  $parser = $this
    ->getInstanceParser();
  $graph = $this
    ->getInstanceGraph();
  $parser
    ->parse($graph, $this
    ->drupalGet($url), 'rdfa', $base_uri);
  return $graph
    ->type($resource_uri);
}