Parses a URI / IRI @ignore
protected function parseURI() {
$uri = '';
// First character should be '<'
$this
->verifyCharacter($this
->read(), "<");
// Read up to the next '>' character
while (true) {
$c = $this
->read();
if ($c == '>') {
break;
}
elseif ($c == -1) {
throw new EasyRdf_Exception("Turtle Parse Error: unexpected end of file while reading URI");
}
$uri .= $c;
if ($c == '\\') {
// This escapes the next character, which might be a '>'
$c = $this
->read();
if ($c == -1) {
throw new EasyRdf_Exception("Turtle Parse Error: unexpected end of file while reading URI");
}
$uri .= $c;
}
}
// Unescape any escape sequences
$uri = $this
->unescapeString($uri);
return array(
'type' => 'uri',
'value' => $this
->resolve($uri),
);
}