Skip to content

Commit

Permalink
Fix links for _sparql and _mapview variable hack
Browse files Browse the repository at this point in the history
When a variable name ends with `_sparql` or `_mapview` and the value
is a link, then a special link is shown which leads to an instance of
the QLever UI with a SPARQL query or to an instance of Petrimaps,
respectively.

This was broken because the link was enclosed in quotes. These are now
removed when they are there.

In collaboration with @Qup42
  • Loading branch information
Hannah Bast committed Sep 23, 2024
1 parent 177ef3a commit 9f39f84
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions backend/static/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,7 @@ function getFormattedResultEntry(str, maxLength, column = undefined) {
// as a SPARQL query, and show it in the QLever UI or on a map, respectively.
if (var_name.endsWith("_sparql") || var_name.endsWith("_mapview")) {
isLink = true;
str = str.replace(/^"/, "").replace(/"$/, "");
if (var_name.endsWith("_sparql")) {
mapview_url = `https://qlever.cs.uni-freiburg.de/${SLUG}/` +
`?query=${encodeURIComponent(str)}`;
Expand Down

0 comments on commit 9f39f84

Please sign in to comment.