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


Java GremlinPipeline.toList方法代码示例

本文整理汇总了Java中com.tinkerpop.gremlin.java.GremlinPipeline.toList方法的典型用法代码示例。如果您正苦于以下问题:Java GremlinPipeline.toList方法的具体用法?Java GremlinPipeline.toList怎么用?Java GremlinPipeline.toList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.tinkerpop.gremlin.java.GremlinPipeline的用法示例。


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

示例1: testPipeline

import com.tinkerpop.gremlin.java.GremlinPipeline; //导入方法依赖的package包/类
@Test
public void testPipeline() throws Exception {
    // Add custom data
    Vertex a = g.addVertex(null);
    Vertex b = g.addVertex(null);
    a.setProperty("name", "marko");
    b.setProperty("name", "peter");
    Edge e = g.addEdge(null, a, b, "knows");
    e.setProperty("since", 2006);

    // Create a pipeline
    GremlinPipeline pipe = new GremlinPipeline();
    pipe.start(g.getVertex(1))
            .out("knows")
            .property("name");

    pipe.next(); // the next String name in the pipe
    pipe.next(5); // the next 5 String names in the pipe as a List
    pipe.iterate(); // while(true) { pipe.next() } (useful when only side-effects are desired)
    pipe.toList(); // fill a list of all the elements in the pipe
    pipe.count(); // the number of objects in the pipe
}
 
开发者ID:drazzib,项目名称:neo4j-examples,代码行数:23,代码来源:Neo4jGremlinTest.java

示例2: functionToInstructions

import com.tinkerpop.gremlin.java.GremlinPipeline; //导入方法依赖的package包/类
public static List<Instruction> functionToInstructions(Function func)
{
	GremlinPipeline<Function, Instruction> pipe = new GremlinPipeline<>();

	pipe.start(func).out(EdgeTypes.IS_FUNCTION_OF).out(EdgeTypes.IS_BB_OF);

	return pipe.toList();
}
 
开发者ID:octopus-platform,项目名称:bjoern,代码行数:9,代码来源:Traversals.java

示例3: executeQuery

import com.tinkerpop.gremlin.java.GremlinPipeline; //导入方法依赖的package包/类
private List<Vertex> executeQuery() {
    GremlinPipeline pipeline = buildPipeline().as("root");
    Pipe expressionPipe = queryExpression.asPipe();

    // AlwaysQuery returns null for pipe
    return expressionPipe == null ? pipeline.toList() :
            pipeline.add(expressionPipe).back("root").toList();
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:9,代码来源:BaseQuery.java

示例4: getVertexesForSubject

import com.tinkerpop.gremlin.java.GremlinPipeline; //导入方法依赖的package包/类
public static List<Vertex> getVertexesForSubject(
		NerdleFact questionExtraction, TinkerGraph graph) {
	final List<NerdleArg> questionsArguments = questionExtraction
			.getArguments();
	final NerdlePredicate questionPredicate = questionExtraction
			.getPredicate();

	GremlinPipeline<Iterable<Vertex>, Vertex> pipeline = new GremlinPipeline<Iterable<Vertex>, Vertex>();
	pipeline.filter(new PipeFunction<Vertex, Boolean>() {

		@Override
		public Boolean compute(Vertex vertex) {

			NerdleFact transform = NerdleGraphTransformer.transform(vertex);

			for (NerdleArg arg : transform.getArguments()) {

				boolean match = FuzzyStringMatcher.fuzzyArgumentMatcher(
						questionsArguments, arg.getText());

				if (match)
					return true;

			}

			return false;

		}

	});

	pipeline.start(graph.getVertices(NerdleGraphTransformer.PROPERTY_LEMMA,
			questionPredicate.getLemma()));
	List<Vertex> list = pipeline.toList();
	return list;
}
 
开发者ID:impro3-nerdle,项目名称:nerdle,代码行数:37,代码来源:GraphMatcher.java

示例5: functionToAlocs

import com.tinkerpop.gremlin.java.GremlinPipeline; //导入方法依赖的package包/类
public static List<Aloc> functionToAlocs(Function function)
{
	GremlinPipeline<Function, Aloc> pipe = new GremlinPipeline<>();
	pipe.start(function).out(ALOC_USE_EDGE).dedup().cast(Aloc.class);
	return pipe.toList();
}
 
开发者ID:octopus-platform,项目名称:bjoern,代码行数:7,代码来源:Traversals.java

示例6: getVertexesForArgument

import com.tinkerpop.gremlin.java.GremlinPipeline; //导入方法依赖的package包/类
public static List<Vertex> getVertexesForArgument(
		NerdleFact questionExtraction, TinkerGraph graph) {
	final NerdlePredicate predicate = questionExtraction.getPredicate();
	final NerdleSubject subject = questionExtraction.getSubject();

	GremlinPipeline<Iterable<Vertex>, Vertex> pipeline = new GremlinPipeline<Iterable<Vertex>, Vertex>();
	pipeline.filter(new PipeFunction<Vertex, Boolean>() {

		@Override
		public Boolean compute(Vertex vertex) {
			boolean subjectMatch = false;
			boolean hasArgument = false;

			for (Vertex connectedVertex : vertex.getVertices(Direction.OUT)) {

				if (connectedVertex
						.getProperty(
								NerdleGraphTransformer.PROPERTY_CLAUSE_TYPE)
						.equals(NerdleGraphTransformer.VALUE_CLAUSE_TYPE_SUBJECT)) {
					subjectMatch = FuzzyStringMatcher.fuzzySubjectMatcher(
							subject.getText(),
							connectedVertex.getProperty(
									NerdleGraphTransformer.PROPERTY_TEXT)
									.toString());
				}

				if (connectedVertex
						.getProperty(
								NerdleGraphTransformer.PROPERTY_CLAUSE_TYPE)
						.equals(NerdleGraphTransformer.VALUE_CLAUSE_TYPE_ARGUMENT)) {
					hasArgument = true;

				}

			}

			if (subjectMatch && hasArgument) {
				return true;
			}

			return false;

		}

	});

	pipeline.start(graph.getVertices(NerdleGraphTransformer.PROPERTY_LEMMA,
			predicate.getLemma()));
	List<Vertex> list = pipeline.toList();

	// System.out.println(list);

	return list;
}
 
开发者ID:impro3-nerdle,项目名称:nerdle,代码行数:55,代码来源:GraphMatcher.java


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