Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return type inference and return value bound handling #1264

Open
jitsedesmet opened this issue Sep 13, 2023 · 0 comments
Open

Return type inference and return value bound handling #1264

jitsedesmet opened this issue Sep 13, 2023 · 0 comments

Comments

@jitsedesmet
Copy link
Member

Currently, the expression evaluator does not always return the type expected by the specs. For example right now the addition of two shorts will return an integer, it should however be a short to be compliant with the sparql spec, pointing to xpath spec.

If the two operands of an arithmetic expression are not of the same type, subtype substitution and numeric type promotion are used to obtain two operands of the same type.

While implementing this, we should also consider what should happen when the return value is out of bounds for the type. For example, what is the return value when a short is returned, but the value is too large to fit in a shot? Overflow? Cap? Widen the return type?

This is originally mentioned in an issue of the sparqlee repo: comunica/sparqlee#45.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants