Search in sources :

Example 1 with SailImplConfig

use of org.eclipse.rdf4j.sail.config.SailImplConfig in project Commons by denkbares.

the class ConfigurableFreeSailRepositoryFactory method overridePlugins.

/**
 * Here we override the parameter allowing us to deactivate plugins. Some of the plugins we just don't need, but in
 * case of the mongodb plugin, it messes up dependencies of certain other tools that already use a mongodb.
 * <p>
 * Unfortunately, there doesn't seem to be any other way than doing the overriding in this factory. You would
 * think, that you can set the plugin parameter using the grapdh configuration file des-defaults.ttl, but from that
 * file, only certain parameters are used.
 *
 * @since graphb-free-runtime:8.11
 */
protected void overridePlugins(MonitorRepositoryConfig monitorConfig) {
    SailImplConfig sailImplConfig = monitorConfig.getSailImplConfig();
    IRI disablePluginsIri = SimpleValueFactory.getInstance().createIRI("http://www.ontotext.com/trree/owlim#disable-plugins");
    ((OWLIMSailConfig) sailImplConfig).getConfigParams().put(disablePluginsIri, "mongodb,notifications,notifications-logger,rdfrank,expose-entity,utils");
    // The plugin "utils" uses the outdated javascript nashorn plugin, no longer present after Java 14.
    // We can deactivate it, but there still are several ugly exceptions in the log... we add a logging filter to
    // skip those messages, since they are irrelevant.
    Logger logger = LoggerFactory.getLogger(this.getClass());
    if (logger instanceof ch.qos.logback.classic.Logger) {
        LoggerContext context = ((ch.qos.logback.classic.Logger) logger).getLoggerContext();
        context.addTurboFilter(new TurboFilter() {

            @Override
            public FilterReply decide(Marker marker, ch.qos.logback.classic.Logger logger, Level level, String text, Object[] objects, Throwable throwable) {
                if (level != Level.ERROR)
                    return FilterReply.NEUTRAL;
                if ("Plugin 'utils' failed to initialize: jdk/nashorn/api/scripting/ClassFilter".equals(text)) {
                    return FilterReply.DENY;
                }
                return FilterReply.NEUTRAL;
            }
        });
    }
}
Also used : IRI(org.eclipse.rdf4j.model.IRI) Marker(org.slf4j.Marker) Logger(org.slf4j.Logger) LoggerContext(ch.qos.logback.classic.LoggerContext) SailImplConfig(org.eclipse.rdf4j.sail.config.SailImplConfig) FilterReply(ch.qos.logback.core.spi.FilterReply) Level(ch.qos.logback.classic.Level) TurboFilter(ch.qos.logback.classic.turbo.TurboFilter)

Example 2 with SailImplConfig

use of org.eclipse.rdf4j.sail.config.SailImplConfig in project Commons by denkbares.

the class RdfConfig method createRepositoryConfig.

@Override
public org.eclipse.rdf4j.repository.config.RepositoryConfig createRepositoryConfig(String repositoryId, String repositoryLabel, Map<String, String> overrides) throws RepositoryConfigException {
    // create a configuration for the SAIL stack
    SailImplConfig backendConfig = new MemoryStoreConfig();
    // create a configuration for the repository implementation
    RepositoryImplConfig repositoryTypeSpec = new SailRepositoryConfig(backendConfig);
    return new org.eclipse.rdf4j.repository.config.RepositoryConfig(repositoryId, repositoryTypeSpec);
}
Also used : SailImplConfig(org.eclipse.rdf4j.sail.config.SailImplConfig) SailRepositoryConfig(org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig) RepositoryImplConfig(org.eclipse.rdf4j.repository.config.RepositoryImplConfig) MemoryStoreConfig(org.eclipse.rdf4j.sail.memory.config.MemoryStoreConfig) SailRepositoryConfig(org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig)

Example 3 with SailImplConfig

use of org.eclipse.rdf4j.sail.config.SailImplConfig in project Commons by denkbares.

the class RdfFSConfig method createRepositoryConfig.

@Override
public org.eclipse.rdf4j.repository.config.RepositoryConfig createRepositoryConfig(String repositoryId, String repositoryLabel, Map<String, String> overrides) throws RepositoryConfigException {
    // create a configuration for the SAIL stack
    SailImplConfig backendConfig = new NativeStoreConfig();
    // create a configuration for the repository implementation
    RepositoryImplConfig repositoryTypeSpec = new SailRepositoryConfig(backendConfig);
    return new org.eclipse.rdf4j.repository.config.RepositoryConfig(repositoryId, repositoryTypeSpec);
}
Also used : SailImplConfig(org.eclipse.rdf4j.sail.config.SailImplConfig) SailRepositoryConfig(org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig) NativeStoreConfig(org.eclipse.rdf4j.sail.nativerdf.config.NativeStoreConfig) RepositoryImplConfig(org.eclipse.rdf4j.repository.config.RepositoryImplConfig) SailRepositoryConfig(org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig)

