本文整理汇总了Java中de.fuberlin.wiwiss.d2rq.sql.DummyDB类的典型用法代码示例。如果您正苦于以下问题:Java DummyDB类的具体用法?Java DummyDB怎么用?Java DummyDB使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DummyDB类属于de.fuberlin.wiwiss.d2rq.sql包,在下文中一共展示了DummyDB类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import de.fuberlin.wiwiss.d2rq.sql.DummyDB; //导入依赖的package包/类
public void setUp() {
this.model = ModelFactory.createDefaultModel();
this.mapping = new Mapping();
this.database = new Database(this.model.createResource());
database.useConnectedDB(new DummyDB());
this.mapping.addDatabase(this.database);
employees = createClassMap("http://test/[email protected]@[email protected]@");
employees.addAlias("employees AS e");
employees.addJoin("e.ID = foo.bar");
employees.addCondition("e.status = 'active'");
managerBridge = createPropertyBridge(employees, "http://terms.example.org/manager");
managerBridge.addAlias("e AS m");
managerBridge.setRefersToClassMap(this.employees);
managerBridge.addJoin("e.manager = m.ID");
cities = createClassMap("http://test/[email protected]@[email protected]@");
citiesTypeBridge = createPropertyBridge(cities, RDF.type.getURI());
citiesTypeBridge.setConstantValue(model.createResource("http://terms.example.org/City"));
citiesNameBridge = createPropertyBridge(cities, "http://terms.example.org/name");
citiesNameBridge.setColumn("c.name");
countries = createClassMap("http://test/countries/@@[email protected]@");
countries.setContainsDuplicates(true);
countriesTypeBridge = createPropertyBridge(countries, RDF.type.getURI());
countriesTypeBridge.setConstantValue(model.createResource("http://terms.example.org/Country"));
}
示例2: setUp
import de.fuberlin.wiwiss.d2rq.sql.DummyDB; //导入依赖的package包/类
public void setUp() {
db = new DummyDB();
projections1 = Collections.<ProjectionSpec>singleton(new Attribute(null, "table", "unique"));
projections2 = Collections.<ProjectionSpec>singleton(new Attribute(null, "table", "not_unique"));
unique = new RelationImpl(
db, AliasMap.NO_ALIASES, Expression.TRUE, Expression.TRUE,
Collections.<Join>emptySet(),
projections1, true, OrderSpec.NONE, Relation.NO_LIMIT, Relation.NO_LIMIT);
notUnique = new RelationImpl(
db, AliasMap.NO_ALIASES, Expression.TRUE, Expression.TRUE,
Collections.<Join>emptySet(),
projections2, false, OrderSpec.NONE, Relation.NO_LIMIT, Relation.NO_LIMIT);
}
示例3: connectToDummyDB
import de.fuberlin.wiwiss.d2rq.sql.DummyDB; //导入依赖的package包/类
public static void connectToDummyDB(Database db) {
db.useConnectedDB(new DummyDB());
}
示例4: setUp
import de.fuberlin.wiwiss.d2rq.sql.DummyDB; //导入依赖的package包/类
public void setUp() {
db = new DummyDB();
rel1 = Relation.createSimpleRelation(db,
new Attribute[]{new Attribute(null, "foo", "bar")});
}
示例5: testConstantToSQL
import de.fuberlin.wiwiss.d2rq.sql.DummyDB; //导入依赖的package包/类
public void testConstantToSQL() {
assertEquals("'foo'", new Constant("foo").toSQL(new DummyDB(), AliasMap.NO_ALIASES));
}
示例6: testConstantToSQLWithType
import de.fuberlin.wiwiss.d2rq.sql.DummyDB; //导入依赖的package包/类
public void testConstantToSQLWithType() {
Attribute attribute = SQL.parseAttribute("table.col1");
DummyDB db = new DummyDB(Collections.singletonMap("table.col1", GenericType.NUMERIC));
assertEquals("42", new Constant("42", attribute).toSQL(db, AliasMap.NO_ALIASES));
}
示例7: testConstantToSQLWithTypeAndAlias
import de.fuberlin.wiwiss.d2rq.sql.DummyDB; //导入依赖的package包/类
public void testConstantToSQLWithTypeAndAlias() {
Attribute aliasedAttribute = SQL.parseAttribute("alias.col1");
DummyDB db = new DummyDB(Collections.singletonMap("table.col1", GenericType.NUMERIC));
assertEquals("42", new Constant("42", aliasedAttribute).toSQL(db, aliases));
}