protected function processUri($node, &$context, $value, $isProp = false) {
if (preg_match("/^\\[(.*)\\]\$/", $value, $matches)) {
// Safe CURIE
return $this
->expandCurie($node, $context, $matches[1]);
}
elseif (preg_match(self::TERM_REGEXP, $value) and $isProp) {
$term = strtolower($value);
if ($context['vocab']) {
return $context['vocab'] . $value;
}
elseif (isset($context['terms'][$term])) {
return $context['terms'][$term];
}
}
elseif (substr($value, 0, 2) === '_:' and $isProp) {
return null;
}
else {
$uri = $this
->expandCurie($node, $context, $value);
if ($uri) {
return $uri;
}
else {
$parsed = new EasyRdf_ParsedUri($value);
if ($parsed
->isAbsolute()) {
return $value;
}
elseif ($isProp) {
// Properties can't be relative URIs
return null;
}
elseif ($this->baseUri) {
return $this->baseUri
->resolve($parsed);
}
}
}
}