本文整理汇总了Java中com.tinkerpop.blueprints.Graph.getEdges方法的典型用法代码示例。如果您正苦于以下问题:Java Graph.getEdges方法的具体用法?Java Graph.getEdges怎么用?Java Graph.getEdges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tinkerpop.blueprints.Graph
的用法示例。
在下文中一共展示了Graph.getEdges方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetGraphRelsOnly
import com.tinkerpop.blueprints.Graph; //导入方法依赖的package包/类
@Test
public void testGetGraphRelsOnly() {
LoadingSheetData rels
= LoadingSheetData.relsheet( "Human Being", "Car", "Purchased" );
rels.addProperties( Arrays.asList( "Price", "Date" ) );
ValueFactory vf = new ValueFactoryImpl();
Map<String, Value> props = new HashMap<>();
props.put( "Price", vf.createLiteral( "3000 USD" ) );
rels.add( "Yuri", "Yugo", props );
rels.add( "Yuri", "Pinto" );
Graph g = GsonWriter.getGraph( data );
int vsize = 0;
int esize = 0;
for ( Vertex v : g.getVertices() ) {
vsize++;
}
for ( Edge e : g.getEdges() ) {
esize++;
}
assertEquals( 3, vsize );
assertEquals( 2, esize );
}
示例2: testGetGraph1
import com.tinkerpop.blueprints.Graph; //导入方法依赖的package包/类
@Test
public void testGetGraph1() {
Graph g = GsonWriter.getGraph( data );
int vsize = 0;
int esize = 0;
for ( Vertex v : g.getVertices() ) {
vsize++;
}
for ( Edge e : g.getEdges() ) {
esize++;
}
assertEquals( 3, vsize );
assertEquals( 2, esize );
}
示例3: getEvidence
import com.tinkerpop.blueprints.Graph; //导入方法依赖的package包/类
List<Closure> getEvidence(Graph graph) {
List<Closure> closures = new ArrayList<>();
for (Edge edge : graph.getEdges()) {
if (hasEvidence.equals(edge.getLabel())) {
Vertex vertex = edge.getVertex(Direction.IN);
Node node = graphDb.getNodeById(Long.parseLong((String) vertex.getId()));
closures.add(closureUtil.getClosure(node, SolrDocUtil.DEFAULT_CLOSURE_TYPES));
}
}
return closures;
}
示例4: getSource
import com.tinkerpop.blueprints.Graph; //导入方法依赖的package包/类
List<Closure> getSource(Graph graph) {
List<Closure> closures = new ArrayList<>();
for (Edge edge : graph.getEdges()) {
if (source.equals(edge.getLabel())) {
Vertex vertex = edge.getVertex(Direction.IN);
Node node = graphDb.getNodeById(Long.parseLong((String) vertex.getId()));
closures.add(closureUtil.getClosure(node, SolrDocUtil.DEFAULT_CLOSURE_TYPES));
}
}
return closures;
}
示例5: getDefinedBys
import com.tinkerpop.blueprints.Graph; //导入方法依赖的package包/类
List<String> getDefinedBys(Graph graph) {
Set<String> definedBys = new HashSet<>();
for (Edge edge : graph.getEdges()) {
definedBys.addAll(TinkerGraphUtil.getProperties(edge, isDefinedBy, String.class));
}
return newArrayList(definedBys);
}
示例6: addGraph
import com.tinkerpop.blueprints.Graph; //导入方法依赖的package包/类
public void addGraph(Graph addition) {
for (Vertex vertex : addition.getVertices()) {
addElement(vertex);
}
for (Edge edge : addition.getEdges()) {
addElement(edge);
}
}
示例7: mergeEdges
import com.tinkerpop.blueprints.Graph; //导入方法依赖的package包/类
private void mergeEdges(Graph graph1, Graph graph2) {
for (Edge edge2 : graph2.getEdges()) {
mergeEdge(graph1, edge2);
}
}