Пример #1
0
 public final <T extends BeanVertex> T createAdjacentVertex(
     BeanVertex from, Class<T> beanClass, String edgeLabel, String... edgeProperties) {
   T to = createVertex(beanClass);
   Edge edge = graph.addEdge(null, from.element(), to.element(), edgeLabel);
   ElementHelper.setProperties(edge, edgeProperties);
   return to;
 }
Пример #2
0
 static Edge addEdge(Graph graph, Edge edge) {
   Edge newEdge = graph.getEdge(edge.getId());
   if (null == newEdge) {
     Vertex outVertex = addNode(graph, edge.getVertex(Direction.OUT));
     Vertex inVertex = addNode(graph, edge.getVertex(Direction.IN));
     String label = edge.getLabel();
     newEdge = graph.addEdge(edge.getId(), outVertex, inVertex, label);
     copyProperties(edge, edge);
   }
   return newEdge;
 }
Пример #3
0
 static Edge addEdge(Graph graph, Relationship relationship) {
   Edge edge = graph.getEdge(relationship.getId());
   if (null == edge) {
     Vertex outVertex = addNode(graph, relationship.getStartNode());
     Vertex inVertex = addNode(graph, relationship.getEndNode());
     String label = relationship.getType().name();
     // TODO #152 add CurieUtil to resolve IRI to Curie
     edge = graph.addEdge(relationship.getId(), outVertex, inVertex, label);
     copyProperties(relationship, edge);
   }
   return edge;
 }