Skip to content

Commit 2fd8547

Browse files
author
Mark
committed
Replace graph_edge function with aql (clean up)
1 parent c64d347 commit 2fd8547

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

src/main/java/com/arangodb/util/GraphQueryUtil.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,6 @@ public static String createVerticesQuery(
176176
final GraphVerticesOptions graphVerticesOptions,
177177
final MapBuilder bindVars) throws ArangoException {
178178

179-
// final String query = "for i in graph_vertices(@graphName ,
180-
// @vertexExample, @options) return i";
181-
// final Map<String, Object> bindVars = new MapBuilder().put(GRAPH_NAME,
182-
// graphName)
183-
// .put(VERTEX_EXAMPLE, JsonUtils.convertNullToMap(vertexExample))
184-
// .put("options",
185-
// JsonUtils.convertNullToMap(graphVerticesOptions)).get();
186-
187179
StringBuilder sb = new StringBuilder();
188180
final boolean stringVertexExample = vertexExample != null
189181
&& String.class.isAssignableFrom(vertexExample.getClass());

src/test/java/com/arangodb/example/graph/GraphAqlQueryExample.java

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,14 @@
1616

1717
package com.arangodb.example.graph;
1818

19-
import java.util.HashMap;
2019
import java.util.Iterator;
21-
import java.util.List;
22-
import java.util.Map;
2320

2421
import org.junit.After;
2522
import org.junit.Assert;
2623
import org.junit.Before;
2724
import org.junit.Test;
2825

2926
import com.arangodb.ArangoException;
30-
import com.arangodb.CursorResult;
3127
import com.arangodb.Direction;
3228
import com.arangodb.EdgeCursor;
3329
import com.arangodb.VertexCursor;
@@ -177,40 +173,6 @@ public void graphAqlQuery() throws ArangoException {
177173
// no path found (distance = -1)
178174
Assert.assertEquals(new Long(-1), shortestPath.getDistance());
179175

180-
//
181-
printHeadline("get all vertex document handles by AQL query");
182-
//
183-
184-
String query = "for i in graph_vertices(@graphName , null, null) return i._id";
185-
Map<String, Object> bindVars = new HashMap<String, Object>();
186-
bindVars.put("graphName", GRAPH_NAME);
187-
188-
final CursorResult<String> cursor = driver.executeAqlQuery(query, bindVars, null, String.class);
189-
Assert.assertNotNull(cursor);
190-
final List<String> list = cursor.asList();
191-
count = 0;
192-
for (final String str : list) {
193-
System.out.printf("%d\t%20s%n", ++count, str);
194-
}
195-
Assert.assertEquals(6, list.size());
196-
197-
//
198-
printHeadline("get vertex documents by AQL query and filter");
199-
//
200-
201-
query = "for i in graph_vertices(@graphName , null, null) filter i.name != @name return i";
202-
bindVars = new HashMap<String, Object>();
203-
bindVars.put("graphName", GRAPH_NAME);
204-
bindVars.put("name", "Boris");
205-
206-
final CursorResult<Person> cursor2 = driver.executeAqlQuery(query, bindVars, null, Person.class);
207-
Assert.assertNotNull(cursor2);
208-
final List<Person> list2 = cursor2.asList();
209-
count = 0;
210-
for (final Person person : list2) {
211-
System.out.printf("%d\t%20s\t%s%n", ++count, person.getDocumentHandle(), person.getName());
212-
}
213-
Assert.assertEquals(5, list2.size());
214176
}
215177

216178
private void printShortestPath(final ShortestPathEntity<Person, Knows> shortestPath) {

0 commit comments

Comments
 (0)