本文整理了Java中com.tinkerpop.blueprints.Vertex.getProperty()
方法的一些代码示例,展示了Vertex.getProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.getProperty()
方法的具体详情如下:
包路径:com.tinkerpop.blueprints.Vertex
类名称:Vertex
方法名:getProperty
暂无
代码示例来源:origin: pentaho/pentaho-kettle
DictionaryConst.NODE_TYPE_STEP_PROPERTY, (String) targetTemplateStepVertex.getProperty(
DictionaryConst.PROPERTY_LOGICAL_ID ), targetTemplateStepName + ":"
+ targetTemplateStepAttr.getAttributeKey(), null );
getMetaverseBuilder().addLink( sourceStepField, DictionaryConst.LINK_INPUTS, stepVertex );
final Vertex derivedField = findFieldVertex( parentTransMeta, stepVertex.getProperty(
DictionaryConst.PROPERTY_NAME ).toString(),
sourceStepField.getProperty( DictionaryConst.PROPERTY_NAME ).toString() );
if ( derivedField != null ) {
getMetaverseBuilder().addLink( sourceStepField, DictionaryConst.LINK_DERIVES, derivedField );
代码示例来源:origin: gentics/mesh
private void updateLists(Vertex container, Map<String, JsonObject> fieldMap) {
for (Vertex listElement: container.getVertices(Direction.OUT, HAS_LIST)) {
String fieldName = listElement.getProperty(FIELD_KEY);
if (fieldMap.containsKey(fieldName) && NUMBER_TYPE.equals(fieldMap.get(fieldName).getString(FIELD_LIST_TYPE_KEY))) {
listElement.getPropertyKeys().stream()
.filter(k -> k.startsWith(ITEM_PREFIX))
.forEach(k -> updateProperty(k, listElement));
}
}
}
代码示例来源:origin: gentics/mesh
/**
* Return the change uuid.
*
* @return
*/
public String getUuid() {
return vertex.getProperty("uuid");
}
代码示例来源:origin: fr.lirmm.graphik/graal-store-blueprints
private static Predicate vertexToPredicate(Vertex vertex) {
String label = vertex.getProperty("value");
int arity = vertex.getProperty("arity");
return new Predicate(label, arity);
}
代码示例来源:origin: socialsensor/graphdb-benchmarks
@Override
public Set<Integer> getNodesFromCommunity(int community)
{
Set<Integer> nodes = new HashSet<Integer>();
Iterable<Vertex> iter = titanGraph.getVertices(COMMUNITY, community);
for (Vertex v : iter)
{
Integer nodeId = v.getProperty(NODE_ID);
nodes.add(nodeId);
}
return nodes;
}
代码示例来源:origin: fr.inria.atlanmod.neoemf/neoemf-data-blueprints-core
/**
* Finds the number of elements contained in the given {@code feature}.
*
* @param vertex the input {@link Vertex} of the {@code feature}
* @param feature the {@link EStructuralFeature} describing the feature to access
*
* @return the size of the {@code feature} if it is multi-valued, {@code 0} otherwise
*/
protected Integer getSize(Vertex vertex, EStructuralFeature feature) {
Integer size = vertex.getProperty(feature.getName() + SEPARATOR + SIZE_LITERAL);
return isNull(size) ? 0 : size;
}
代码示例来源:origin: joshsh/ripple
@Override
public Object getValue(Vertex instance, String key, ModelConnection mc) throws RippleException {
Object result = instance.getProperty(key);
return null == result ? null : BlueprintsLibrary.toRipple(result);
}
代码示例来源:origin: socialsensor/graphdb-benchmarks
@Override
public int getCommunity(int nodeCommunity)
{
final Iterator<Vertex> result = graph.getVertices(NODE_COMMUNITY, nodeCommunity).iterator();
if (!result.hasNext())
throw new IllegalArgumentException("node community not found: " + nodeCommunity);
Vertex vertex = result.next();
int community = vertex.getProperty(COMMUNITY);
return community;
}
代码示例来源:origin: socialsensor/graphdb-benchmarks
@Override
public int getCommunityFromNode(int nodeId)
{
Vertex vertex = titanGraph.getVertices(NODE_ID, nodeId).iterator().next();
return vertex.getProperty(COMMUNITY);
}
代码示例来源:origin: gentics/mesh
private Vertex findBinary(String hash, Vertex binaryRoot) {
for (Vertex binary : binaryRoot.getVertices(OUT, "HAS_BINARY")) {
String foundHash = binary.getProperty(NEW_HASH_KEY);
if (foundHash.equals(hash)) {
return binary;
}
}
return null;
}
代码示例来源:origin: gentics/mesh
private void fixName(Vertex schemaVertex) {
String name = schemaVertex.getProperty("name");
if (!isEmpty(name)) {
name = name.replaceAll("-", "_");
schemaVertex.setProperty("name", name);
}
}
代码示例来源:origin: gentics/mesh
private Vertex findAdmin() {
Vertex admin = null;
Iterator<Vertex> langIt = getMeshRootVertex().getVertices(Direction.OUT, "HAS_USER_ROOT").iterator().next()
.getVertices(Direction.OUT, "HAS_USER").iterator();
while (langIt.hasNext()) {
Vertex user = langIt.next();
if (user.getProperty("username").equals("admin")) {
admin = user;
}
}
return admin;
}
代码示例来源:origin: gentics/mesh
private Vertex findEnglish() {
Vertex english = null;
Iterator<Vertex> langIt = getMeshRootVertex().getVertices(Direction.OUT, "HAS_LANGUAGE_ROOT").iterator().next()
.getVertices(Direction.OUT, "HAS_LANGUAGE").iterator();
while (langIt.hasNext()) {
Vertex language = langIt.next();
if (language.getProperty("languageTag").equals("en")) {
english = language;
}
}
return english;
}
代码示例来源:origin: org.jboss.windup.legacy.application/grapher
private void writeGraphNodes(OutputStream os) throws IOException {
//iterate the nodes.
for(Vertex vertex : graph.getVertices()) {
String id = ""+vertex.getId().hashCode();
String label = vertex.getProperty(vertexLabelProperty);
if(StringUtils.isBlank(label)) {
label = vertex.toString();
}
writeGraphNode(id, label, os);
}
}
代码示例来源:origin: gentics/mesh
private Vertex getOrFixUserReference(Vertex element, String edge) {
Vertex creator;
Iterator<Vertex> creatorIterator = element.getVertices(Direction.OUT, edge).iterator();
if (!creatorIterator.hasNext()) {
log.error("The element {" + element.getProperty("uuid") + "} has no {" + edge + "}. Using admin instead.");
creator = findAdmin();
element.addEdge(edge, creator);
} else {
creator = creatorIterator.next();
}
return creator;
}
代码示例来源:origin: apache/incubator-atlas
@Override
public Boolean compute(Edge edge) {
String type = edge.getVertex(Direction.OUT).getProperty(Constants.ENTITY_TYPE_PROPERTY_KEY);
VertexWrapper v = new TermVertexWrapper(edge.getVertex(Direction.IN));
return edge.getLabel().startsWith(type) && v.getPropertyKeys().contains("available_as_tag");
}
}));
代码示例来源:origin: SciGraph/SciGraph
@Test
public void arrayProperties_areMappedToLists() {
when(node.getPropertyKeys()).thenReturn(newHashSet("foo", "bar"));
when(node.getProperty("foo")).thenReturn(new String[]{"elt1", "elt2"});
when(node.getProperty("bar")).thenReturn(new int[]{1,2});
TinkerGraphUtil tgu = new TinkerGraphUtil(curieUtil);
Vertex v = tgu.addNode(node);
assertThat(v.getProperty("foo"), is((Object)newArrayList("elt1", "elt2")));
assertThat(v.getProperty("bar"), is((Object)newArrayList(1, 2)));
}
代码示例来源:origin: SciGraph/SciGraph
@Test
public void propertiesAreTranslated() {
when(node.getPropertyKeys()).thenReturn(newHashSet("foo", "baz"));
when(node.getProperty("foo")).thenReturn("bar");
when(node.getProperty("baz")).thenReturn(true);
TinkerGraphUtil tgu = new TinkerGraphUtil(curieUtil);
Vertex v = tgu.addNode(node);
assertThat(v.getProperty("foo"), is((Object)"bar"));
assertThat(v.getProperty("baz"), is((Object)true));
}
代码示例来源:origin: fr.inria.atlanmod.neoemf/neoemf-data-blueprints-core
@Override
protected Object getAttribute(PersistentEObject object, EAttribute attribute, int index) {
Vertex vertex = backend.getVertex(object.id());
String propertyName = attribute.getName();
if (attribute.isMany()) {
checkElementIndex(index, getSize(vertex, attribute), "Invalid get index " + index);
propertyName += SEPARATOR + index;
}
return parseProperty(attribute, vertex.getProperty(propertyName));
}
代码示例来源: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"));
}
内容来源于网络,如有侵权,请联系作者删除!