当前位置: 首页>>代码示例>>Java>>正文


Java Environment类代码示例

本文整理汇总了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();
   }
}
 
开发者ID:obidea,项目名称:semantika-r2rml-test,代码行数:22,代码来源:SemantikaR2RmlTest.java

示例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;
}
 
开发者ID:obidea,项目名称:semantika,代码行数:13,代码来源:ConnectionProviderFactory.java

示例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;
}
 
开发者ID:obidea,项目名称:semantika,代码行数:13,代码来源:ConnectionProviderFactory.java

示例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$
}
 
开发者ID:obidea,项目名称:semantika,代码行数:33,代码来源:JdbcConnectionProvider.java

示例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();
}
 
开发者ID:obidea,项目名称:semantika-example,代码行数:16,代码来源:EmployeeApp.java


注:本文中的com.obidea.semantika.app.Environment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。