You are here

protected function EasyRdf_Parser_Turtle::parseImplicitBlank in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php \EasyRdf_Parser_Turtle::parseImplicitBlank()

Parses a blankNodePropertyList [15]

This method parses the token [] and predicateObjectLists that are surrounded by square brackets.

@ignore

3 calls to EasyRdf_Parser_Turtle::parseImplicitBlank()
EasyRdf_Parser_Turtle::parseObject in vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php
Parse a object [12] @ignore
EasyRdf_Parser_Turtle::parseSubject in vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php
Parse a subject [10] @ignore
EasyRdf_Parser_Turtle::parseTriples in vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php
Parse triples [6] @ignore

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php, line 409

Class

EasyRdf_Parser_Turtle
Class to parse Turtle with no external dependancies.

Code

protected function parseImplicitBlank() {
  $this
    ->verifyCharacterOrFail($this
    ->read(), "[");
  $bnode = $this
    ->createBNode();
  $c = $this
    ->read();
  if ($c != ']') {
    $this
      ->unread($c);

    // Remember current subject and predicate
    $oldSubject = $this->subject;
    $oldPredicate = $this->predicate;

    // generated bNode becomes subject
    $this->subject = $bnode;

    // Enter recursion with nested predicate-object list
    $this
      ->skipWSC();
    $this
      ->parsePredicateObjectList();
    $this
      ->skipWSC();

    // Read closing bracket
    $this
      ->verifyCharacterOrFail($this
      ->read(), "]");

    // Restore previous subject and predicate
    $this->subject = $oldSubject;
    $this->predicate = $oldPredicate;
  }
  return $bnode;
}