Package org.ontoware.rdf2go.exception

Examples of org.ontoware.rdf2go.exception.ModelRuntimeException


      return this;
    }
    try {
      this.connection = this.repository.getConnection();
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
    return this;
  }
View Full Code Here


  @Override
  public boolean isOpen() throws ModelRuntimeException {
    try {
      return this.connection != null && this.connection.isOpen();
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

      if(isOpen()) {
        this.connection.close();
        this.connection = null;
      }
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

                  + " ) which could not be stored. Most likely cause: http://openrdf.org/issues/browse/SES-521");
        }
       
      }
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

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

 
  /* for performance reasons */
  @Override
  public void removeAll() throws ModelRuntimeException {
    if(this.isLocked()) {
      throw new ModelRuntimeException("Model is locked, cannot perform an update.");
    }
    // do not auto-commit
    assertModel();
    try {
      this.connection.begin();
      // remove all
      this.connection.clear(this.openRdfContext);
      this.connection.commit();
    } catch(RepositoryException x) {
      throw new ModelRuntimeException(x);
    }
   
  }
View Full Code Here

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

     
      // remove the statement
      this.connection.remove(openRdfSubject, openRdfPredicate, openRdfObject,
              this.openRdfContext);
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
     
    }
  }
View Full Code Here

              .getStatements(openRdfSubject, openRdfPredicate, openRdfObject, true,
                      this.openRdfContext);
      // wrap them in a StatementIterable
      return new StatementIterator(statements, this);
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

    try {
      boolean result = this.connection.prepareBooleanQuery(QueryLanguage.SPARQL, query)
              .evaluate();
      return result;
    } catch(MalformedQueryException e) {
      throw new ModelRuntimeException(e);
    } catch(UnsupportedQueryLanguageException e) {
      throw new ModelRuntimeException(e);
    } catch(QueryEvaluationException e) {
      throw new ModelRuntimeException(e);
    } catch(RepositoryException 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.