Examples of execConstruct()


Examples of com.hp.hpl.jena.query.QueryExecution.execConstruct()

        QueryExecution qExec = makeQExec("CONSTRUCT {?s ?p ?z} {?s ?p 'x1'}") ;
        QuerySolutionMap init = new QuerySolutionMap() ;
        init.add("z", m.createLiteral("zzz"));
       
        qExec.setInitialBinding(init) ;
        Model r = qExec.execConstruct() ;
   
        assertTrue("Empty model", r.size() > 0 ) ;
   
        Property p1 = m.createProperty(ns+"p1") ;
   
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execConstruct()

        String queryString = "CONSTRUCT { ?s ?p ?o } WHERE { ?o ?p ?s }";
        Query q = QueryFactory.create(queryString);
       
        QueryExecution qExec = QueryExecutionFactory.create(q, m);
       
        Model resultModel = qExec.execConstruct();
        assertEquals(0, resultModel.size());
    }
   
    @Test public void testConstructRejectsBadTriples2()
    {
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execConstruct()

        return Boolean.valueOf(qexec.execAsk());
      } else if (query instanceof DescribeQuery) {
        return new JenaGraphAdaptor(qexec.execDescribe().getGraph())
            .getGraph();
      } else if (query instanceof ConstructQuery) {
        return new JenaGraphAdaptor(qexec.execConstruct().getGraph())
            .getGraph();
      } else {
        return new ResultSetWrapper(qexec.execSelect());
      }
    } finally {
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execConstruct()

        } catch (QueryExecException e2) {
          try {
            return new JenaGraphAdaptor(qexec.execDescribe()
                .getGraph()).getGraph();
          } catch (QueryExecException e3) {
            return new JenaGraphAdaptor(qexec.execConstruct()
                .getGraph()).getGraph();
          }
        }
      }
    } finally {
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execConstruct()

    startTask( "query execution" );
    if( query.isSelectType() )
      queryResults = ResultSetFactory.makeRewindable( qe.execSelect() );
    else if( query.isConstructType() )
      constructQueryModel = qe.execConstruct();
    else if( query.isAskType() )
      askQueryResult = qe.execAsk();
    else
      throw new UnsupportedOperationException( "Unsupported query type" );
    finishTask( "query execution" );
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execConstruct()

   * @return new Model
   */
  public Model execConstruct(String sparql) {
    Query query = QueryFactory.create(sparql);
    QueryExecution qe = QueryExecutionFactory.create(query, model);
    Model m = qe.execConstruct();
    qe.close();
    return m;
  }


View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execConstruct()

        log.fine( "Real=" + askReal );

        return askReal == askExpected;
      }
      else if( query.isConstructType() ) {
        final Model real = exec.execConstruct();
        final Model expected = FileManager.get().loadModel( resultURI );

        log.fine( "Expected=" + real );
        log.fine( "Real=" + expected );
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execConstruct()

    assertConnected();

    QueryExecution aQueryExec = query(theQuery);

    try {
      return JenaSesameUtils.asSesameGraph(aQueryExec.execConstruct());
    }
    finally {
      aQueryExec.close();
    }
  }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execConstruct()

      Model result = qe.execDescribe();
      //result.setNsPrefixes(model.getNsPrefixMap());
      SparqlHttpResultFormatter.format(res, result, format);
      qe.close();
    } else if (isConstructQuery()) { // CONSTRUCT
      Model result = qe.execConstruct();
      //result.setNsPrefixes(model.getNsPrefixMap());
      SparqlHttpResultFormatter.format(res, result, format);
      qe.close();
    } else {
      logger.error("Unsupported query type");
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execConstruct()

      //result.setNsPrefixes(model.getNsPrefixMap());
      queryResults.setType(QueryResultsType.MODEL);
      queryResults.setModel(result);
      qe.close();
    } else if (isConstructQuery()) { // CONSTRUCT
      Model result = qe.execConstruct();
      //result.setNsPrefixes(model.getNsPrefixMap());
      queryResults.setType(QueryResultsType.MODEL);
      queryResults.setModel(result);
      qe.close();
    } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.