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

Top-level arithmetic expression returns result of first FLOWR expression #88

Closed
ingomueller-net opened this issue Oct 14, 2018 · 3 comments
Labels

Comments

@ingomueller-net
Copy link
Contributor

The following query (run against the language game dataset) produces the wrong result:

(for $o in json-file("wasb:///sample.json")
where $o.choices[[1]] = $o.target
return $o) div count(json-file("wasb:///sample.json")))

I am not sure what it should do (I forgot to call count on the result of the first FLOWR expression), but I think it should do what it does, namely return the result of the first FLOWR expression.

@ingomueller-net
Copy link
Contributor Author

Aha, I am looking at my traces again. One of the runs returned the following error:

[ERROR] Error [err: XPTY0004]LINE:1:COLUMN:0:Multiplicative expression has non numeric args { "date" : "2013-08-19", "country" : "AU", "guess" : "German", "choices" : [ German, Serbian, Swedish, Vietnamese ], "sample" : "e77d97b712adffc39e531e20237a5589", "target" : "German" }, 100

Is this what should happen? Maybe everything is working as it should then...

@ghislainfourny
Copy link
Member

You are attempting to divide a sequence of objects by an integer -- the error is thus correctly reported as a type error. Do you agree?

@ingomueller-net
Copy link
Contributor Author

Yes. I didn't read the message properly (and I was confused by a different message).

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

No branches or pull requests

2 participants