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


Java GraphTraversal.property方法代码示例

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


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

示例1: apply

import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
@Override
@SneakyThrows
public GraphTraversal<Element, Element> apply(GraphTraversalSource g) {
  GraphTraversal traversal = g.addV(element.label());
  if (element.id() != null && HasFeature.Verifier.of(g)
      .verify(supportsUserSuppliedIds(element))) {
    traversal.property(T.id, element.id());
  }
  for (Field field : keyFields(element)) {
    String key = propertyKey(field);
    Object value = propertyValue(field, element);
    if (isMissing(value)) {
      throw org.apache.tinkerpop.gremlin.object.structure.Element.Exceptions.requiredKeysMissing(
          element.getClass(), key);
    }
    traversal.property(key, value);
  }
  return traversal;
}
 
开发者ID:karthicks,项目名称:gremlin-ogm,代码行数:20,代码来源:AddV.java

示例2: insertList

import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
private static void insertList(final List list, final String listKey, final GraphTraversal traversal) {
    if (list.get(0) instanceof List)
        throw new IllegalArgumentException("Lists can not contain nested lists");
    char state = list.get(0) instanceof Map ? 'o' : 'p';
    for (int i = 1; i < list.size(); i++) {
        if (list.get(i) instanceof Map && 'p' == state)
            throw new IllegalArgumentException("Lists can only support all objects or all primitives");
        else if (list.get(i) instanceof List)
            throw new IllegalArgumentException("Lists can not contain nested lists");
        else if (!(list.get(i) instanceof Map) && 'o' == state)
            throw new IllegalArgumentException("Lists can only support all objects or all primitives");
    }
    for (final Object object : list) {
        if ('p' == state)
            traversal.property(VertexProperty.Cardinality.list, listKey, object);
        else {
            traversal.map(insertMap((Map) object, new DefaultGraphTraversal()));
            traversal.addE(listKey).from("a").select("a");
        }
    }
}
 
开发者ID:okram,项目名称:mongodb-gremlin,代码行数:22,代码来源:MongoDBStrategy.java

示例3: create

import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
protected <V extends Vertex> GraphTraversal create(V vertex) {
  GraphTraversal traversal = g
      .addV(vertex.label());
  Object vertexId = maybeSupplyId(vertex);
  if (vertexId != null) {
    traversal.property(T.id, vertexId);
  }
  return update(traversal, vertex, Properties::all);
}
 
开发者ID:karthicks,项目名称:gremlin-ogm,代码行数:10,代码来源:VertexGraph.java

示例4: create

import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
<E extends Edge> GraphTraversal create(E edge, Object fromId, Object toId) {
  GraphTraversal traversal = g
      .V().hasId(fromId).as("from")
      .V().hasId(toId).as("to")
      .addE(edge.label()).as("edge").from("from");
  Object edgeId = maybeSupplyId(edge);
  if (edgeId != null) {
    traversal.property(T.id, edgeId);
  }
  return update(traversal, edge, Properties::all);
}
 
开发者ID:karthicks,项目名称:gremlin-ogm,代码行数:12,代码来源:EdgeGraph.java

示例5: property

import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
@Override
public GraphTraversal property(GraphTraversal traversal, Update update) {
  if (update.getCardinality() != null) {
    traversal.property(update.getCardinality(),
        update.getKey(),
        update.getValue(),
        update.getKeyValues());
  } else {
    traversal.property(update.getKey(),
        update.getValue());
  }
  return traversal;
}
 
开发者ID:karthicks,项目名称:gremlin-ogm,代码行数:14,代码来源:UpdateBy.java


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