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


Java GraphD2RQ类代码示例

本文整理汇总了Java中de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ的典型用法代码示例。如果您正苦于以下问题:Java GraphD2RQ类的具体用法?Java GraphD2RQ怎么用?Java GraphD2RQ使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GraphD2RQ类属于de.fuberlin.wiwiss.d2rq.jena包,在下文中一共展示了GraphD2RQ类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reload

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
private void reload() {
	loader.getMapping().connect();
	GraphD2RQ graph = loader.getGraphD2RQ();
	
	datasetGraph = DatasetGraphFactory.createOneGraph(graph);
	defaultModel = ModelFactory.createModelForGraph(datasetGraph.getDefaultGraph());		

	hasTruncatedResults = false;
	for (Database db: loader.getMapping().databases()) {
		if (db.getResultSizeLimit() != Database.NO_LIMIT) {
			hasTruncatedResults = true;
		}
	}

	if (autoReload) {
		lastModified = watchedFile.lastModified();
		lastReload = System.currentTimeMillis();
	}
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:20,代码来源:AutoReloadableDataset.java

示例2: testGenerateTripleFromSimpleD2RQMapping

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public void testGenerateTripleFromSimpleD2RQMapping() {
	Mapping m = MappingHelper.readFromTestFile("helpers/simple.ttl");
	m.configuration().setServeVocabulary(false);
	db.executeSQL("INSERT INTO TEST VALUES (1, 'Hello World!')");
	GraphD2RQ g = new GraphD2RQ(m);
	assertTrue(g.contains(
			Node.createURI(EX + "test/1"), RDF.Nodes.type, Node.createURI(EX + "Test")));
	assertEquals(1, g.size());
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:10,代码来源:HSQLSimpleTest.java

示例3: main

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public static void main(String[] args) {
	// Load mapping file
	Model mapModel = FileManager.get().loadModel("doc/example/mapping-iswc.ttl");
	
	// Parse mapping file
	MapParser parser = new MapParser(mapModel, "http://localhost:2020/");
	Mapping mapping = parser.parse();
	
	// Set up the GraphD2RQ
	GraphD2RQ g = new GraphD2RQ(mapping);

	// Create a find(spo) pattern 
	Node subject = Node.ANY;
	Node predicate = DC.date.asNode();
	Node object = Node.createLiteral("2003", null, XSDDatatype.XSDgYear);
	Triple pattern = new Triple(subject, predicate, object);

	// Query the graph
	Iterator<Triple> it = g.find(pattern);
	
	// Output query results
	while (it.hasNext()) {
		Triple t = it.next();
	    System.out.println("Published in 2003: " + t.getSubject());
	}
	g.close();
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:28,代码来源:JenaGraphExample.java

示例4: QueryEngineD2RQ

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public QueryEngineD2RQ(GraphD2RQ graph, Query query) {
	this(graph, query, null);
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:4,代码来源:QueryEngineD2RQ.java

示例5: accept

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public boolean accept(Query query, DatasetGraph dataset, Context context) {
	return dataset.getDefaultGraph() instanceof GraphD2RQ;
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:4,代码来源:QueryEngineD2RQ.java

示例6: create

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public Plan create(Query query, DatasetGraph dataset,
		Binding inputBinding, Context context) {
	return new QueryEngineD2RQ((GraphD2RQ) dataset.getDefaultGraph(),
			query, context).getPlan();
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:6,代码来源:QueryEngineD2RQ.java

示例7: testDefaultMappingWithHelloWorld

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public void testDefaultMappingWithHelloWorld() {
	db.executeSQL("INSERT INTO TEST VALUES (1, 'Hello World!')");
	GraphD2RQ g = generateDefaultGraphD2RQ();
	assertTrue(g.contains(Node.ANY, Node.ANY, Node.createLiteral("Hello World!")));
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:6,代码来源:HSQLSimpleTest.java

示例8: testGenerateEmptyGraphFromSimpleD2RQMapping

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public void testGenerateEmptyGraphFromSimpleD2RQMapping() {
	Mapping m = MappingHelper.readFromTestFile("helpers/simple.ttl");
	m.configuration().setServeVocabulary(false);
	GraphD2RQ g = new GraphD2RQ(m);
	assertTrue(g.isEmpty());
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:7,代码来源:HSQLSimpleTest.java

示例9: generateDefaultGraphD2RQ

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
private GraphD2RQ generateDefaultGraphD2RQ() {
	return new GraphD2RQ(generateDefaultMapping());
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:4,代码来源:HSQLSimpleTest.java

示例10: setUp

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
protected void setUp() throws Exception {
	this.graph = (GraphD2RQ) new ModelD2RQ(D2RQTestSuite.ISWC_MAP, "TURTLE", "http://test/").getGraph();
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:4,代码来源:FindTestFramework.java

示例11: testCopyPrefixesFromMapModelToD2RQGraph

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public void testCopyPrefixesFromMapModelToD2RQGraph() {
	GraphD2RQ g = new ModelD2RQ(
			FileManager.get().loadModel(D2RQTestSuite.DIRECTORY_URL + "prefixes.ttl"), null).getGraph();
	assertEquals("http://example.org/", g.getPrefixMapping().getNsPrefixURI("ex"));
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:6,代码来源:JenaAPITest.java

示例12: getGraph

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
private GraphD2RQ getGraph(Mapping mapping) {
	return new GraphD2RQ(mapping);
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:4,代码来源:DatatypeTestBase.java


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