本文整理了Java中com.tinkerpop.blueprints.Vertex.setProperty()
方法的一些代码示例,展示了Vertex.setProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.setProperty()
方法的具体详情如下:
包路径:com.tinkerpop.blueprints.Vertex
类名称:Vertex
方法名:setProperty
暂无
代码示例来源:origin: pentaho/pentaho-kettle
.append( targetTemplateStepName ).append( ": " ).append( targetTemplateStepAttr.getAttributeKey() );
verboseProperties.add( mappingKey );
stepVertex.setProperty( mappingKey, mapping.toString() );
stepVertex.setProperty( DictionaryConst.PROPERTY_VERBOSE_DETAILS, StringUtils.join( verboseProperties, "," ) );
代码示例来源:origin: gentics/mesh
/**
* Set the execution duration for the change.
*
* @param duration
*/
private void setDuration(long duration) {
vertex.setProperty("duration", duration);
}
代码示例来源:origin: stackoverflow.com
Vertex vPerson = graph.addVertex("class:Mysubclass");
vPerson.setProperty("firstName", "John");
vPerson.setProperty("lastName", "Smith");
vPerson.setProperty("<Person property>", "<value>");
vPerson.setProperty("<Person property>", "<value>");
graph.commit();
代码示例来源:origin: stackoverflow.com
tx1 = g.newTransaction();
Vertex user_ver = tx1.addVertexWithLabel("user");
user_ver.setProperty("userid",entityPK);
//Adding other properties for vertex
tx1.commit();
代码示例来源:origin: socialsensor/graphdb-benchmarks
@Override
public void initCommunityProperty()
{
int communityCounter = 0;
for (Vertex v : titanGraph.getVertices())
{
v.setProperty(NODE_COMMUNITY, communityCounter);
v.setProperty(COMMUNITY, communityCounter);
communityCounter++;
}
}
代码示例来源:origin: tinkerpop/furnace
@Override
public void annotate(Vertex vertex, Map<String, Object> context) {
for(Entry<String, Object> entry: context.entrySet()) {
vertex.setProperty(entry.getKey(), entry.getValue());
}
}
};
代码示例来源:origin: org.hawkular.titan/titan-test
@Override
public void run(TitanTransaction tx) {
Vertex u = tx.getVertex(vids[pos++]);
u.setProperty("uid",5);
}
});
代码示例来源:origin: org.hawkular.titan/titan-test
@Override
public void run(TitanTransaction tx) {
Vertex u = tx.getVertex(vids[0]);
u.setProperty("name","v"+random.nextInt(10));
}
});
代码示例来源:origin: com.puresoltechnologies.extended-objects/titan
@Override
public Vertex createEntity(
TypeMetadataSet<EntityTypeMetadata<TitanVertexMetadata>> types,
Set<String> discriminators,
Map<PrimitivePropertyMethodMetadata<TitanPropertyMetadata>, Object> exampleEntity) {
Vertex vertex = titanGraph.addVertex(null);
for (String discriminator : discriminators) {
vertex.setProperty(TitanStoreSession.XO_DISCRIMINATORS_PROPERTY
+ discriminator, discriminator);
}
return vertex;
}
代码示例来源:origin: socialsensor/graphdb-benchmarks
@Override
public void moveNode(int nodeCommunity, int toCommunity)
{
Iterable<Vertex> fromIter = titanGraph.getVertices(NODE_COMMUNITY, nodeCommunity);
for (Vertex vertex : fromIter)
{
vertex.setProperty(COMMUNITY, toCommunity);
}
}
代码示例来源:origin: gentics/mesh
private void fixName(Vertex schemaVertex) {
String name = schemaVertex.getProperty("name");
if (!isEmpty(name)) {
name = name.replaceAll("-", "_");
schemaVertex.setProperty("name", name);
}
}
代码示例来源:origin: tinkerpop/furnace
public void execute(final Vertex vertex, final GraphMemory graphMemory) {
final Map<Particle, Long> oldParticles = graphMemory.isInitialIteration() ? this.startParticles : (Map<Particle, Long>) vertex.getProperty(PARTICLES);
final Map<Particle, Long> newParticles = new HashMap<Particle, Long>();
for (final Map.Entry<Particle, Long> entry : oldParticles.entrySet()) {
entry.getKey().execute(vertex, graphMemory, entry.getValue(), newParticles);
}
vertex.setProperty(PARTICLES, newParticles);
}
代码示例来源:origin: fr.lirmm.graphik/graal-store-blueprints
private void init() {
try {
this.graph.getVertices("class", "");
} catch (IllegalArgumentException e) {
Vertex v = this.graph.addVertex(null);
v.setProperty("class", "");
}
}
代码示例来源:origin: tinkerpop/furnace
public void execute(final Vertex vertex, final GraphMemory graphMemory) {
if (graphMemory.isInitialIteration()) {
vertex.setProperty(COUNTS, 1l);
} else {
final VertexQueryBuilder query = this.queries.get((graphMemory.getIteration() - 1) % this.queries.size());
long newCount = 0l;
for (final Vertex adjacent : query.build(vertex).vertices()) {
newCount = newCount + (Long) adjacent.getProperty(COUNTS);
}
vertex.setProperty(COUNTS, newCount);
}
}
代码示例来源:origin: tinkerpop/furnace
public void execute(final Vertex vertex, final GraphMemory graphMemory) {
if (graphMemory.isInitialIteration()) {
vertex.setProperty(PAGE_RANK, 1.0d / this.vertexCountAsDouble);
vertex.setProperty(EDGE_COUNT, (double) this.outgoingQuery.build(vertex).count());
} else {
double newPageRank = 0.0d;
for (final Vertex adjacent : this.incomingQuery.build(vertex).vertices()) {
newPageRank += (Double) adjacent.getProperty(PAGE_RANK) / (Double) adjacent.getProperty(EDGE_COUNT);
}
vertex.setProperty(PAGE_RANK, (this.alpha * newPageRank) + ((1.0d - this.alpha) / this.vertexCountAsDouble));
}
}
代码示例来源:origin: eu.agrosense.server/storage-tinkerpop
@Override
public synchronized long nextId(String farmID, ItemIdType itemIdType, int n) {
Vertex farmVertex = findVertexByURI(getPartitionRW(farmID), farmID);
Long curVal = farmVertex.<Long>getProperty(SEQUENCE_PREFIX + itemIdType.name());
long nextVal = (curVal == null ? 0l : curVal.longValue()) + n;
farmVertex.setProperty(SEQUENCE_PREFIX + itemIdType.name(), nextVal);
commit();
LOGGER.log(Level.FINEST, "nextId({0}, {1}, {2}) -> {3}", new Object[]{farmID, itemIdType.name(), n, nextVal});
System.err.println("nextId(" + farmID + ", " + itemIdType.name() + ", " + n + ") -> " + nextVal);
return nextVal;
}
代码示例来源:origin: SciGraph/SciGraph
@Test
public void collectionsAreReturned() {
TinkerGraph graph = new TinkerGraph();
Vertex v = graph.addVertex(1);
assertThat(TinkerGraphUtil.getProperties(v, "foo", String.class), is(empty()));
v.setProperty("foo", "bar");
assertThat(TinkerGraphUtil.getProperties(v, "foo", String.class), contains("bar"));
v.setProperty("foo", newHashSet("bar", "baz"));
assertThat(TinkerGraphUtil.getProperties(v, "foo", String.class), containsInAnyOrder("bar", "baz"));
v.setProperty("foo", new String[] {"bar", "baz"});
assertThat(TinkerGraphUtil.getProperties(v, "foo", String.class), containsInAnyOrder("bar", "baz"));
}
代码示例来源:origin: com.thinkaurelius.titan/titan-test-jre6
@Test
public void testJointIndexRetrieval() {
graph.makeKey("name").dataType(String.class).indexed(Vertex.class).make();
graph.makeKey("color").dataType(String.class).indexed(Vertex.class).make();
Vertex v = graph.addVertex(null);
v.setProperty("name", "ilya");
v.setProperty("color", "blue");
graph.commit();
assertEquals(1, Iterables.size(graph.query().has("name", "ilya").vertices()));
assertEquals(1, Iterables.size(graph.query().has("name", "ilya").has("color", "blue").vertices()));
}
代码示例来源:origin: SciGraph/SciGraph
@Test
public void properties_areCopied() {
Vertex v1 = graph.addVertex(1L);
v1.setProperty("foo", "bar");
Vertex v2 = graph.addVertex(2L);
TinkerGraphUtil.copyProperties(v1, v2);
assertThat((String)v2.getProperty("foo"), is("bar"));
}
代码示例来源:origin: SciGraph/SciGraph
@SuppressWarnings("unchecked")
@Test
public void arrayProperties_areCopied() {
Vertex v1 = graph.addVertex(1L);
v1.setProperty("foo", new String[] {"bar", "baz"});
Vertex v2 = graph.addVertex(2L);
TinkerGraphUtil.copyProperties(v1, v2);
assertThat((List<String>)v2.getProperty("foo"), contains("bar", "baz"));
}
内容来源于网络,如有侵权,请联系作者删除!