Example 4 with SailImplConfig

use of org.eclipse.rdf4j.sail.config.SailImplConfig in project Commons by denkbares.

the class RdfsConfig method createRepositoryConfig.

@Override
public org.eclipse.rdf4j.repository.config.RepositoryConfig createRepositoryConfig(String repositoryId, String repositoryLabel, Map<String, String> overrides) throws RepositoryConfigException {
    // create a configuration for the SAIL stack
    SailImplConfig backendConfig = new MemoryStoreConfig();
    // create a configuration for the repository implementation
    SailRepositoryConfig repositoryTypeSpec = new SailRepositoryConfig(new ForwardChainingRDFSInferencerConfig(backendConfig));
    return new org.eclipse.rdf4j.repository.config.RepositoryConfig(repositoryId, repositoryTypeSpec);
}
Also used : SailImplConfig(org.eclipse.rdf4j.sail.config.SailImplConfig) SailRepositoryConfig(org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig) ForwardChainingRDFSInferencerConfig(org.eclipse.rdf4j.sail.inferencer.fc.config.ForwardChainingRDFSInferencerConfig) MemoryStoreConfig(org.eclipse.rdf4j.sail.memory.config.MemoryStoreConfig) SailRepositoryConfig(org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig)

Example 5 with SailImplConfig

use of org.eclipse.rdf4j.sail.config.SailImplConfig in project Commons by denkbares.

the class SpinRdfConfig method createRepositoryConfig.

@Override
public org.eclipse.rdf4j.repository.config.RepositoryConfig createRepositoryConfig(String repositoryId, String repositoryLabel, Map<String, String> overrides) throws RepositoryConfigException {
    SailImplConfig spinSailConfig = new SpinSailConfig(new MemoryStoreConfig());
    RepositoryImplConfig repositoryTypeSpec = new SailRepositoryConfig(spinSailConfig);
    return new org.eclipse.rdf4j.repository.config.RepositoryConfig(repositoryId, repositoryTypeSpec);
}
Also used : SailImplConfig(org.eclipse.rdf4j.sail.config.SailImplConfig) SailRepositoryConfig(org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig) RepositoryImplConfig(org.eclipse.rdf4j.repository.config.RepositoryImplConfig) MemoryStoreConfig(org.eclipse.rdf4j.sail.memory.config.MemoryStoreConfig) SpinSailConfig(org.eclipse.rdf4j.sail.spin.config.SpinSailConfig) SailRepositoryConfig(org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig)

Aggregations

SailImplConfig (org.eclipse.rdf4j.sail.config.SailImplConfig)9 SailRepositoryConfig (org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig)8 MemoryStoreConfig (org.eclipse.rdf4j.sail.memory.config.MemoryStoreConfig)5 RepositoryImplConfig (org.eclipse.rdf4j.repository.config.RepositoryImplConfig)3 NativeStoreConfig (org.eclipse.rdf4j.sail.nativerdf.config.NativeStoreConfig)3 SpinSailConfig (org.eclipse.rdf4j.sail.spin.config.SpinSailConfig)3 RepositoryConfig (org.eclipse.rdf4j.repository.config.RepositoryConfig)2 SchemaCachingRDFSInferencerConfig (org.eclipse.rdf4j.sail.inferencer.fc.config.SchemaCachingRDFSInferencerConfig)2 Level (ch.qos.logback.classic.Level)1 LoggerContext (ch.qos.logback.classic.LoggerContext)1 TurboFilter (ch.qos.logback.classic.turbo.TurboFilter)1 FilterReply (ch.qos.logback.core.spi.FilterReply)1 File (java.io.File)1 URI (java.net.URI)1 IRI (org.eclipse.rdf4j.model.IRI)1 RepositoryManager (org.eclipse.rdf4j.repository.manager.RepositoryManager)1 DedupingInferencerConfig (org.eclipse.rdf4j.sail.inferencer.fc.config.DedupingInferencerConfig)1 ForwardChainingRDFSInferencerConfig (org.eclipse.rdf4j.sail.inferencer.fc.config.ForwardChainingRDFSInferencerConfig)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 Test (org.junit.jupiter.api.Test)1