magnusmanske / petscan_rs

The repo for the PetScan tool
https://petscan.wmflabs.org/
GNU General Public License v3.0
45 stars 10 forks source link

Plus sign in SPARQL field #132

Closed pere-prlpz closed 10 months ago

pere-prlpz commented 1 year ago

When the query in the SPARQL field (in other sources tab) includes a "+" sign, the query doesn't work and the sign gets deleted when the "Do it" button is clicked. The same query with \u002b as a substitute for the plus sign works fine.

An example of a query with "+" that doesn't work in PetScan despite of working fine in in WDQ as it is, or in PetScan with \u002b:

SELECT ?item WHERE { VALUES ?inst {wd:Q41176 wd:Q16917 wd:Q24354 wd:Q860861 wd:Q11707 wd:Q721747 wd:Q928830 wd:Q1107656 wd:Q3947 wd:Q12317349 wd:Q111594067 wd:Q27686 wd:Q16970 wd:Q35112127 wd:Q1273818 wd:Q41253 wd:Q111236457 wd:Q50359544 wd:Q200764 wd:Q1088552 wd:Q7075 wd:Q483453 wd:Q1007870}. ?item wdt:P31 ?inst. ?item wdt:P625 ?coord. wd:Q99509385 wdt:P625 ?focus1. wd:Q113663833 wdt:P625 ?focus2. BIND (geof:distance(?coord, ?focus1)+geof:distance(?coord, ?focus2) as ?d). FILTER(?d < 2.54). }

MB-one commented 1 year ago

It appears, that plus signs are generally ignored/replace with a white space, no matter which field it is in.

See https://petscan.wmflabs.org/?psid=26433833