Parse a predicate [11] @ignore
protected function parsePredicate() {
// Check if the short-cut 'a' is used
$c1 = $this
->read();
if ($c1 == 'a') {
$c2 = $this
->read();
if (self::isWhitespace($c2)) {
// Short-cut is used, return the rdf:type URI
return array(
'type' => 'uri',
'value' => EasyRdf_Namespace::get('rdf') . 'type',
);
}
// Short-cut is not used, unread all characters
$this
->unread($c2);
}
$this
->unread($c1);
// Predicate is a normal resource
$predicate = $this
->parseValue();
if ($predicate['type'] == 'uri') {
return $predicate;
}
else {
throw new EasyRdf_Exception("Turtle Parse Error: Illegal predicate value: " . $predicate);
}
}