w3c / sparql-query

https://w3c.github.io/sparql-query/
Other
7 stars 0 forks source link

Possible missing "toList" in algebra example #136

Open afs opened 7 months ago

afs commented 7 months ago

Issue mentioned on StackOverflow

https://stackoverflow.com/questions/77978291/sparql-1-1-algebra-converting-multiset-to-sequence

afs commented 7 months ago

Related:

https://stackoverflow.com/questions/78011616/sparql-1-1-algebra-nesting-aggregation-in-selection

hartig commented 7 months ago

I agree with the proposed change in the first Stack Overflow question. That is, the input to the Project operator in this example must be wrapped in a ToList operator.

By the way, the example that this question talks about feels a bit out of place in Section 18.2.3 because, in contrast to all the other examples in this section, the example in question requires translation steps that are defined later, in Sections 18.2.4 and 18.2.5.

hartig commented 7 months ago

Regarding the second Stack Overflow question mentioned above, the observation in that question is right (yes, ToList must be applied) but there is actually no bug in the spec. Instead, adding the ToList operator is a step that is required before translating the solution modifiers, as defined in Section 18.2.5.

Having said that, I think that the fact that adding the ToList operator is a required step is not so clear in the spec.

I will create a PR that fixes both issue.

hartig commented 6 months ago

@afs I think this issue can be closed now. Also, feel free to leave a comment about it in the two Stack Overflow questions (I don't have an account there).