sparql-transformer icon indicating copy to clipboard operation
sparql-transformer copied to clipboard

fix: correct naming of aggregated results when using variables

Open ehrhart opened this issue 1 year ago • 0 comments

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

ehrhart avatar Aug 27 '24 19:08 ehrhart