function RdfParsingTrait::getElementRdfType
Same name in other branches
- 8.9.x 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.
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\TraitsCode
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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.