public void validate() throws SailConfigException { if (type == null) { throw new SailConfigException("No type specified for sail implementation"); } }
public void validate() throws SailConfigException { if (type == null) { throw new SailConfigException("No type specified for sail implementation"); } }
public EvaluationStrategyFactory getEvaluationStrategyFactory() throws SailConfigException { if (evalStratFactoryClassName == null) { return null; } try { return (EvaluationStrategyFactory)Thread.currentThread().getContextClassLoader().loadClass( evalStratFactoryClassName).newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new SailConfigException(e); } }
public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } return new ForwardChainingRDFSInferencer(); } }
@Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } return new DedupingInferencer(); } }
public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } return new DirectTypeHierarchyInferencer(); } }
@Override public void validate() throws SailConfigException { super.validate(); if (delegate == null) { throw new SailConfigException("No delegate specified for " + getType() + " Sail"); } delegate.validate(); }
@Override public void validate() throws SailConfigException { super.validate(); if (delegate == null) { throw new SailConfigException("No delegate specified for " + getType() + " Sail"); } delegate.validate(); }
@Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } SpinSail spinSail = new SpinSail(); if (config instanceof SpinSailConfig) { spinSail.setAxiomClosureNeeded(((SpinSailConfig)config).isAxiomClosureNeeded()); } return spinSail; } }
@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); } }
@Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } SpinSail spinSail = new SpinSail(); if (config instanceof SpinSailConfig) { spinSail.setAxiomClosureNeeded(((SpinSailConfig)config).isAxiomClosureNeeded()); } return spinSail; } }
@Override public void parse(Model m, Resource implNode) throws SailConfigException { super.parse(m, implNode); try { Models.objectResource(m.filter(implNode, DELEGATE, null)).ifPresent( delegate -> setDelegate(SailConfigUtil.parseRepositoryImpl(m, delegate))); } catch (ModelException e) { throw new SailConfigException(e.getMessage(), e); } } }
@Override public void parse(Model m, Resource implNode) throws SailConfigException { super.parse(m, implNode); try { Models.objectResource(m.filter(implNode, DELEGATE, null)).ifPresent( delegate -> setDelegate(SailConfigUtil.parseRepositoryImpl(m, delegate))); } catch (ModelException e) { throw new SailConfigException(e.getMessage(), e); } } }
@Override public void parse(Model m, Resource implNode) throws SailConfigException { super.parse(m, implNode); try { Models.objectLiteral(m.filter(implNode, SpinSailSchema.AXIOM_CLOSURE_NEEDED, null)).ifPresent( lit -> setAxiomClosureNeeded(lit.booleanValue())); } catch (ModelException e) { throw new SailConfigException(e.getMessage(), e); } } }
@Override public void parse(Model m, Resource implNode) throws SailConfigException { super.parse(m, implNode); try { Models.objectLiteral(m.filter(implNode, SpinSailSchema.AXIOM_CLOSURE_NEEDED, null)).ifPresent( lit -> setAxiomClosureNeeded(lit.booleanValue())); } catch (ModelException e) { throw new SailConfigException(e.getMessage(), e); } } }
@Override public void parse(Model graph, Resource implNode) throws SailConfigException { super.parse(graph, implNode); try { Models.objectLiteral(graph.filter(implNode, EVALUATION_STRATEGY_FACTORY, null)).ifPresent( factoryClassName -> { setEvaluationStrategyFactoryClassName(factoryClassName.stringValue()); }); } catch (ModelException e) { throw new SailConfigException(e.getMessage(), e); } } }
@Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } LuceneSail luceneSail = new LuceneSail(); luceneSail.setParameter(LuceneSail.INDEX_CLASS_KEY, LuceneIndex.class.getName()); if (config instanceof AbstractLuceneSailConfig) { AbstractLuceneSailConfig luceneConfig = (AbstractLuceneSailConfig)config; luceneSail.setParameter(LuceneSail.LUCENE_DIR_KEY, luceneConfig.getIndexDir()); for (String key : luceneConfig.getParameterNames()) { luceneSail.setParameter(key, luceneConfig.getParameter(key)); } } return luceneSail; } }
public void parse(Model m, Resource implNode) throws SailConfigException { try { Models.objectLiteral(m.filter(implNode, SAILTYPE, null)).ifPresent( lit -> setType(lit.getLabel())); Models.objectLiteral( m.filter(implNode, SailConfigSchema.ITERATION_CACHE_SYNC_THRESHOLD, null)).ifPresent( lit -> setIterationCacheSyncThreshold(lit.longValue())); Models.objectLiteral( m.filter(implNode, SailConfigSchema.CONNECTION_TIME_OUT, null)).ifPresent( lit -> setConnectionTimeOut(lit.longValue())); } catch (ModelException e) { throw new SailConfigException(e.getMessage(), e); } }
public void parse(Model m, Resource implNode) throws SailConfigException { try { Models.objectLiteral(m.filter(implNode, SAILTYPE, null)).ifPresent( lit -> setType(lit.getLabel())); Models.objectLiteral( m.filter(implNode, SailConfigSchema.ITERATION_CACHE_SYNC_THRESHOLD, null)).ifPresent( lit -> setIterationCacheSyncThreshold(lit.longValue())); Models.objectLiteral( m.filter(implNode, SailConfigSchema.CONNECTION_TIME_OUT, null)).ifPresent( lit -> setConnectionTimeOut(lit.longValue())); } catch (ModelException e) { throw new SailConfigException(e.getMessage(), e); } }
@Override public void parse(Model graph, Resource implNode) throws SailConfigException { super.parse(graph, implNode); Literal indexDirLit = Models.objectLiteral(graph.filter(implNode, INDEX_DIR, null)).orElseThrow( () -> new SailConfigException("no value found for " + INDEX_DIR)); setIndexDir(indexDirLit.getLabel()); for (Statement stmt : graph.filter(implNode, null, null)) { if (stmt.getPredicate().getNamespace().equals(LuceneSailConfigSchema.NAMESPACE)) { if (stmt.getObject() instanceof Literal) { String key = stmt.getPredicate().getLocalName(); setParameter(key, stmt.getObject().stringValue()); } } } } }