protected function EasyRdf_Parser_Turtle::parseSubject

Parse a subject [10] @ignore

1 call to EasyRdf_Parser_Turtle::parseSubject()
EasyRdf_Parser_Turtle::parseTriples in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php
Parse triples [6] @ignore

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php, line 265

Class

EasyRdf_Parser_Turtle
Class to parse Turtle with no external dependancies.

Code

protected function parseSubject() {
  $c = $this
    ->peek();
  if ($c == '(') {
    $this->subject = $this
      ->parseCollection();
  }
  elseif ($c == '[') {
    $this->subject = $this
      ->parseImplicitBlank();
  }
  else {
    $value = $this
      ->parseValue();
    if ($value['type'] == 'uri' or $value['type'] == 'bnode') {
      $this->subject = $value;
    }
    else {
      throw new EasyRdf_Exception("Turtle Parse Error: illegal subject type: " . $value['type']);
    }
  }
}