~davidagraf/zorba/trace_without_debug_info

« back to all changes in this revision

Viewing changes to test/rbkt/Queries/zorba/jsoniq/use_case04.xq

  • Committer: David Graf
  • Date: 2012-06-27 07:20:59 UTC
  • mfrom: (10869.1.25 zorba)
  • Revision ID: davidagraf@gmail.com-20120627072059-723duu6vsbqu60ax
merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import module namespace j = "http://www.jsoniq.org/functions";
 
2
 
 
3
let $satsDoc :=
 
4
  {
 
5
    "creator" : "Satellites plugin version 0.6.4",
 
6
    "satellites" : {
 
7
      "AAU CUBESAT" : {
 
8
        "tle1" : "1 27846U 03031G 10322.04074654  .00000056  00000-0  45693-4 0  8768",
 
9
        "visible" : fn:false()
 
10
      },
 
11
      "AJISAI (EGS)" : {
 
12
        "tle1" : "1 16908U 86061A 10321.84797408 -.00000083  00000-0  10000-3 0  3696",
 
13
        "visible" : fn:true()
 
14
      },
 
15
      "AKARI (ASTRO-F)" : {
 
16
        "tle1" : "1 28939U 06005A 10321.96319841  .00000176  00000-0  48808-4 0  4294",
 
17
        "visible" : fn:true()
 
18
      }
 
19
    }
 
20
  }
 
21
return 
 
22
{
 
23
  "visible" : [
 
24
     let $sats := $satsDoc("satellites")
 
25
     for $satName in j:keys($sats)
 
26
     let $satData := $sats($satName)
 
27
     where $satData("visible")
 
28
     return $satName
 
29
  ]
 
30
  ,
 
31
  "invisible" : [
 
32
     let $sats := $satsDoc("satellites")
 
33
     for $satName in j:keys($sats)
 
34
     let $satData := $sats($satName)
 
35
     where fn:not($satData("visible"))
 
36
     return $satName
 
37
  ]
 
38
}