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

undef is recognized, UNDEF is not #43

Open
VladimirAlexiev opened this issue Jan 12, 2024 · 0 comments
Open

undef is recognized, UNDEF is not #43

VladimirAlexiev opened this issue Jan 12, 2024 · 0 comments

Comments

@VladimirAlexiev
Copy link
Contributor

VladimirAlexiev commented Jan 12, 2024

This script is parsed ok:

declare function local:rdf_property ($property, $id as xs:string) {
  let $propName := $property/name()
  let $value    := $property/text()
  for $prop $dt where {
    values ($propName1                    $prop                                $dt           ) {
      ("GF_Ausn"                          "xp:floorAreaExcluded"               "xsd:decimal" )
      ("nutzungsform"                     "xp:formOfUse"                       undef         )
    }
    filter ($propName1 = $propName)
  }
  construct {<{$id}> <{$prop}> {$value}} # ^^{$dt} 
};

()

But if I replace undef with UNDEF, I get this error:

line 4:12 no viable alternative at input '$dt'
line 5:4 mismatched input 'values' expecting RCURLY
  • The problem is that SPARQL is case-insensitive so UNDEF should also be accepted
  • Another problem is that the error message is totally unhelpful: the location is two levels up, and then some nodes away. I spent 2h debugging this (thinking that maybe it doesn't allow a second var in for. The xsparql parser is terrible that way :-(
@VladimirAlexiev VladimirAlexiev changed the title UNDEF is not recognized while undef is undef is recognized, UNDEF is not Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant