本文整理汇总了Java中com.tinkerpop.blueprints.util.io.graphml.GraphMLReader类的典型用法代码示例。如果您正苦于以下问题:Java GraphMLReader类的具体用法?Java GraphMLReader怎么用?Java GraphMLReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GraphMLReader类属于com.tinkerpop.blueprints.util.io.graphml包,在下文中一共展示了GraphMLReader类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateTypesAndLoadData
import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader; //导入依赖的package包/类
public void generateTypesAndLoadData(TitanGraph g, InputStream data) throws IOException {
schema.makeTypes(g);
GraphMLReader.inputGraph(g, data);
}
示例2: testArangoDbGraph
import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader; //导入依赖的package包/类
public void testArangoDbGraph() throws Exception {
double totalTime = 0.0d;
Graph graph = graphTest.generateGraph();
GraphMLReader.inputGraph(graph, GraphMLReader.class.getResourceAsStream("graph-example-2.xml"));
graph.shutdown();
for (int i = 0; i < TOTAL_RUNS; i++) {
graph = graphTest.generateGraph();
this.stopWatch();
int counter = 0;
Iterable<Vertex> vv = graph.getVertices();
for (final Vertex vertex : vv) {
counter++;
Iterable<Edge> ee = vertex.getEdges(Direction.OUT);
for (final Edge edge : ee) {
counter++;
final Vertex vertex2 = edge.getVertex(Direction.IN);
counter++;
Iterable<Edge> ee2 = vertex2.getEdges(Direction.OUT);
for (final Edge edge2 : ee2) {
counter++;
final Vertex vertex3 = edge2.getVertex(Direction.IN);
counter++;
Iterable<Edge> ee3 = vertex3.getEdges(Direction.OUT);
for (final Edge edge3 : ee3) {
counter++;
edge3.getVertex(Direction.OUT);
counter++;
}
}
}
}
double currentTime = this.stopWatch();
totalTime = totalTime + currentTime;
BaseTest.printPerformance(graph.toString(), counter, "ArangoDB elements touched (run=" + i + ")",
currentTime);
graph.shutdown();
}
BaseTest.printPerformance("ArangoDB", 1, "ArangoDB experiment average", totalTime / (double) TOTAL_RUNS);
}
示例3: main
import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
final File f = new File(journalFile);
//Make sure were starting with a clean file.
f.delete();
final BigdataGraph g = BigdataGraphFactory.create(journalFile);
final InputStream is = SampleBlazegraphBlueprintsEmbedded.class
.getClassLoader().getResourceAsStream("graph-example-1.xml");
try {
GraphMLReader.inputGraph(g, is);
} finally {
is.close();
}
try {
for (final Vertex v : g.getVertices()) {
log.info(v);
}
for (final Edge e : g.getEdges()) {
log.info(e);
}
} finally {
g.shutdown();
f.delete();
}
}