当前位置: 首页>>代码示例>>Java>>正文


Java VertexQuery类代码示例

本文整理汇总了Java中com.tinkerpop.blueprints.VertexQuery的典型用法代码示例。如果您正苦于以下问题:Java VertexQuery类的具体用法?Java VertexQuery怎么用?Java VertexQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VertexQuery类属于com.tinkerpop.blueprints包,在下文中一共展示了VertexQuery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: query

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
@Override
public VertexQuery query()
{
	return new WrapperVertexQuery(getBaseVertex().query())
	{
		@Override
		public Iterable<Edge> edges()
		{
			return new BjoernEdgeIterable(query.edges());
		}

		@Override
		public Iterable<Vertex> vertices()
		{
			return new BjoernVertexIterable(query.vertices());
		}
	};
}
 
开发者ID:octopus-platform,项目名称:bjoern,代码行数:19,代码来源:BjoernNode.java

示例2: getRelations

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
@Override
   public Iterable<Edge> getRelations(Vertex source,
    RelationTypeMetadata<TitanEdgeMetadata> metadata,
    RelationTypeMetadata.Direction direction) {
VertexQuery query = source.query();
String discriminator = metadata.getDatastoreMetadata()
	.getDiscriminator();
switch (direction) {
case TO:
    query = query.direction(Direction.IN).labels(discriminator);
    break;
case FROM:
    query = query.direction(Direction.OUT).labels(discriminator);
    break;
default:
    throw new XOException("Unknown direction '" + direction.name()
	    + "'.");
}
return query.edges();
   }
 
开发者ID:PureSolTechnologies,项目名称:extended-objects-titan,代码行数:21,代码来源:TitanStoreEdgeManager.java

示例3: has

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
@Override
public VertexQuery has(String key, Predicate predicate, Object value) {
    if (predicate.toString().equals("EQUAL"))
        return has(key, value);
    else if (predicate.toString().equals("NOT_EQUAL"))
        return hasNot(key, value);
    else if (predicate.toString().equals("GREATER_THAN"))
        queryBuilder = queryBuilder.greaterThan(key, value);
    else if (predicate.toString().equals("LESS_THAN"))
        queryBuilder = queryBuilder.lessThan(key, value);
    else if (predicate.toString().equals("GREATER_THAN_EQUAL"))
        queryBuilder = queryBuilder.greaterThanEq(key, value);
    else if (predicate.toString().equals("LESS_THAN_EQUAL"))
        queryBuilder = queryBuilder.lessThanEq(key, value);
    else if (predicate.toString().equals("IN"))
        queryBuilder = queryBuilder.in(key, (Collection<Object>)value);
    else if (predicate.toString().equals("NOT_IN"))
        queryBuilder = queryBuilder.notIn(key, (Collection<Object>)value);
    else
        throw new UnsupportedOperationException("Predicate with type " + predicate + " is not supported.");

    return this;
}
 
开发者ID:calrissian,项目名称:accumulo-recipes,代码行数:24,代码来源:EntityVertexQuery.java

示例4: testVertexQueryByLabel

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
@Test
public void testVertexQueryByLabel() {
	int num = 200;

	Vertex a = graph.addVertex("Vertex_a");
	Vertex b = graph.addVertex("Vertex_b");

	for (int i = 0; i < num; ++i) {
		graph.addEdge("Edge_" + i, a, b, "label " + i);
	}

	VertexQuery q = a.query();
	q.labels("label 10", "label 100", "label 199");

	assertEquals(3, countResults(q.edges()));

}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:18,代码来源:ArangoQueryTest.java

示例5: testVertexQueryByInterval

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
@Test
public void testVertexQueryByInterval() {
	int num = 30;

	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.interval("intValue", 10, 12);

	assertEquals(2, countResults(q.edges()));
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:18,代码来源:ArangoQueryTest.java

示例6: 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()));

}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:21,代码来源:ArangoQueryTest.java

示例7: 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()));
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:19,代码来源:ArangoQueryTest.java

示例8: 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);
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:20,代码来源:ArangoQueryTest.java

示例9: query

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
public VertexQuery query() {
    return new WrapperVertexQuery(((Vertex) this.baseElement).query()) {
        @Override
        public Iterable<Vertex> vertices() {
            return new EventVertexIterable(this.query.vertices(), eventGraph);
        }

        @Override
        public Iterable<Edge> edges() {
            return new com.tinkerpop.blueprints.util.wrappers.event2.EventEdgeIterable(this.query.edges(), eventGraph);
        }
    };
}
 
开发者ID:dsiegel,项目名称:BlueprintsExperiment,代码行数:14,代码来源:EventVertex.java

示例10: query

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
@Override
public VertexQuery query() {
    return new WrapperVertexQuery(((Vertex) getRaw()).query()) {
        @Override
        public Iterable<Vertex> vertices() {
            return new ActiveVersionedVertexIterable<V>(this.query.vertices(), getGraph());
        }

        @Override
        public Iterable<Edge> edges() {
            return new ActiveVersionedEdgeIterable<V>(this.query.edges(), getGraph());
        }
    };
}
 
开发者ID:indexiatech,项目名称:antiquity,代码行数:15,代码来源:ActiveVersionedVertex.java

示例11: query

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
public VertexQuery query() {
    return new WrapperVertexQuery(((Vertex) this.baseElement).query()) {
        @Override
        public Iterable<Vertex> vertices() {
            return new ReadOnlyVertexIterable(this.query.vertices());
        }

        @Override
        public Iterable<Edge> edges() {
            return new ReadOnlyEdgeIterable(this.query.edges());
        }
    };
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:14,代码来源:ReadOnlyVertex.java

示例12: query

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
public VertexQuery query() {
    return new WrapperVertexQuery(((Vertex) this.baseElement).query()) {
        @Override
        public Iterable<Vertex> vertices() {
            return new PartitionVertexIterable(this.query.vertices(), graph);
        }

        @Override
        public Iterable<Edge> edges() {
            return new PartitionEdgeIterable(this.query.edges(), graph);
        }
    };
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:14,代码来源:PartitionVertex.java

示例13: query

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
public VertexQuery query() {
    return new WrapperVertexQuery(((Vertex) this.baseElement).query()) {
        @Override
        public Iterable<Vertex> vertices() {
            return new IdVertexIterable(this.query.vertices(), idGraph);
        }

        @Override
        public Iterable<Edge> edges() {
            return new IdEdgeIterable(this.query.edges(), idGraph);
        }
    };
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:14,代码来源:IdVertex.java

示例14: query

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
public VertexQuery query() {
    return new WrapperVertexQuery(((Vertex) this.baseElement).query()) {
        @Override
        public Iterable<Vertex> vertices() {
            return new EventVertexIterable(this.query.vertices(), eventGraph);
        }

        @Override
        public Iterable<Edge> edges() {
            return new EventEdgeIterable(this.query.edges(), eventGraph);
        }
    };
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:14,代码来源:EventVertex.java

示例15: query

import com.tinkerpop.blueprints.VertexQuery; //导入依赖的package包/类
public VertexQuery query() {
    return new WrapperVertexQuery(((Vertex) this.baseElement).query()) {
        @Override
        public Iterable<Vertex> vertices() {
            return new WrappedVertexIterable(this.query.vertices());
        }

        @Override
        public Iterable<Edge> edges() {
            return new WrappedEdgeIterable(this.query.edges());
        }
    };
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:14,代码来源:WrappedVertex.java


注:本文中的com.tinkerpop.blueprints.VertexQuery类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。