本文整理汇总了Java中com.tinkerpop.blueprints.VertexQuery.has方法的典型用法代码示例。如果您正苦于以下问题:Java VertexQuery.has方法的具体用法?Java VertexQuery.has怎么用?Java VertexQuery.has使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tinkerpop.blueprints.VertexQuery
的用法示例。
在下文中一共展示了VertexQuery.has方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testVertexQueryIDs
import com.tinkerpop.blueprints.VertexQuery; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testVertexQueryIDs() {
int num = 7;
Vertex a = graph.addVertex("Vertex_a");
Vertex b = graph.addVertex("Vertex_b");
for (int i = 0; i < num; ++i) {
Edge e = graph.addEdge("Edge_" + i, a, b, "label " + i);
e.setProperty("intValue", i);
}
VertexQuery q = a.query();
q.has("intValue", 3);
q.direction(Direction.OUT);
assertEquals(1, countResults((Iterator<String>) q.vertexIds()));
}
示例2: testVertexQueryHas
import com.tinkerpop.blueprints.VertexQuery; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testVertexQueryHas() {
int num = 7;
Vertex a = graph.addVertex("Vertex_a");
Vertex b = graph.addVertex("Vertex_b");
for (int i = 0; i < num; ++i) {
Edge e = graph.addEdge("Edge_" + i, a, b, "label " + i);
e.setProperty("intValue" + i, i);
}
VertexQuery q = a.query();
q.has("intValue1");
assertEquals(1, countResults((Iterator<String>) q.vertexIds()));
}
示例3: testVertexQueryIN
import com.tinkerpop.blueprints.VertexQuery; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testVertexQueryIN() {
int num = 7;
Vertex a = graph.addVertex("Vertex_a");
Vertex b = graph.addVertex("Vertex_b");
for (int i = 0; i < num; ++i) {
Edge e = graph.addEdge("Edge_" + i, a, b, "label " + i);
e.setProperty("intValue" + i, i);
}
VertexQuery q = a.query();
q.has("label", Contains.IN, Arrays.asList("label 0", "label 1", "unknown"));
int countResults = countResults((Iterator<String>) q.vertexIds());
assertEquals(2, countResults);
}
示例4: testVertexQueryByKey
import com.tinkerpop.blueprints.VertexQuery; //导入方法依赖的package包/类
@Test
public void testVertexQueryByKey() {
int num = 50;
Vertex a = graph.addVertex("Vertex_a");
Vertex b = graph.addVertex("Vertex_b");
for (int i = 0; i < num; ++i) {
Edge e = graph.addEdge("Edge_" + i, a, b, "label " + i);
e.setProperty("intValue", i);
}
VertexQuery q = a.query();
q.has("intValue", 33);
assertEquals(1, countResults(q.edges()));
q.direction(Direction.OUT);
assertEquals(1, countResults(q.edges()));
assertEquals(1, q.count());
q.direction(Direction.IN);
assertEquals(0, countResults(q.edges()));
assertEquals(0, q.count());
}