Tabnine Logo
SailConfigException
Code IndexAdd Tabnine to your IDE (free)

How to use
SailConfigException
in
org.openrdf.sail.config

Best Java code snippets using org.openrdf.sail.config.SailConfigException (Showing top 20 results out of 315)

origin: org.openrdf.sesame/sesame-sail-rdbms

@Override
public void validate()
  throws SailConfigException
{
  super.validate();
  if (url == null) {
    throw new SailConfigException("No URL specified for RdbmsStore");
  }
}
origin: org.openrdf.sesame/sesame-repository-sail

public Repository getRepository(RepositoryImplConfig config)
  throws RepositoryConfigException
{
  if (config instanceof SailRepositoryConfig) {
    SailRepositoryConfig sailRepConfig = (SailRepositoryConfig)config;
    try {
      Sail sail = createSailStack(sailRepConfig.getSailImplConfig());
      return new SailRepository(sail);
    }
    catch (SailConfigException e) {
      throw new RepositoryConfigException(e.getMessage(), e);
    }
  }
  throw new RepositoryConfigException("Invalid configuration class: " + config.getClass());
}
origin: org.openrdf.sesame/sesame-repository-sail

@Override
public void validate()
  throws RepositoryConfigException
{
  super.validate();
  if (sailImplConfig == null) {
    throw new RepositoryConfigException("No Sail implementation specified for Sail repository");
  }
  try {
    sailImplConfig.validate();
  }
  catch (SailConfigException e) {
    throw new RepositoryConfigException(e.getMessage(), e);
  }
}
origin: org.openrdf.alibaba/alibaba-sail-federation

@Override
public void validate() throws SailConfigException {
  super.validate();
  if (members.size() == 0) {
    throw new SailConfigException("No federation members specified");
  }
  for (RepositoryImplConfig member : members) {
    try {
      member.validate();
    } catch (RepositoryConfigException e) {
      throw new SailConfigException(e);
    }
  }
}
origin: org.openrdf.sesame/sesame-repository-sail

  @Override
  public void parse(Model model, Resource repImplNode)
    throws RepositoryConfigException
  {
    try {
      Optional<Resource> sailImplNode = Models.objectResource(model.filter(repImplNode, SAILIMPL, null));
      if (sailImplNode.isPresent()) {
        Models.objectLiteral(model.filter(sailImplNode.get(), SAILTYPE, null)).ifPresent(typeLit -> {
          SailFactory factory = SailRegistry.getInstance().get(typeLit.getLabel()).orElseThrow(
              () -> new RepositoryConfigException("Unsupported Sail type: " + typeLit.getLabel()));

          sailImplConfig = factory.getConfig();
          sailImplConfig.parse(model, sailImplNode.get());
        });
      }
    }
    catch (ModelException e) {
      throw new RepositoryConfigException(e.getMessage(), e);
    }
    catch (SailConfigException e) {
      throw new RepositoryConfigException(e.getMessage(), e);
    }
  }
}
origin: org.openrdf.sesame/sesame-sail-federation

@Override
public void validate()
  throws SailConfigException
{
  super.validate();
  if (members.isEmpty()) {
    throw new SailConfigException("No federation members specified");
  }
  for (RepositoryImplConfig member : members) {
    try {
      member.validate();
    }
    catch (RepositoryConfigException e) {
      throw new SailConfigException(e);
    }
  }
}
origin: blazegraph/database

  public Sail getSail(final SailImplConfig config)
    throws SailConfigException {
  
    if (!TYPE.equals(config.getType())) {
      throw new SailConfigException(
          "Invalid type: " + config.getType());
    }

    if (!(config instanceof BigdataSailConfig)) {
      throw new SailConfigException(
          "Invalid type: " + config.getClass());
    }
    
    try {
      
      final BigdataSailConfig bigdataConfig = (BigdataSailConfig)config;
      final Properties properties = bigdataConfig.getProperties();
      return new BigdataSail(properties);
      
    } catch (Exception ex) {
      throw new SailConfigException(ex);
    }
    
  }
}
origin: com.blazegraph/bigdata-core

  public Sail getSail(final SailImplConfig config)
    throws SailConfigException {
  
    if (!TYPE.equals(config.getType())) {
      throw new SailConfigException(
          "Invalid type: " + config.getType());
    }

    if (!(config instanceof BigdataSailConfig)) {
      throw new SailConfigException(
          "Invalid type: " + config.getClass());
    }
    
    try {
      
      final BigdataSailConfig bigdataConfig = (BigdataSailConfig)config;
      final Properties properties = bigdataConfig.getProperties();
      return new BigdataSail(properties);
      
    } catch (Exception ex) {
      throw new SailConfigException(ex);
    }
    
  }
}
origin: org.openrdf.sesame/sesame-sail-inferencer

  public Sail getSail(SailImplConfig config)
    throws SailConfigException
  {
    if (!SAIL_TYPE.equals(config.getType())) {
      throw new SailConfigException("Invalid Sail type: " + config.getType());
    }

    return new ForwardChainingRDFSInferencer();
  }
}
origin: org.openrdf.sesame/sesame-sail-inferencer

  public Sail getSail(SailImplConfig config)
    throws SailConfigException
  {
    if (!SAIL_TYPE.equals(config.getType())) {
      throw new SailConfigException("Invalid Sail type: " + config.getType());
    }

    return new DirectTypeHierarchyInferencer();
  }
}
origin: org.openrdf.sesame/sesame-sail-inferencer

