本文整理汇总了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());
}
示例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);
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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"));
}
示例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"));
}
示例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"));
}