protected function expandCurie($node, &$context, $value) {
if (preg_match("/^(\\w*?):(.*)\$/", $value, $matches)) {
list(, $prefix, $local) = $matches;
$prefix = strtolower($prefix);
if ($prefix === '_') {
// It is a bnode
return $this
->remapBnode(substr($value, 2));
}
elseif (empty($prefix) and $context['vocab']) {
// Empty prefix
return $context['vocab'] . $local;
}
elseif (isset($context['prefixes'][$prefix])) {
return $context['prefixes'][$prefix] . $local;
}
elseif ($uri = $node
->lookupNamespaceURI($prefix)) {
return $uri . $local;
}
elseif (!empty($prefix) and $uri = EasyRdf_Namespace::get($prefix)) {
// Expand using well-known prefixes
return $uri . $local;
}
}
}