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

rewriter gets confused by element name "group" #8

Open
VladimirAlexiev opened this issue Dec 5, 2016 · 0 comments
Open

rewriter gets confused by element name "group" #8

VladimirAlexiev opened this issue Dec 5, 2016 · 0 comments
Labels

Comments

@VladimirAlexiev
Copy link
Contributor

VladimirAlexiev commented Dec 5, 2016

this function

declare function local:rdf_groups ($url as xs:string, $study) {
  for $i in $study/clinical_results/baseline/group_list/group ###
  let $gr := fn:concat($url, "/group/", $i/@group_id/substring(.,2))
    # first char of @group_id is B=baseline, O=outcome, P=period, etc.
    # But the description is the same, so we identify them by the remaining numeric index
    construct {
      <{$url}> cto:group <{$gr}>.
      $gr a cto:Group;
        dc:title {$i/title/text()};
        dc:description {$i/description/text()}.      
    }
};

causes this error at the second line marked ###:

line 417:9 no viable alternative at input 'in'
line 417:56 no viable alternative at input 'group'
Parse error: java.lang.Exception: Errors for Parser. Translation aborted.
java.lang.Exception: Errors for Parser. Translation aborted.
        at net.sf.xsparql.rewriter.XSPARQLProcessor.process(XSPARQLProcessor.java:232)
        at net.sf.xsparql.Main.rewriteQuery(Main.java:197)
        at net.sf.xsparql.Main.main(Main.java:111)

Workaround: change it to this ugly longhand:

  for $i in $study/clinical_results/baseline/group_list/*[name()="group"]
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