@Override
public void validate()
  throws SailConfigException
{
  super.validate();
  if (null == language) {
    throw new SailConfigException("No query language specified for " + getType() + " Sail.");
  }
  if (null == ruleQuery) {
    throw new SailConfigException("No rule query specified for " + getType() + " Sail.");
  }
  else {
    try {
      QueryParserUtil.parseGraphQuery(language, ruleQuery, null);
    }
    catch (OpenRDFException e) {
      throw new SailConfigException("Problem occured parsing supplied rule query.", e);
    }
  }
  try {
    if (matcherQuery.trim().isEmpty()) {
      matcherQuery = buildMatcherQueryFromRuleQuery(language, ruleQuery);
    }
    QueryParserUtil.parseGraphQuery(language, matcherQuery, null);
  }
  catch (OpenRDFException e) {
    throw new SailConfigException("Problem occured parsing matcher query: " + matcherQuery, e);
  }
}
origin: org.openrdf.sesame/sesame-sail-inferencer

  @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();
  }
}
origin: blazegraph/database

  @Override
  public void parse(Graph graph, Resource implNode)
    throws SailConfigException
  {
    super.parse(graph, implNode);

    try {
      Literal propertiesLit = GraphUtil.getOptionalObjectLiteral(
          graph, implNode, BigdataConfigSchema.PROPERTIES);
      if (propertiesLit != null) {
        setPropertiesFile((propertiesLit).getLabel());
      } else {
        throw new SailConfigException("Properties file required");
      }
    }
    catch (GraphUtilException e) {
      throw new SailConfigException(e.getMessage(), e);
    }
  }
}
origin: com.blazegraph/bigdata-core

  @Override
  public void parse(Graph graph, Resource implNode)
    throws SailConfigException
  {
    super.parse(graph, implNode);

    try {
      Literal propertiesLit = GraphUtil.getOptionalObjectLiteral(
          graph, implNode, BigdataConfigSchema.PROPERTIES);
      if (propertiesLit != null) {
        setPropertiesFile((propertiesLit).getLabel());
      } else {
        throw new SailConfigException("Properties file required");
      }
    }
    catch (GraphUtilException e) {
      throw new SailConfigException(e.getMessage(), e);
    }
  }
}
origin: org.openrdf.sesame/sesame-sail-spin

  @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;
  }
}
origin: org.openrdf.sesame/sesame-sail-inferencer

  @Override
  public Sail getSail(SailImplConfig config)
    throws SailConfigException
  {
    if (!SAIL_TYPE.equals(config.getType())) {
      throw new SailConfigException("Invalid Sail type: " + config.getType());
    }
    CustomGraphQueryInferencer sail = new CustomGraphQueryInferencer();
    if (config instanceof CustomGraphQueryInferencerConfig) {
      CustomGraphQueryInferencerConfig customConfig = (CustomGraphQueryInferencerConfig)config;
      try {
        sail.setFields(customConfig.getQueryLanguage(), customConfig.getRuleQuery(),
            customConfig.getMatcherQuery());
      }
      catch (OpenRDFException e) {
        throw new SailConfigException("Problem occured parsing rule or matcher query text.", e);
      }
    }
    return sail;
  }
}
origin: org.openrdf.sesame/sesame-sail-spin

  @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);
    }
  }
}
origin: org.openrdf.sesame/sesame-sail-lucenesail

  @Override
  @Deprecated
  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;
  }
}
origin: org.openrdf.sesame/sesame-sail-rdbms

  public RdbmsStore getSail(SailImplConfig config)
    throws SailConfigException
  {
    if (!SAIL_TYPE.equals(config.getType())) {
      throw new SailConfigException("Invalid Sail type: " + config.getType());
    }

    if (config instanceof RdbmsStoreConfig) {
      RdbmsStoreConfig rdbmsConfig = (RdbmsStoreConfig)config;

      String jdbcDriver = rdbmsConfig.getJdbcDriver();
      String url = rdbmsConfig.getUrl();
      String user = rdbmsConfig.getUser();
      String password = rdbmsConfig.getPassword();

      RdbmsStore store = new RdbmsStore(jdbcDriver, url, user, password);

      store.setMaxNumberOfTripleTables(rdbmsConfig.getMaxTripleTables());

      return store;
    }

    throw new IllegalArgumentException("Supplied config objects should be an RdbmsStoreConfig, is: "
        + config.getClass());
  }
}
origin: org.openrdf.sesame/sesame-sail-federation

  public Sail getSail(SailImplConfig config)
    throws SailConfigException
  {
    if (!SAIL_TYPE.equals(config.getType())) {
      throw new SailConfigException("Invalid Sail type: " + config.getType());
    }
    assert config instanceof FederationConfig;
    FederationConfig cfg = (FederationConfig)config;
    Federation sail = new Federation();
    for (RepositoryImplConfig member : cfg.getMembers()) {
      RepositoryFactory factory = RepositoryRegistry.getInstance().get(member.getType()).orElseThrow(
          () -> new SailConfigException("Unsupported repository type: " + config.getType()));
      try {
        sail.addMember(factory.getRepository(member));
      }
      catch (RepositoryConfigException e) {
        throw new SailConfigException(e);
      }
    }
    sail.setLocalPropertySpace(cfg.getLocalPropertySpace());
    sail.setDistinct(cfg.isDistinct());
    sail.setReadOnly(cfg.isReadOnly());
    return sail;
  }
}
org.openrdf.sail.configSailConfigException

Javadoc

Exception indicating a sail configuration problem.

Most used methods

  • <init>
  • getMessage

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now