apache / jena

Apache Jena
https://jena.apache.org/
Apache License 2.0
1.12k stars 652 forks source link

FOLD/UNFOLD aggregates highlighted as invalid in Fuseki UI #2843

Open Ostrzyciel opened 10 hours ago

Ostrzyciel commented 10 hours ago

Version

5.2.0

What happened?

A recent version of Jena added the support for SPARQL CDTs, which includes a new aggregate (FOLD) and an operator (UNFOLD). The two thingies work fine, but in the SPARQL editor in the Fuseki UI, they are highlighted in red as invalid syntax.

Example query:

SELECT ?s (FOLD(?p, ?o) AS ?map) WHERE {
  ?s ?p ?o
}
GROUP BY ?s

How it appears in the editor: image

Second example:

SELECT * WHERE {
  ?s ?p ?list .
  UNFOLD(?list as ?element)
}

image

Relevant output and stacktrace

No response

Are you interested in making a pull request?

None

Ostrzyciel commented 10 hours ago

I corrected the report – initially I mistakenly wrote that UNFOLD is an aggregate, while only FOLD is one. Nonetheless, the issue is the same.

afs commented 9 hours ago

The syntax highlighter is codemirror based via the maintained yasgui for.

https://github.com/codemirror/codemirror5/blob/master/mode/sparql/sparql.js

As FOLD, UNFOLD and ADJUST are Jena specific extensions, they need adding to the keywords.

Other Jena extensions:

More importantly, add the SPARQL Update keywords.