Package com.hp.hpl.jena.query

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


    public static boolean containsGraph(Store store, Node graphNode)
    {
        String qs = "SELECT * { GRAPH "+FmtUtils.stringForNode(graphNode)+" { ?s ?p ?o }} LIMIT 1" ;
        Dataset ds = SDBFactory.connectDataset(store) ;
        QueryExecution qExec = QueryExecutionFactory.create(qs, ds) ;
        ResultSet rs = qExec.execSelect() ;
        boolean b = rs.hasNext() ;
        qExec.close();
        return b ;
    }

View Full Code Here


                                             "PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>",
                                             "PREFIX  owl:    <http://www.w3.org/2002/07/owl#>",
                                             "PREFIX skos:    <http://www.w3.org/2004/02/skos/core#>") ;
        Query query = QueryFactory.create(preamble+"\n"+qs, Syntax.syntaxARQ) ;
        QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
        ResultSet rs = qexec.execSelect() ;
        for ( ; rs.hasNext() ; )
        {
            QuerySolution soln= rs.next() ;
            Node x = soln.get("x").asNode() ;
            Node y = soln.get("y").asNode() ;
View Full Code Here

    Query query = QueryFactory.create(queryString);

//     Execute the query and obtain results
    QueryExecution qe = QueryExecutionFactory.create(query, manifest);
    ResultSet results = qe.execSelect();
   
    WDSingleTest one = null;
    Resource last = null;
    while (results.hasNext()) {
      QuerySolution s = results.nextSolution();
View Full Code Here

        model.read(new FileInputStream(license), null);

        QueryExecution qexec = QueryExecutionFactory.create(
            queryString, model);
        try {
          ResultSet results = qexec.execSelect();
          while (results.hasNext()) {
            QuerySolution soln = results.nextSolution();
            try {
              Literal u = soln.getLiteral("user");
//              System.err.println("user: "+u.getString());
View Full Code Here

      }
    });

    try {
      try {
        return new ResultSetWrapper(qexec.execSelect());
      } catch (QueryExecException e) {
        try {
          return Boolean.valueOf(qexec.execAsk());
        } catch (QueryExecException e2) {
          try {
View Full Code Here

        }
        else
        {
            QueryEngineFactory f = QueryEngineRef.getFactory() ;
            QueryExecution qExec1 = new QueryExecutionBase(query, ds, null, f) ;
            rs1 = ResultSetFactory.makeRewindable(qExec1.execSelect()) ;
            qExec1.close() ;
            expectedLabel = "Standard engine" ;
        }
       
        // ---- Second, execute in DB
View Full Code Here

        ds = DatasetStore.create(store) ;
        QueryExecution qExec2 = new QueryExecutionBase(query, ds, null, f2) ;
       
        try {
            SDBConnection.logSQLExceptions = true ;
            rs = qExec2.execSelect() ;
           
            ResultSetRewindable rs2 = ResultSetFactory.makeRewindable(rs) ;
            boolean b = ResultSetCompare.equalsByTerm(rs1, rs2) ;
            if ( !b )
            {
View Full Code Here

       
        QueryExecution qExec = QueryExecutionFactory.create(query, ds) ;
        // Install filter for this query only.
        qExec.getContext().set(SystemTDB.symTupleFilter, filter) ;
        qExec.getContext().setTrue(TDB.symUnionDefaultGraph) ;
        long x1 = ResultSetFormatter.consume(qExec.execSelect()) ;
        qExec.close() ;
        assertEquals(withFilter, x1) ;

        // No filter.
        qExec = QueryExecutionFactory.create(query, ds) ;
View Full Code Here

        assertEquals(withFilter, x1) ;

        // No filter.
        qExec = QueryExecutionFactory.create(query, ds) ;
        qExec.getContext().setTrue(TDB.symUnionDefaultGraph) ;
        long x2 = ResultSetFormatter.consume(qExec.execSelect()) ;
        qExec.close() ;
        assertEquals(withoutFilter, x2) ;

    }
       
View Full Code Here

    // Execute the query and obtain results
    QueryExecution qe = QueryExecutionFactory.create(query, model);
   
    if ( query.isSelectType() ) {
      ResultSet results = qe.execSelect();
      ResultSetFormatter.out(System.out, results, query);
    }
    else if ( query.isConstructType() ) {
      Model model_ = qe.execConstruct();
     
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.