sparql-transformer
sparql-transformer copied to clipboard
fix: correct naming of aggregated results when using variables
Using aggregates with a variable (e.g., { v: "?v$sum" }) would "incorrectly" generate SPARQL queries like: (SUM(?v) AS ?v). While technically accepted/ignored by Virtuoso, it causes errors with stricter engines like GraphDB.
The naming convention is now adjusted to generate unique variable names, such as (SUM(?v) AS ?v_sum).
It was already the case when using expressions such as $schema:value$sum, but it didn't apply to variables.
This commit fixes that behavior.
✔ DBpedia list of cities (proto) ✔ DBpedia list of cities and regions (jsonld) ✔ DBpedia grunge bands ✔ DBpedia genres with bands ✔ Aggregates ✔ No lang tag ✔ Duplicate variable name ✔ List-required fieds ✔ Library limit (103ms) ─
9 tests passed