|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +var fs = require('fs'); |
| 4 | + |
| 5 | +var moduleFiles = [ |
| 6 | + { |
| 7 | + uri:'/optic/view/test/masterDetail.tdex', |
| 8 | + collections:['http://marklogic.com/xdmp/tde'], |
| 9 | + contentType:'application/vnd.marklogic-tde+xml', |
| 10 | + content:fs.createReadStream('./config-optic/qa-data/masterDetail.tdex') |
| 11 | + }, |
| 12 | + { |
| 13 | + uri:'/optic/view/test/masterDetail2.tdej', |
| 14 | + collections:['http://marklogic.com/xdmp/tde'], |
| 15 | + contentType:'application/vnd.marklogic-tde+json', |
| 16 | + content:fs.createReadStream('./config-optic/qa-data/masterDetail2.tdej') |
| 17 | + }, |
| 18 | + { |
| 19 | + uri:'/optic/view/test/masterDetail3.tdej', |
| 20 | + collections:['http://marklogic.com/xdmp/tde'], |
| 21 | + contentType:'application/vnd.marklogic-tde+json', |
| 22 | + content:fs.createReadStream('./config-optic/qa-data/masterDetail3.tdej') |
| 23 | + }, |
| 24 | + { |
| 25 | + uri:'/optic/view/test/masterDetail4.tdej', |
| 26 | + collections:['http://marklogic.com/xdmp/tde'], |
| 27 | + contentType:'application/vnd.marklogic-tde+json', |
| 28 | + content:fs.createReadStream('./config-optic/qa-data/masterDetail4.tdej') |
| 29 | + }, |
| 30 | + { |
| 31 | + uri:'/optic/test/mapperReducer.sjs', |
| 32 | + contentType:'application/vnd.marklogic-javascript', |
| 33 | + content:fs.createReadStream('./config-optic/qa-data/mapperReducer.sjs') |
| 34 | + } |
| 35 | +]; |
| 36 | + |
| 37 | +var dataFiles = [ |
| 38 | + { |
| 39 | + uri:'/optic/view/test/masterDetail.xml', |
| 40 | + collections:['/optic/view/test'], |
| 41 | + content:fs.createReadStream('./config-optic/qa-data/masterDetail.xml') |
| 42 | + },{ |
| 43 | + uri:'/optic/view/test/masterDetail2.json', |
| 44 | + collections:['/optic/view/test'], |
| 45 | + content:fs.createReadStream('./config-optic/qa-data/masterDetail2.json') |
| 46 | + },{ |
| 47 | + uri:'/optic/view/test/masterDetail3.json', |
| 48 | + collections:['/optic/view/test'], |
| 49 | + content:fs.createReadStream('./config-optic/qa-data/masterDetail3.json') |
| 50 | + },{ |
| 51 | + uri:'/optic/view/test/masterDetail4.json', |
| 52 | + collections:['/optic/view/test'], |
| 53 | + content:fs.createReadStream('./config-optic/qa-data/masterDetail4.json') |
| 54 | + },{ |
| 55 | + uri:'/optic/view/test/masterDetail5.json', |
| 56 | + collections:['/optic/view/test'], |
| 57 | + content:fs.createReadStream('./config-optic/qa-data/masterDetail5.json') |
| 58 | + },{ |
| 59 | + uri:'/optic/triple/test/playerTripleSet.xml', |
| 60 | + collections:['/optic/player/triple/test'], |
| 61 | + content:fs.createReadStream('./config-optic/qa-data/playerTripleSet.xml') |
| 62 | + },{ |
| 63 | + uri:'/optic/triple/test/teamTripleSet.xml', |
| 64 | + collections:['/optic/team/triple/test'], |
| 65 | + content:fs.createReadStream('./config-optic/qa-data/teamTripleSet.xml') |
| 66 | + },{ |
| 67 | + uri:'/optic/triple/test/duplicatePlayerTripleSet.xml', |
| 68 | + collections:['/optic/player/triple/test'], |
| 69 | + content:fs.createReadStream('./config-optic/qa-data/playerTripleSet.xml') |
| 70 | + },{ |
| 71 | + uri:'/optic/triple/test/duplicateTeamTripleSet.xml', |
| 72 | + collections:['/optic/team/triple/test'], |
| 73 | + content:fs.createReadStream('./config-optic/qa-data/teamTripleSet.xml') |
| 74 | + },{ |
| 75 | + uri:'/optic/triple/test/otherPlayerTripleSet.xml', |
| 76 | + collections:['/optic/other/player/triple/test'], |
| 77 | + content:fs.createReadStream('./config-optic/qa-data/otherPlayerTripleSet.xml') |
| 78 | + },{ |
| 79 | + uri:'/optic/lexicon/test/doc1.json', |
| 80 | + collections:['/optic/lexicon/test', '/other/coll1', '/other/coll2'], |
| 81 | + content:fs.createReadStream('./config-optic/qa-data/doc1.json') |
| 82 | + },{ |
| 83 | + uri:'/optic/lexicon/test/doc2.json', |
| 84 | + collections:['/optic/lexicon/test'], |
| 85 | + content:fs.createReadStream('./config-optic/qa-data/doc2.json') |
| 86 | + },{ |
| 87 | + uri:'/optic/lexicon/test/doc3.json', |
| 88 | + collections:['/optic/lexicon/test'], |
| 89 | + content:fs.createReadStream('./config-optic/qa-data/doc3.json') |
| 90 | + },{ |
| 91 | + uri:'/optic/lexicon/test/doc4.xml', |
| 92 | + collections:['/optic/lexicon/test'], |
| 93 | + content:fs.createReadStream('./config-optic/qa-data/doc4.xml') |
| 94 | + },{ |
| 95 | + uri:'/optic/lexicon/test/doc5.xml', |
| 96 | + collections:['/optic/lexicon/test'], |
| 97 | + content:fs.createReadStream('./config-optic/qa-data/doc5.xml') |
| 98 | + },{ |
| 99 | + uri:'/optic/lexicon/test/city1.json', |
| 100 | + collections:['/optic/lexicon/test'], |
| 101 | + content:fs.createReadStream('./config-optic/qa-data/city1.json') |
| 102 | + },{ |
| 103 | + uri:'/optic/lexicon/test/city2.json', |
| 104 | + collections:['/optic/lexicon/test'], |
| 105 | + content:fs.createReadStream('./config-optic/qa-data/city2.json') |
| 106 | + },{ |
| 107 | + uri:'/optic/lexicon/test/city3.json', |
| 108 | + collections:['/optic/lexicon/test'], |
| 109 | + content:fs.createReadStream('./config-optic/qa-data/city3.json') |
| 110 | + },{ |
| 111 | + uri:'/optic/lexicon/test/city4.json', |
| 112 | + collections:['/optic/lexicon/test'], |
| 113 | + content:fs.createReadStream('./config-optic/qa-data/city4.json') |
| 114 | + },{ |
| 115 | + uri:'/optic/lexicon/test/city5.json', |
| 116 | + collections:['/optic/lexicon/test'], |
| 117 | + content:fs.createReadStream('./config-optic/qa-data/city5.json') |
| 118 | + },{ |
| 119 | + uri:'/optic/plan/test/planViews.json', |
| 120 | + collections:['/optic/plan/test'], |
| 121 | + content:fs.createReadStream('./config-optic/qa-data/planViews.json') |
| 122 | + },{ |
| 123 | + uri:'/optic/plan/test/planLexicons.json', |
| 124 | + collections:['/optic/plan/test'], |
| 125 | + content:fs.createReadStream('./config-optic/qa-data/planLexicons.json') |
| 126 | + },{ |
| 127 | + uri:'/optic/plan/test/planTriples.json', |
| 128 | + collections:['/optic/plan/test'], |
| 129 | + content:fs.createReadStream('./config-optic/qa-data/planTriples.json') |
| 130 | + }]; |
| 131 | + |
| 132 | +var graphFiles1 = [ |
| 133 | + { |
| 134 | + uri: '/optic/sparql/test/people.ttl', |
| 135 | + contentType: 'text/turtle', |
| 136 | + data: fs.createReadStream('./config-optic/qa-data/people.ttl') |
| 137 | + } |
| 138 | +]; |
| 139 | + |
| 140 | +var graphFiles2 = [ |
| 141 | + { |
| 142 | + uri: '/optic/sparql/test/companies.ttl', |
| 143 | + contentType: 'text/turtle', |
| 144 | + data: fs.createReadStream('./config-optic/qa-data/companies_100.ttl') |
| 145 | + } |
| 146 | +]; |
| 147 | + |
| 148 | +function writeDocuments(db) { |
| 149 | + return db.documents.write(dataFiles); |
| 150 | +} |
| 151 | + |
| 152 | +function writeDocumentsToMod(db) { |
| 153 | + return db.documents.write(moduleFiles); |
| 154 | +} |
| 155 | + |
| 156 | +function writeGraphs1(db) { |
| 157 | + return db.graphs.write(graphFiles1); |
| 158 | +} |
| 159 | + |
| 160 | +function writeGraphs2(db) { |
| 161 | + return db.graphs.write(graphFiles2); |
| 162 | +} |
| 163 | + |
| 164 | +module.exports = { |
| 165 | + writeDocuments: writeDocuments, |
| 166 | + writeDocumentsToMod: writeDocumentsToMod, |
| 167 | + writeGraphs1: writeGraphs1, |
| 168 | + writeGraphs2: writeGraphs2 |
| 169 | +}; |
0 commit comments