當前位置: 首頁>>代碼示例>>Java>>正文


Java Vertex.value方法代碼示例

本文整理匯總了Java中org.apache.tinkerpop.gremlin.structure.Vertex.value方法的典型用法代碼示例。如果您正苦於以下問題:Java Vertex.value方法的具體用法?Java Vertex.value怎麽用?Java Vertex.value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.tinkerpop.gremlin.structure.Vertex的用法示例。


在下文中一共展示了Vertex.value方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shouldNotReadValueOfPropertyOnVertexThatWasRemoved

import org.apache.tinkerpop.gremlin.structure.Vertex; //導入方法依賴的package包/類
@Test(expected = IllegalStateException.class)
public void shouldNotReadValueOfPropertyOnVertexThatWasRemoved() {
    final TinkerGraph graph = TinkerGraph.open();
    final Vertex v = graph.addVertex();
    v.property("name", "stephen");

    assertEquals("stephen", v.value("name"));
    v.remove();
    v.value("name");
}
 
開發者ID:ShiftLeftSecurity,項目名稱:tinkergraph-gremlin,代碼行數:11,代碼來源:TinkerGraphTest.java

示例2: execute

import org.apache.tinkerpop.gremlin.structure.Vertex; //導入方法依賴的package包/類
/**
 * Execute this marvelous code, going from the Content to Users.
 *
 * Internally uses the RecommendationForNewUser class to build the recommendation as we want, pretty and
 * simple.
 *
 * @param vertex
 * @param messenger
 * @param memory
 */
@Override
public void execute(Vertex vertex, Messenger<Tuple> messenger, Memory memory) {
  try {
    HadoopQueryRunner runner = new HadoopQueryRunner(g, vertex.value(Schema.USER_NAME));
    GraphTraversal<Vertex, Edge> t = g.V(vertex.id()).inE(Schema.FOLLOWS);

    while(t.hasNext()) {
      Edge followsEdge = t.next();

      long commonFollowedUsers = runner.countCommonFollowedUsers(followsEdge.outVertex());
      long postsPerDaySince = runner.countPostsPerDaySince(sevenDaysAgo);
      long weight = (3 * commonFollowedUsers + postsPerDaySince) / 4;
      if(min == -10 || min > weight) {
        min = (int) weight;
      }
      if(max < weight) {
        max = (int) weight;
      }
      count++;

      followsEdge.property(CreateWeightIndex.WEIGHT, weight);
    }
  } catch (Exception e){
    e.printStackTrace();
    LOGGER.error("while processing " + vertex.id() + ": " + e.getClass().toString() + "(" + e.getMessage() + ")");
    return;
  }
}
 
開發者ID:marcelocf,項目名稱:janusgraph_tutorial,代碼行數:39,代碼來源:ComputeWeightVertexProgram.java

示例3: testAutotypeStringProperties

import org.apache.tinkerpop.gremlin.structure.Vertex; //導入方法依賴的package包/類
@Test
public void testAutotypeStringProperties() {
  Vertex vertex = createVertex();
  String value = vertex.value("value");
  assertEquals("value", value);
}
 
開發者ID:mnemonic-no,項目名稱:act-platform,代碼行數:7,代碼來源:ObjectVertexTest.java

示例4: testGetValueThatIsNotPresentOnVertex

import org.apache.tinkerpop.gremlin.structure.Vertex; //導入方法依賴的package包/類
@Test(expected = IllegalStateException.class)
public void testGetValueThatIsNotPresentOnVertex() {
  Vertex vertex = createVertex();
  vertex.value("something");
}
 
開發者ID:mnemonic-no,項目名稱:act-platform,代碼行數:6,代碼來源:ObjectVertexTest.java

示例5: getValue

import org.apache.tinkerpop.gremlin.structure.Vertex; //導入方法依賴的package包/類
private String getValue(final Vertex vertex) {
    return vertex.value(Schema.VertexProperties.VALUE);
}
 
開發者ID:joshsh,項目名稱:graphsail,代碼行數:4,代碼來源:DataStore.java

示例6: getDatatype

import org.apache.tinkerpop.gremlin.structure.Vertex; //導入方法依賴的package包/類
private String getDatatype(final Vertex vertex) {
    return vertex.value(Schema.VertexProperties.DATATYPE);
}
 
開發者ID:joshsh,項目名稱:graphsail,代碼行數:4,代碼來源:DataStore.java


注:本文中的org.apache.tinkerpop.gremlin.structure.Vertex.value方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。