function RdfParsingTrait::rdfElementIsBlankNode

Same name in other branches
  1. 9 core/modules/rdf/tests/src/Traits/RdfParsingTrait.php \Drupal\Tests\rdf\Traits\RdfParsingTrait::rdfElementIsBlankNode()

Checks if RDF Node property is blank.

Parameters

string $html: The HTML to parse.

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

string $resource_uri: The URI of the resource which should have the given property.

string $property: The property being tested.

Return value

bool TRUE if the given property is blank.

1 call to RdfParsingTrait::rdfElementIsBlankNode()
CommentAttributesTest::_testBasicCommentRdfaMarkup in core/modules/rdf/tests/src/Functional/CommentAttributesTest.php
Helper function for testCommentRdfaMarkup().

File

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

Class

RdfParsingTrait
Defines a trait for parsing RDF properties from HTML.

Namespace

Drupal\Tests\rdf\Traits

Code

protected function rdfElementIsBlankNode($html, $base_uri, $resource_uri, $property) {
    $parser = new \EasyRdf_Parser_Rdfa();
    $graph = new \EasyRdf_Graph();
    $parser->parse($graph, $html, 'rdfa', $base_uri);
    return $graph->get($resource_uri, $property)
        ->isBnode();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.