Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.Query


  @Override
  public ClosableIterable<Statement> queryConstruct(String query,
      String querylanguage) throws QueryLanguageNotSupportedException,
      MalformedQueryException, ModelRuntimeException {

    Query jenaQuery = QueryFactory.create(query);
    QueryExecution qexec = QueryExecutionFactory.create(jenaQuery,
        this.dataset);

    if (jenaQuery.isConstructType()) {
      com.hp.hpl.jena.rdf.model.Model m = qexec.execConstruct();
      Model resultModel = new ModelImplJena(null, m, Reasoning.none);
      resultModel.open();
      return resultModel;
    } else {
View Full Code Here


    if (syntax == null) {
      // delegate to super
      throw new QueryLanguageNotSupportedException(
          "Unsupported query language: " + querylanguage);
    }
    Query jenaQuery = QueryFactory.create(query, syntax);
    return new QueryResultTableImpl(jenaQuery,
        this.dataset);
  }
View Full Code Here

  }

  @Override
  public ClosableIterable<Statement> sparqlConstruct(String query)
      throws ModelRuntimeException, MalformedQueryException {
    Query jenaQuery = QueryFactory.create(query);
    QueryExecution qexec = QueryExecutionFactory.create(jenaQuery,
        this.dataset);

    if (jenaQuery.isConstructType()) {
      com.hp.hpl.jena.rdf.model.Model m = qexec.execConstruct();
      Model resultModel = new ModelImplJena(null, m, Reasoning.none);
      resultModel.open();
      return resultModel;
    } else {
View Full Code Here

  }

  @Override
  public ClosableIterable<Statement> sparqlDescribe(String query)
      throws ModelRuntimeException {
    Query jenaQuery = QueryFactory.create(query);
    QueryExecution qexec = QueryExecutionFactory.create(jenaQuery,
        this.dataset);

    if (jenaQuery.isDescribeType()) {
      com.hp.hpl.jena.rdf.model.Model m = qexec.execDescribe();
      Model resultModel = new ModelImplJena(null, m, Reasoning.none);
      resultModel.open();
      return resultModel;
    } else {
View Full Code Here

  }

  @Override
  public QueryResultTable sparqlSelect(String queryString)
      throws MalformedQueryException, ModelRuntimeException {
    Query jenaQuery = QueryFactory.create(queryString);
    return new QueryResultTableImpl(jenaQuery,
        this.dataset);
  }
View Full Code Here

  }

  @Override
  public boolean sparqlAsk(String query) throws ModelRuntimeException,
      MalformedQueryException {
    Query jenaQuery = QueryFactory.create(query);
    QueryExecution qexec = QueryExecutionFactory.create(jenaQuery,
        this.dataset);

    if (jenaQuery.isAskType()) {
      return qexec.execAsk();
    } else {
      throw new RuntimeException(
          "Cannot handle this type of query! Please use ASK.");
    }
View Full Code Here

      "WHERE {" +
      "      ?person a foaf:Person . " +
      "      ?person ?property ?object . " +
      "      }";

    Query query = QueryFactory.create(queryString);   
   
    // Execute the query and obtain results
    QueryExecution qe = QueryExecutionFactory.create(query, model);
    ResultSet results = qe.execSelect();
View Full Code Here

//    protected UpdateSink getUpdateSink() { return sink ; }
    public void setUpdateSink(UpdateSink sink)
    {
        this.sink = sink ;
        this.query = new Query() ;
        setPrologue(sink.getPrologue()) ;
    }
View Full Code Here

        query = newSubQuery(getPrologue()) ;
    }
   
    protected Query newSubQuery(Prologue progloue)
    {
        return new Query(getPrologue());
    }
View Full Code Here

        query = stack.pop();
    }
   
    protected Query endSubSelect(int line, int column)
    {
        Query subQuery = query ;
        if ( ! subQuery.isSelectType() )
            throwParseException("Subquery not a SELECT query", line, column) ;
        popQuery();
        return subQuery ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.query.Query

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.