Examples of execAsk()


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

            return new SPARQLResult(model) ;
        }

        if ( query.isAskType() )
        {
            boolean b = qexec.execAsk() ;
            log.info(format("[%d] OK/ask",action.id)) ;
            return new SPARQLResult(b) ;
        }

        errorBadRequest("Unknown query type - "+queryStringLog) ;
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execAsk()

 
  public void testBasicAskQuery() throws SQLException, ConfigException
  {
    QueryEngine qe = prepareQuery("ASK { _:s <urn:ex:TABLE1_FIELD1> 1 }");
   
    boolean res = qe.execAsk();
   
    assertTrue("DB contains triple", res);
  }
 
  public void testBasicSelectQuery() throws SQLException, ConfigException
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execAsk()

 
  public void testOptionalAskQuery() throws SQLException, ConfigException
  {
    QueryEngine qe = prepareQuery("ASK { _:s <urn:ex:TABLE1_FIELD1> 1 . OPTIONAL { _:s <urn:ex:TABLE1_FIELD2> 'not there'} }");
   
    boolean res = qe.execAsk();
   
    assertTrue("Matched optional", res);
  }
 
  public void testOptionalSelectQuerySameSubject() throws SQLException, ConfigException
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execAsk()

 
  public void testTypeSelectQuery() throws SQLException, ConfigException
  {
    QueryEngine qe = prepareQuery("ASK WHERE { ?s a <urn:ex:TABLE1> ; <urn:ex:TABLE1_FIELD1> ?val1 . }");
   
    boolean result = qe.execAsk();
   
    assertTrue("No problem with type query", result);
   
    qe = prepareQuery("ASK WHERE { ?s a <urn:ex:TABLE2> ; <urn:ex:TABLE1_FIELD1> ?val1 . }");
   
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execAsk()

   
    assertTrue("No problem with type query", result);
   
    qe = prepareQuery("ASK WHERE { ?s a <urn:ex:TABLE2> ; <urn:ex:TABLE1_FIELD1> ?val1 . }");
   
    result = qe.execAsk();
   
    assertFalse("Type mismatch caused no match", result);   
  }
 
  public void testRoundTrip() throws SQLException, ConfigException
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execAsk()

       
    assertEquals("Result is correct", "urn:ex:TABLE1;FIELD1=2;FIELD3=3", ((Resource) subj).getURI());
   
    qe = prepareQuery("ASK WHERE {  <urn:ex:TABLE1;FIELD1=2;FIELD3=3> <urn:ex:TABLE1_FIELD2> 'C' } ");
   
    boolean rb = qe.execAsk();
   
    assertTrue("Correct result for round trip", rb);
  }
 
  public void testConcreteSubject() throws SQLException, ConfigException
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execAsk()

    QueryEngine qe;
    boolean res;
   
    qe = prepareQuery("ASK WHERE { <urn:ex:TABLE1;FIELD1=2> <urn:ex:TABLE1_FIELD2> 'C' }");
   
    res = qe.execAsk();
   
    assertFalse("I have no result", res);
   
    qe = prepareQuery("ASK WHERE { <urn:ex:TABLE1;FIELD1=2> <urn:ex:TABLE2_FIELD2> 'C' }");
   
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execAsk()

   
    assertFalse("I have no result", res);
   
    qe = prepareQuery("ASK WHERE { <urn:ex:TABLE1;FIELD1=2> <urn:ex:TABLE2_FIELD2> 'C' }");
   
    res = qe.execAsk();
   
    assertFalse("I have no result", res);
  }
 
  // Simple 'list things of type...'
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execAsk()

        "}"
        );
   
    QueryEngine qe = new LdapQueryEngine(query, config);
    qe.setDataset(DatasetFactory.create());
    boolean res = qe.execAsk();
    assertFalse("I'm based near UK", res);
  }
 
  /* A positive ask */
  public void testPosAskPos()
View Full Code Here

Examples of com.hp.hpl.jena.query.engine1.QueryEngine.execAsk()

        "}"
        );
   
    QueryEngine qe = new LdapQueryEngine(query, config);
    qe.setDataset(DatasetFactory.create());
    boolean res = qe.execAsk();
    assertTrue("I'm based near GB", res);
  }
 
  /* Very simple, but possibly tricky... */
  public void testTripleExists()
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.