本文整理匯總了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);
}
}
示例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;
}
示例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);
}
}
示例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");
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例10: getSail
import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
public Sail getSail(SailImplConfig sailImplConfig) throws SailConfigException {
return new VOIDInferencer();
}
示例11: getSail
import org.eclipse.rdf4j.sail.config.SailConfigException; //導入依賴的package包/類
public Sail getSail(SailImplConfig sailImplConfig) throws SailConfigException {
return new SEVODInferencer();
}