本文整理匯總了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);
}