comparison app/query.service.ts @ 40:896ae7eefb33

fix relation type queries.
author casties
date Mon, 15 Feb 2016 11:10:08 +0100
parents 7578b21cdf2e
children 5353b2dffb0f
comparison
equal deleted inserted replaced
39:7578b21cdf2e 40:896ae7eefb33
149 */ 149 */
150 if (mode === 'relation_is') { 150 if (mode === 'relation_is') {
151 nIdx += 1; 151 nIdx += 1;
152 let rel = params.relationType; 152 let rel = params.relationType;
153 if (rel.isOutgoing()) { 153 if (rel.isOutgoing()) {
154 queryMatch += `-[:\`${rel.getName()}\`]->(n${nIdx})`; 154 queryMatch += `-[:\`${rel.getRelType()}\`]->(n${nIdx})`;
155 } else { 155 } else {
156 // inverse relation 156 // inverse relation
157 queryMatch += `<-[:\`${rel.getName()}\`]-(n${nIdx})`; 157 queryMatch += `<-[:\`${rel.getRelType()}\`]-(n${nIdx})`;
158 } 158 }
159 queryReturn = `RETURN DISTINCT n${nIdx}`; 159 queryReturn = `RETURN DISTINCT n${nIdx}`;
160 returnType = 'node'; 160 returnType = 'node';
161 } 161 }
162 162
220 /** 220 /**
221 * Create and run the cypher queries for the current query state. 221 * Create and run the cypher queries for the current query state.
222 * 222 *
223 * Updates the results and nextQuery attributes and relations. 223 * Updates the results and nextQuery attributes and relations.
224 */ 224 */
225 updateQuery() { 225 runQuery() {
226 this.createCypherQuery(); 226 this.createCypherQuery();
227 this.state.resultInfo = 'loading...'; 227 this.state.resultInfo = 'loading...';
228 /* 228 /*
229 * run query for result table 229 * run query for result table
230 */ 230 */