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