当前位置: 首页>>代码示例>>Java>>正文


Java GraphMLReader类代码示例

本文整理汇总了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);
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:5,代码来源:GraphGenerator.java

示例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);
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:45,代码来源:ArangoDbBenchmarkTestSuite.java

示例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();
			
		}
		
}
 
开发者ID:blazegraph,项目名称:blazegraph-samples,代码行数:38,代码来源:SampleBlazegraphBlueprintsEmbedded.java


注:本文中的com.tinkerpop.blueprints.util.io.graphml.GraphMLReader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。