本文整理汇总了Java中com.obidea.semantika.app.Environment类的典型用法代码示例。如果您正苦于以下问题:Java Environment类的具体用法?Java Environment怎么用?Java Environment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Environment类属于com.obidea.semantika.app包,在下文中一共展示了Environment类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runProcessor
import com.obidea.semantika.app.Environment; //导入依赖的package包/类
@Override
protected void runProcessor() throws Exception
{
ApplicationManager appManager = new ApplicationFactory()
.setName("r2rml-test")
.addProperty(Environment.CONNECTION_URL, getJdbcUrl())
.addProperty(Environment.CONNECTION_DRIVER, getJdbcDriver())
.addProperty(Environment.CONNECTION_USERNAME, getDbUser())
.addProperty(Environment.CONNECTION_PASSWORD, getDbPassword())
.addMappingSource(getMappingFile(), false)
.createApplicationManager();
try {
mMaterializerEngine = appManager.createMaterializerEngine().useNTriples();
mMaterializerEngine.start();
mMaterializerEngine.materialize(new File(sExportFile));
}
finally {
mMaterializerEngine.stop();
}
}
示例2: createConnectionProvider
import com.obidea.semantika.app.Environment; //导入依赖的package包/类
public static IConnectionProvider createConnectionProvider(Properties properties) throws ConfigurationException
{
IConnectionProvider provider;
if (!StringUtils.isEmpty(properties.getProperty(Environment.POOL_MAX_SIZE))) {
provider = new PooledConnectionProvider();
}
else {
provider = new JdbcConnectionProvider();
}
provider.configure(properties);
return provider;
}
示例3: getConnectionProperties
import com.obidea.semantika.app.Environment; //导入依赖的package包/类
public static Properties getConnectionProperties(PropertiesConfiguration properties)
{
Properties toReturn = new Properties();
Iterator<String> iter = properties.getKeys();
while (iter.hasNext()) {
String propKey = iter.next();
if (propKey.contains(Environment.CONNECTION_PREFIX)) {
toReturn.setProperty(propKey, properties.getString(propKey));
}
}
return toReturn;
}
示例4: configure
import com.obidea.semantika.app.Environment; //导入依赖的package包/类
@Override
public void configure(Properties properties) throws ConfigurationException
{
String driverClass = properties.getProperty(Environment.CONNECTION_DRIVER);
if (StringUtils.isEmpty(driverClass)) {
throw new ConfigurationException("JDBC driver is not specified in the configuration file."); //$NON-NLS-1$
}
try {
Class.forName(driverClass);
}
catch (ClassNotFoundException e) {
throw new ConfigurationException("JDBC driver class not found.", e); //$NON-NLS-1$
}
mUrl = properties.getProperty(Environment.CONNECTION_URL);
if (StringUtils.isEmpty(mUrl)) {
throw new ConfigurationException("JDBC URL is not specified in the configuration file."); //$NON-NLS-1$
}
mUser = properties.getProperty(Environment.CONNECTION_USERNAME);
if (StringUtils.isEmpty(mUser)) {
throw new ConfigurationException("JDBC user is not specified in the configuration file."); //$NON-NLS-1$
}
mPassword = properties.getProperty(Environment.CONNECTION_PASSWORD);
if (StringUtils.isEmpty(mPassword)) {
LOG.warn("An empty password is being used."); //$NON-NLS-1$
}
LOG.debug("Configuring {} mode.", getName()); //$NON-NLS-1$
}
示例5: initialize
import com.obidea.semantika.app.Environment; //导入依赖的package包/类
private static void initialize() throws Exception
{
ApplicationManager appManager = new ApplicationFactory()
.setName("empdb-app")
.addProperty(Environment.CONNECTION_URL, "jdbc:h2:tcp://localhost/data/empdb")
.addProperty(Environment.CONNECTION_DRIVER, "org.h2.Driver")
.addProperty(Environment.CONNECTION_USERNAME, "sa")
.addProperty(Environment.CONNECTION_PASSWORD, "")
.setOntologySource("model/empdb.owl")
.addMappingSource("model/empdb.mod.xml")
.createApplicationManager();
// Create the query engine
mQueryEngine = appManager.createQueryEngine();
}