Package org.ontoware.rdf2go.exception

Examples of org.ontoware.rdf2go.exception.ModelRuntimeException


      if(c != null)
        this.connection.remove(s, p, o, c);
      else
        this.connection.remove(s, p, o);
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here


  @Deprecated
  public void setAutocommit(boolean autocommit) {
    try {
      this.connection.setAutoCommit(autocommit);
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

  public void setNamespace(String prefix, String namespaceURI) throws IllegalArgumentException {
    this.assertModel();
    try {
      this.connection.setNamespace(prefix, namespaceURI);
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

  public long size() throws ModelRuntimeException {
    this.assertModel();
    try {
      return this.connection.size();
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

    try {
      booleanQuery = this.connection.prepareBooleanQuery(QueryLanguage.SPARQL, queryString);
      boolean result = booleanQuery.evaluate();
      return result;
    } catch(OpenRDFException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

    try {
      query = this.connection.prepareGraphQuery(QueryLanguage.SPARQL, queryString);
      GraphQueryResult graphQueryResult = query.evaluate();
      return new StatementIterable(graphQueryResult, null);
    } catch(OpenRDFException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

    try {
      query = this.connection.prepareGraphQuery(QueryLanguage.SPARQL, queryString);
      GraphQueryResult graphQueryResult = query.evaluate();
      return new StatementIterable(graphQueryResult, null);
    } catch(OpenRDFException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

  }
 
  @Override
  public void update(DiffReader diff) throws ModelRuntimeException {
    if(this.isLocked()) {
      throw new ModelRuntimeException("ModelSet is locked, cannot perform an update.");
    }
    // do not auto-commit
    this.assertModel();
    try {
      this.connection.begin();
      try {
        try {
          // remove
          Iterator<? extends Statement> it = diff.getRemoved().iterator();
          while(it.hasNext()) {
            org.openrdf.model.Statement s = ConversionUtil.toOpenRDF(it.next(),
                    this.valueFactory);
            this.connection.remove(s, s.getContext());
          }
          // add
          it = diff.getAdded().iterator();
          while(it.hasNext()) {
            org.openrdf.model.Statement s = ConversionUtil.toOpenRDF(it.next(),
                    this.valueFactory);
            this.connection.add(s, s.getContext());
          }
          this.connection.commit();
        } catch(RepositoryException x) {
          this.connection.rollback();
        }
      } finally {
        this.connection.commit();
      }
    } catch(RepositoryException x) {
      throw new ModelRuntimeException(x);
    }
  }
View Full Code Here

   * same as model.assetModel()
   *
   */
  protected void assertModel() {
    if(this.repository == null) {
      throw new ModelRuntimeException("Repository is null");
    }
    if(this.connection == null) {
      throw new ModelRuntimeException("Connection is null");
    }
  }
View Full Code Here

  private void writeTo(RDFWriter writer) throws ModelRuntimeException {
    this.assertModel();
    try {
      this.connection.export(writer);
    } catch(OpenRDFException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.ontoware.rdf2go.exception.ModelRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.