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


Java MappingHelper.readFromTestFile方法代码示例

本文整理汇总了Java中de.fuberlin.wiwiss.d2rq.helpers.MappingHelper.readFromTestFile方法的典型用法代码示例。如果您正苦于以下问题:Java MappingHelper.readFromTestFile方法的具体用法?Java MappingHelper.readFromTestFile怎么用?Java MappingHelper.readFromTestFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.fuberlin.wiwiss.d2rq.helpers.MappingHelper的用法示例。


在下文中一共展示了MappingHelper.readFromTestFile方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGenerateDownloadMap

import de.fuberlin.wiwiss.d2rq.helpers.MappingHelper; //导入方法依赖的package包/类
public void testGenerateDownloadMap() {
	Mapping m = MappingHelper.readFromTestFile("parser/download-map.ttl");
	MappingHelper.connectToDummyDBs(m);
	Resource name = ResourceFactory.createResource("http://example.org/dm");
	assertTrue(m.downloadMapResources().contains(name));
	DownloadMap d = m.downloadMap(name);
	assertNotNull(d);
	assertEquals("image/png", 
			d.getMediaTypeValueMaker().makeValue(
					new ResultRow() {public String get(ProjectionSpec column) {return null;}}));
	assertEquals("People.pic", d.getContentDownloadColumn().qualifiedName());
	assertEquals("URI(Pattern(http://example.org/downloads/@@[email protected]@))", 
			d.nodeMaker().toString());
	assertEquals(
			new HashSet<ProjectionSpec>() {{ 
				add(SQL.parseAttribute("People.ID"));
				add(SQL.parseAttribute("People.pic"));
			}}, 
			d.getRelation().projections());
	assertTrue(d.getRelation().isUnique());
	assertTrue(d.getRelation().condition().isTrue());
	assertTrue(d.getRelation().joinConditions().isEmpty());
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:24,代码来源:ParserTest.java

示例2: testParseAlias

import de.fuberlin.wiwiss.d2rq.helpers.MappingHelper; //导入方法依赖的package包/类
public void testParseAlias() {
	Mapping mapping = MappingHelper.readFromTestFile("parser/alias.ttl");
	MappingHelper.connectToDummyDBs(mapping);
	assertEquals(1, mapping.compiledPropertyBridges().size());
	TripleRelation bridge = (TripleRelation) mapping.compiledPropertyBridges().iterator().next();
	assertTrue(bridge.baseRelation().condition().isTrue());
	AliasMap aliases = bridge.baseRelation().aliases();
	AliasMap expected = new AliasMap(Collections.singleton(SQL.parseAlias("People AS Bosses")));
	assertEquals(expected, aliases);
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:11,代码来源:ParserTest.java

示例3: testParseResourceInsteadOfLiteral

import de.fuberlin.wiwiss.d2rq.helpers.MappingHelper; //导入方法依赖的package包/类
public void testParseResourceInsteadOfLiteral() {
	try {
		MappingHelper.readFromTestFile("parser/resource-instead-of-literal.ttl");
	} catch (D2RQException ex) {
		assertEquals(D2RQException.MAPPING_RESOURCE_INSTEADOF_LITERAL, ex.errorCode());
	}
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:8,代码来源:ParserTest.java

示例4: testParseLiteralInsteadOfResource

import de.fuberlin.wiwiss.d2rq.helpers.MappingHelper; //导入方法依赖的package包/类
public void testParseLiteralInsteadOfResource() {
	try {
		MappingHelper.readFromTestFile("parser/literal-instead-of-resource.ttl");
	} catch (D2RQException ex) {
		assertEquals(D2RQException.MAPPING_LITERAL_INSTEADOF_RESOURCE, ex.errorCode());
	}
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:8,代码来源:ParserTest.java

示例5: testTypeConflictClassMapAndBridgeIsDetected

import de.fuberlin.wiwiss.d2rq.helpers.MappingHelper; //导入方法依赖的package包/类
public void testTypeConflictClassMapAndBridgeIsDetected() {
	try {
		MappingHelper.readFromTestFile("parser/type-classmap-and-propertybridge.ttl");
	} catch (D2RQException ex) {
		assertEquals(D2RQException.MAPPING_TYPECONFLICT, ex.errorCode());
	}
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:8,代码来源:ParserTest.java

示例6: setUp

import de.fuberlin.wiwiss.d2rq.helpers.MappingHelper; //导入方法依赖的package包/类
public void setUp() {
	db = new HSQLDatabase("test");
	db.executeSQL("CREATE TABLE People (ID INT NOT NULL PRIMARY KEY, PIC_CLOB CLOB NULL, PIC_BLOB BLOB NULL)");
	db.executeSQL("INSERT INTO People VALUES (1, 'Hello World!', NULL)");
	db.executeSQL("INSERT INTO People VALUES (2, NULL, HEXTORAW('404040'))");
	Mapping m = MappingHelper.readFromTestFile("download/download-map.ttl");
	downloadCLOB = m.downloadMap(ResourceFactory.createResource("http://example.org/downloadCLOB"));
	downloadBLOB = m.downloadMap(ResourceFactory.createResource("http://example.org/downloadBLOB"));
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:10,代码来源:DownloadContentQueryTest.java

示例7: testTranslationTableRDFValueCanBeLiteral

import de.fuberlin.wiwiss.d2rq.helpers.MappingHelper; //导入方法依赖的package包/类
public void testTranslationTableRDFValueCanBeLiteral() {
	Mapping m = MappingHelper.readFromTestFile("parser/translation-table.ttl");
	TranslationTable tt = m.translationTable(ResourceFactory.createResource("http://example.org/tt"));
	assertEquals("http://example.org/foo", tt.translator().toRDFValue("literal"));
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:6,代码来源:ParserTest.java

示例8: testTranslationTableRDFValueCanBeURI

import de.fuberlin.wiwiss.d2rq.helpers.MappingHelper; //导入方法依赖的package包/类
public void testTranslationTableRDFValueCanBeURI() {
	Mapping m = MappingHelper.readFromTestFile("parser/translation-table.ttl");
	TranslationTable tt = m.translationTable(ResourceFactory.createResource("http://example.org/tt"));
	assertEquals("http://example.org/foo", tt.translator().toRDFValue("uri"));
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:6,代码来源:ParserTest.java


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