From d39370c4f8bce3f7fb3c53ea068350fb2d98deb3 Mon Sep 17 00:00:00 2001 From: Hannah Bast Date: Wed, 25 Sep 2024 16:37:56 +0200 Subject: [PATCH] Also make suggestions for `geo:hasCentroid/geo:asWKT` When `geo:hasGeometry` is among the predicate suggestions, the QLever UI also suggests `geo:hasGeometry/geo:asWKT`. This feature is now extended to `geo:hasCentroid`. This new predicate has been introduced by https://github.com/ad-freiburg/osm2rdf/commit/d39d297fd6737bf2d717fd49d2d2f423b455f7b2 --- backend/static/js/codemirror/modes/sparql/sparql-hint.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/static/js/codemirror/modes/sparql/sparql-hint.js b/backend/static/js/codemirror/modes/sparql/sparql-hint.js index f456afdb..aca187bd 100755 --- a/backend/static/js/codemirror/modes/sparql/sparql-hint.js +++ b/backend/static/js/codemirror/modes/sparql/sparql-hint.js @@ -939,10 +939,11 @@ function getQleverSuggestions( altname: altEntityName, isMixedModeSuggestion: !takeMainQueryResult }); - } else if (displayText == "geo:hasGeometry ") { + } else if (displayText == "geo:hasGeometry " || displayText == "geo:hasCentroid ") { + displayTextWithoutSpaces = displayText.replace(/ /g, ""); dynamicSuggestions.push({ - displayText: "geo:hasGeometry/geo:asWKT ", - completion: "geo:hasGeometry/geo:asWKT ", + displayText: displayTextWithoutSpaces + "/geo:asWKT ", + completion: displayTextWithoutSpaces + "/geo:asWKT ", name: "geometry as WKT", altname: altEntityName, isMixedModeSuggestion: !takeMainQueryResult