@Override public void validate() throws SailConfigException { super.validate(); if (delegate == null) { throw new SailConfigException("No delegate specified for " + getType() + " Sail"); } delegate.validate(); }
/** * Create a new RepositoryConfigImpl. */ public AbstractSailImplConfig(String type) { this(); setType(type); }
public void validate() throws SailConfigException { if (type == null) { throw new SailConfigException("No type specified for sail implementation"); } }
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 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); } } }
private Sail createSail(SailImplConfig config) throws RepositoryConfigException, SailConfigException { SailFactory sailFactory = SailRegistry.getInstance().get(config.getType()).orElseThrow( () -> new RepositoryConfigException("Unsupported Sail type: " + config.getType())); return sailFactory.getSail(config); }
@Override public void validate() throws SailConfigException { super.validate(); }
/** * Create a new RepositoryConfigImpl. */ public AbstractDelegatingSailImplConfig(String type, SailImplConfig delegate) { this(type); setDelegate(delegate); }
@Override protected String getKey(SailFactory factory) { return factory.getSailType(); } }
private Sail createSailStack(SailImplConfig config) throws RepositoryConfigException, SailConfigException { Sail sail = createSail(config); if (config instanceof DelegatingSailImplConfig) { SailImplConfig delegateConfig = ((DelegatingSailImplConfig)config).getDelegate(); if (delegateConfig != null) { addDelegate(delegateConfig, sail); } } return sail; }
@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(); } }
@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 validate() throws SailConfigException { super.validate(); if (delegate == null) { throw new SailConfigException("No delegate specified for " + getType() + " Sail"); } delegate.validate(); }
public void validate() throws SailConfigException { if (type == null) { throw new SailConfigException("No type specified for sail implementation"); } }
/** * Create a new RepositoryConfigImpl. */ public AbstractSailImplConfig(String type) { this(); setType(type); }
/** * Create a new RepositoryConfigImpl. */ public AbstractDelegatingSailImplConfig(String type, SailImplConfig delegate) { this(type); setDelegate(delegate); }
@Override protected String getKey(SailFactory factory) { return factory.getSailType(); } }
public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } return new DirectTypeHierarchyInferencer(); } }