Skip to content

Commit

Permalink
Update SPARQLHTML serializer to return HTML links for IRIs kasei#54
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoran Varadinsky committed Jan 29, 2016
1 parent 4263638 commit a61a82a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/AtteanX/Serializer/SPARQLHTML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,22 @@ Serializes the L<Attean::API::Term> object as HTML.
s/</&lt;/g;
}
my $html = $uri;

if (my $map = $self->namespaces) {
my $abr = $map->abbreviate($html);

if ($abr) {
return qq[<a href="${html}">$abr</a>];
} else {
return $html;
}

} else {

return $html;
}


# if ($link) {
# $html = qq[<a href="${uri}">$html</a>];
# }
Expand All @@ -162,6 +178,7 @@ Serializes the L<Attean::API::Term> object as HTML.
}
}
with 'Attean::API::ResultSerializer';
with 'Attean::API::AbbreviatingSerializer';
}

1;
Expand Down

0 comments on commit a61a82a

Please sign in to comment.