本文整理汇总了Java中de.fuberlin.wiwiss.d2rq.helpers.MappingHelper.connectToDummyDBs方法的典型用法代码示例。如果您正苦于以下问题:Java MappingHelper.connectToDummyDBs方法的具体用法?Java MappingHelper.connectToDummyDBs怎么用?Java MappingHelper.connectToDummyDBs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.fuberlin.wiwiss.d2rq.helpers.MappingHelper
的用法示例。
在下文中一共展示了MappingHelper.connectToDummyDBs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
示例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);
}