Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SPARQL Parse Error: unexpected terminal

I've been using gruff to create and execute some simple SPARQL queries, but have run into some trouble. The following query works (prefixes have been left out):

SELECT ?k
WHERE
{ ?k  rdf:type  uw:pcservice . }

However, when I introduce the COUNT function, as seen below, I get the following error in gruff:

Error: Parse error: unexpected terminal ( (value: :|(|). Expected terminals: (* varname reduced distinct). [condition type: sparql-parse-error-unexpected-terminal]

SELECT (COUNT(?k) AS ?count)
WHERE
{ ?k  rdf:type  uw:pcservice . }

Not sure what is causing this. Any clues would be appreciated. Thanks.

like image 853
user2035965 Avatar asked Jan 17 '26 17:01

user2035965


1 Answers

Given the error it sounds like this tool doesn't support SPARQL 1.1. It's expecting a vanilla SELECT [*|varname|reduced|distinct], excluding aggregates and assignment.

like image 70
user205512 Avatar answered Jan 20 '26 11:01

user205512



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!