本文整理匯總了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");
}
示例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;
}
}
示例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);
}
示例4: testGetValueThatIsNotPresentOnVertex
import org.apache.tinkerpop.gremlin.structure.Vertex; //導入方法依賴的package包/類
@Test(expected = IllegalStateException.class)
public void testGetValueThatIsNotPresentOnVertex() {
Vertex vertex = createVertex();
vertex.value("something");
}
示例5: getValue
import org.apache.tinkerpop.gremlin.structure.Vertex; //導入方法依賴的package包/類
private String getValue(final Vertex vertex) {
return vertex.value(Schema.VertexProperties.VALUE);
}
示例6: getDatatype
import org.apache.tinkerpop.gremlin.structure.Vertex; //導入方法依賴的package包/類
private String getDatatype(final Vertex vertex) {
return vertex.value(Schema.VertexProperties.DATATYPE);
}