~juan457/+junk/zorba

« back to all changes in this revision

Viewing changes to test/rbkt/Queries/zorba/jsoniq/collection-and-index/foaf_module-no-index.xqlib

  • Committer: Markos Zaharioudakis
  • Date: 2012-07-11 15:38:39 UTC
  • mfrom: (10924 zorba)
  • mto: This revision was merged to the branch mainline in revision 10932.
  • Revision ID: markos_za@yahoo.com-20120711153839-0mkh15cg2ubknchd
work in progress

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
module namespace foaf = "http://www.w3.org/TestModules/foaf";
 
3
 
 
4
import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl";
 
5
import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";
 
6
import module namespace index_ddl = "http://www.zorba-xquery.com/modules/store/static/indexes/ddl";
 
7
import module namespace index_dml = "http://www.zorba-xquery.com/modules/store/static/indexes/dml";
 
8
 
 
9
declare namespace ann = "http://www.zorba-xquery.com/annotations";
 
10
 
 
11
declare variable $foaf:network:= xs:QName("foaf:network");
 
12
 
 
13
declare collection foaf:network as object()*;
 
14
 
 
15
 
 
16
(:
 
17
  Create and populate the collection, and then create the indexes
 
18
:)
 
19
 
 
20
declare %ann:sequential function foaf:create-db()
 
21
{
 
22
  ddl:create($foaf:network);
 
23
 
 
24
  dml:insert($foaf:network, (
 
25
    {
 
26
      "name" : "James T. Kirk",
 
27
      "age" : 30,
 
28
      "gender" : "male",
 
29
      "friends" : [ "Mister Spock", "Scotty", "Jean-Luc Picard"]
 
30
    },
 
31
    
 
32
    {
 
33
      "name" : "Jean-Luc Picard",
 
34
      "age" : 40,
 
35
      "gender" : "male",
 
36
      "friends" : [ "James T. Kirk", "Lieutenant Commander Data", "Beverly Crusher" ]
 
37
    },
 
38
    
 
39
    {
 
40
      "name" : "Beverly Crusher",
 
41
      "age" : 38,
 
42
      "gender" : "female",
 
43
      "friends" : [ "Jean-Luc Picard", "Ensign Crusher" ]
 
44
    },
 
45
    
 
46
    {
 
47
      "name" : "Lieutenant Commander Data",
 
48
      "age" : 100,
 
49
      "gender" : "positronic matrix",
 
50
      "friends" : [ "Geordi La Forge" ]
 
51
    }
 
52
  ));
 
53
 
 
54
};