Parses a blank node ID, e.g: _:node1 @ignore
protected function parseNodeID() {
// Node ID should start with "_:"
$this
->verifyCharacter($this
->read(), "_");
$this
->verifyCharacter($this
->read(), ":");
// Read the node ID
$c = $this
->read();
if ($c == -1) {
throw new EasyRdf_Exception("Turtle Parse Error: unexpected end of file while reading node id");
}
elseif (!self::isNameStartChar($c)) {
throw new EasyRdf_Exception("Turtle Parse Error: expected a letter, found '{$c}'");
}
// Read all following letter and numbers, they are part of the name
$name = $c;
$c = $this
->read();
while (self::isNameChar($c)) {
$name .= $c;
$c = $this
->read();
}
$this
->unread($c);
return array(
'type' => 'bnode',
'value' => $this
->remapBnode($name),
);
}