Package org.ontoware.rdf2go.exception

Examples of org.ontoware.rdf2go.exception.ModelRuntimeException


    com.hp.hpl.jena.rdf.model.Model jm = (com.hp.hpl.jena.rdf.model.Model)jenaModel
            .getUnderlyingModelImplementation();
    try {
      writeJenaModel(jm, w);
    } catch(IOException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here


        jm.write(osw, "RDF/XML", "");
      } else
        jm.write(new FileWriter(new File(filename)), format, "");
     
    } catch(FileNotFoundException e) {
      throw new ModelRuntimeException(e);
    } catch(IOException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

       
        // Add the statement to the model
        this.jenaModel.add(s, p, o);
      }
    } catch(BadURIException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

    assertModel();
    log.debug("Query " + queryString);
    Query query = QueryFactory.create(queryString);
   
    if(!query.isAskType()) {
      throw new ModelRuntimeException("The given query is not an ASK query");
    }
    // else
    QueryExecution qexec = QueryExecutionFactory.create(query, this.jenaModel);
    return qexec.execAsk();
  }
View Full Code Here

  public static Resource toResource(URL url) throws ModelRuntimeException {
    try {
      return new URIImpl(url.toURI().toString());
    } catch (URISyntaxException e) {
      throw new ModelRuntimeException(e);
    }
  }
View Full Code Here

    if (o instanceof URL)
      return toResource((URL) o);
    else if (o instanceof ResourceEntity)
      return toResource((ResourceEntity) o);
    else
      throw new ModelRuntimeException("Could not convert to an RDF2Go node, class: " + o.getClass());
  }
View Full Code Here

  private final QueryExecution qexec;
 
  public QueryResultTableImpl(Query query, Model jenaModel) throws ModelRuntimeException {
   
    if(!query.isSelectType()) {
      throw new ModelRuntimeException("The given query is not a SELECT query");
    }
    // else
    this.varnames = new ArrayList<String>();
    for(Object o : query.getResultVars()) {
      this.varnames.add((String)o);
View Full Code Here

  }

  public QueryResultTableImpl(Query query, Dataset jenaDataset) throws ModelRuntimeException {
   
    if(!query.isSelectType()) {
      throw new ModelRuntimeException("The given query is not a SELECT query");
    }
    // else
    this.varnames = new ArrayList<String>();
    for(Object o : query.getResultVars()) {
      this.varnames.add((String)o);
View Full Code Here

    this.qexec = QueryExecutionFactory.create(query, jenaDataset);
  }
 
  public QueryResultTableImpl(QueryExecution qe) {
    if(!qe.getQuery().isSelectType()) {
      throw new ModelRuntimeException("The given query execution is not a SELECT query");
    }
   
    this.varnames = new ArrayList<String>();
    for(Object o : qe.getQuery().getResultVars()) {
      this.varnames.add((String)o);
View Full Code Here

   
    if(backend.equalsIgnoreCase(MEMORY)) {
      model = com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel();
      assert model != null;
    } else if(backend.equalsIgnoreCase(DATABASE)) {
      throw new ModelRuntimeException(
              "This release of RDF2Go no longer supports Jena database backends. Use RDF2Go-Jena 2.6 or wait until we support SDB or TDB.");
      // gone: return ModelFactoryImpl_RDB.createModel(p);
    } else if(backend.equalsIgnoreCase(FILE)) {
      String filename = p.getProperty(FILENAME);
      if(filename == null) {
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.