Skip to content

undef is recognized, UNDEF is not #43

Description

@VladimirAlexiev

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 :-(

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions