function RdfParsingTrait::getInstanceGraph

Gets a new instance of EasyRdf\Graph or EasyRdf_Graph.

@todo Clean this up in drupal:10.0.0.

Return value

\EasyRdf\Graph|\EasyRdf_Graph The instance.

See also

https://www.drupal.org/node/3176468

5 calls to RdfParsingTrait::getInstanceGraph()
RdfParsingTrait::getElementByRdfTypeCount in core/modules/rdf/tests/src/Traits/RdfParsingTrait.php
Counts the number of resources of the provided type.
RdfParsingTrait::getElementRdfType in core/modules/rdf/tests/src/Traits/RdfParsingTrait.php
Gets type of RDF Element.
RdfParsingTrait::hasRdfChildProperty in core/modules/rdf/tests/src/Traits/RdfParsingTrait.php
Checks if a html document contains a resource with a given property value.
RdfParsingTrait::hasRdfProperty in core/modules/rdf/tests/src/Traits/RdfParsingTrait.php
Checks if a html document contains a resource with a given property value.
RdfParsingTrait::rdfElementIsBlankNode in core/modules/rdf/tests/src/Traits/RdfParsingTrait.php
Checks if RDF Node property is blank.

File

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

Class

RdfParsingTrait
Defines a trait for parsing RDF properties from HTML.

Namespace

Drupal\Tests\rdf\Traits

Code

private function getInstanceGraph() {
    if (class_exists('EasyRdf\\Graph')) {
        return new Graph();
    }
    return new \EasyRdf_Graph();
}

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