Package org.ontoware.rdf2go.exception

Examples of org.ontoware.rdf2go.exception.ModelRuntimeException


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


  }
 
  @Override
  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

  }
 
  @Override
  public synchronized void update(DiffReader diff) 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
          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, this.openRdfContext);
          }
          // add
          it = diff.getAdded().iterator();
          while(it.hasNext()) {
            org.openrdf.model.Statement s = ConversionUtil.toOpenRDF(it.next(),
                    this.valueFactory);
            this.connection.add(s, this.openRdfContext);
          }
          this.connection.commit();
        } catch(RepositoryException x) {
          this.logger.warn("Could not commit, rolling back.", x);
          this.connection.rollback();
        }
      } finally {
        this.connection.commit();
      }
    } catch(RepositoryException x) {
      throw new ModelRuntimeException(x);
    }
   
  }
View Full Code Here

  public String getNamespace(String prefix) {
    assertModel();
    try {
      return this.connection.getNamespace(prefix);
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

      for(Namespace openrdfNamespace : openrdfList) {
        nsMap.put(openrdfNamespace.getPrefix(), openrdfNamespace.getName());
      }
      return nsMap;
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

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

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

      writeNode(subject);
      writeNode(predicate);
      writeNode(object);
      this.writer.write("    </triple>\n");
    } catch(IOException e) {
      throw new ModelRuntimeException(e);
    }
   
  }
View Full Code Here

      throws ModelRuntimeException {

    this.resultTable = m.sparqlSelect(sparqlSelectQuery);

    if (!sparqlSelectQuery.contains("SELECT")) {
      throw new ModelRuntimeException("The given query is not a SELECT query");
    }
    // else
    this.m = m;
    this.returnTypes = returnTypes;
  }
View Full Code Here

    public String serialize(Syntax syntax) throws SyntaxNotSupportedException {
    StringWriter sw = new StringWriter();
    try {
      this.writeTo(sw, syntax);
    } catch (IOException e) {
      throw new ModelRuntimeException(e);
    }
    return sw.getBuffer().toString();
  }
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.