當前位置: 首頁>>代碼示例>>Java>>正文


Java SailConfigException類代碼示例

本文整理匯總了Java中org.eclipse.rdf4j.sail.config.SailConfigException的典型用法代碼示例。如果您正苦於以下問題:Java SailConfigException類的具體用法?Java SailConfigException怎麽用?Java SailConfigException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SailConfigException類屬於org.eclipse.rdf4j.sail.config包,在下文中一共展示了SailConfigException類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getSail

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
@Override
public Sail getSail(SailImplConfig config) throws SailConfigException	{
	
	if (!SAIL_TYPE.equals(config.getType())) {
		throw new SailConfigException("Invalid Sail type: " + config.getType());
	}
	
	if (!(config instanceof FedXSailConfig)) {
		throw new SailConfigException("FedXSail config expected, was " + config.getClass().getCanonicalName());
	}	
	
	FedXSailConfig fedXSailConfig = (FedXSailConfig)config;
	String fedxConfig = fedXSailConfig.getFedxConfig();
	
	if (fedxConfig==null)
		throw new SailConfigException("FedX Sail Configuration must not be null");
	
	try	{
		return FedXFactory.initializeFederation(fedxConfig, new DefaultEndpointListProvider(Collections.<String>emptyList())).getSail();
	} catch (FedXException e) {
		throw new SailConfigException(e);
	}
}
 
開發者ID:dice-group,項目名稱:CostFed,代碼行數:24,代碼來源:FedXSailFactory.java

示例2: parseConfig

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
private Model parseConfig(File file) throws SailConfigException, IOException
{
    RDFFormat format = Rio.getParserFormatForFileName(file.getAbsolutePath()).get();
    if (format==null)
        throw new SailConfigException("Unsupported file format: " + file.getAbsolutePath());
    RDFParser parser = Rio.createParser(format);
    Model model = new LinkedHashModel();
    parser.setRDFHandler(new StatementCollector(model));
    InputStream stream = new FileInputStream(file);

    try {
        parser.parse(stream, file.getAbsolutePath());
    } catch (Exception e) {
        throw new SailConfigException("Error parsing file!");
    }

    stream.close();
    return model;
}
 
開發者ID:semagrow,項目名稱:semagrow,代碼行數:20,代碼來源:SemagrowRepositoryResolver.java

示例3: parse

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
@Override
public void parse(Model graph, Resource node) throws RepositoryConfigException {

    try {
        Optional<Resource> sailImplNode = Models.objectResource(graph.filter(node, SAILIMPL,null));

        if (sailImplNode.isPresent()) {

                sailConfig  = new SemagrowSailConfig();
                sailConfig.parse(graph, sailImplNode.get());
        }
    }
    catch (SailConfigException e) {
        throw new RepositoryConfigException(e.getMessage(), e);
    }
}
 
開發者ID:semagrow,項目名稱:semagrow,代碼行數:17,代碼來源:SemagrowRepositoryConfig.java

示例4: validate

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
@Override
public void validate() throws RepositoryConfigException {
    super.validate();
    if (configFileName == null || !new File(configFileName).exists()) {
        throw new SailConfigException("No valid config file name specified for CostFed repository");
    }
}
 
開發者ID:dice-group,項目名稱:CostFed,代碼行數:8,代碼來源:CostFedRepositoryFactory.java

示例5: getSail

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
@Override
public Sail getSail(SailImplConfig config) throws SailConfigException {
    if (!SAIL_TYPE.equals(config.getType())) {
        throw new SailConfigException("Invalid Sail type: " + config.getType());
    }
    if (config instanceof HBaseSailConfig) {
        HBaseSailConfig hconfig = (HBaseSailConfig) config;
        //instantiate the sail
        HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null);
        return sail;
    } else {
        throw new SailConfigException("Invalid configuration: " + config);
    }
}
 
開發者ID:Merck,項目名稱:Halyard,代碼行數:15,代碼來源:HBaseSailFactory.java

示例6: testSplitbitsFail

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
@Test(expected = SailConfigException.class)
public void testSplitbitsFail() throws Exception {
    TreeModel g = new TreeModel();
    g.add(SimpleValueFactory.getInstance().createIRI("http://node"), HALYARD.SPLITBITS_PROPERTY, SimpleValueFactory.getInstance().createLiteral("not a number"));
    HBaseSailConfig cfg = new HBaseSailConfig();
    cfg.parse(g, null);
}
 
開發者ID:Merck,項目名稱:Halyard,代碼行數:8,代碼來源:HBaseSailConfigTest.java

示例7: testCreateTableFail

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
@Test(expected = SailConfigException.class)
public void testCreateTableFail() throws Exception {
    TreeModel g = new TreeModel();
    g.add(SimpleValueFactory.getInstance().createIRI("http://node"), HALYARD.CREATE_TABLE_PROPERTY, SimpleValueFactory.getInstance().createLiteral("not a boolean"));
    HBaseSailConfig cfg = new HBaseSailConfig();
    cfg.parse(g, null);
}
 
開發者ID:Merck,項目名稱:Halyard,代碼行數:8,代碼來源:HBaseSailConfigTest.java

示例8: testPushStrategyFail

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
@Test(expected = SailConfigException.class)
public void testPushStrategyFail() throws Exception {
    TreeModel g = new TreeModel();
    g.add(SimpleValueFactory.getInstance().createIRI("http://node"), HALYARD.PUSH_STRATEGY_PROPERTY, SimpleValueFactory.getInstance().createLiteral("not a boolean"));
    HBaseSailConfig cfg = new HBaseSailConfig();
    cfg.parse(g, null);
}
 
開發者ID:Merck,項目名稱:Halyard,代碼行數:8,代碼來源:HBaseSailConfigTest.java

示例9: testTimeoutFail

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
@Test(expected = SailConfigException.class)
public void testTimeoutFail() throws Exception {
    TreeModel g = new TreeModel();
    g.add(SimpleValueFactory.getInstance().createIRI("http://node"), HALYARD.EVALUATION_TIMEOUT_PROPERTY, SimpleValueFactory.getInstance().createLiteral("not a number"));
    HBaseSailConfig cfg = new HBaseSailConfig();
    cfg.parse(g, null);
}
 
開發者ID:Merck,項目名稱:Halyard,代碼行數:8,代碼來源:HBaseSailConfigTest.java

示例10: getSail

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
public Sail getSail(SailImplConfig sailImplConfig) throws SailConfigException {
    return new VOIDInferencer();
}
 
開發者ID:semagrow,項目名稱:semagrow,代碼行數:4,代碼來源:VOIDInferencerFactory.java

示例11: getSail

import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
public Sail getSail(SailImplConfig sailImplConfig) throws SailConfigException {
    return new SEVODInferencer();
}
 
開發者ID:semagrow,項目名稱:semagrow,代碼行數:4,代碼來源:SEVODInferencerFactory.java


注:本文中的org.eclipse.rdf4j.sail.config.SailConfigException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。