Examples of BooleanResult


Examples of lupos.datastructures.queryresult.BooleanResult

   */
  public ArrayList<DBAnswer> detectType() {
    Iterator<String> it = this.tokens.iterator();
    QueryBuilder builder = new QueryBuilder();
    ArrayList<DBAnswer> types = new ArrayList<DBAnswer>();
    BooleanResult askpersonresult = new BooleanResult();
    BooleanResult askplaceresult = new BooleanResult();
    QueryResult result = new QueryResult();
    while (it.hasNext()) {
      String toCheck = it.next();

      /** Try if person or place with name (token substring) exists in DB */
      askpersonresult = (BooleanResult) builder.query(toCheck,
          "askperson");
      System.out.println(askpersonresult);
      askplaceresult = (BooleanResult) builder.query(toCheck, "askplace");
      System.out.println(askplaceresult);

      /**
       * If results for askpersonresult & askplaceresult are both true,
       * prefer the person result, else choose the one whose QueryResult
       * contains true
       */
      if (askpersonresult.isTrue() && !(askplaceresult.isTrue())) {
        result = builder.query(toCheck, "person");
      } else if (!(askpersonresult.isTrue()) && askplaceresult.isTrue()) {
        result = builder.query(toCheck, "place");
      } else if (!(askpersonresult.isTrue())
          && !(askplaceresult.isTrue()))
        continue;
      else {
        result = builder.query(toCheck, "place");
        if(result.isEmpty()){
          result = builder.query(toCheck, "person");
View Full Code Here

Examples of lupos.datastructures.queryresult.BooleanResult

  @Override
  public QueryResult getResult() throws Exception {
    evaluateQuery();
    QueryResult qr = null;
    if (result instanceof Boolean) {
      qr = new BooleanResult();
      if ((Boolean) result)
        qr.add(new BindingsCollection());
    } else if (result instanceof TupleQueryResult) {
      qr = QueryResult.createInstance();
      while (((TupleQueryResult) result).hasNext()) {
View Full Code Here

Examples of org.openrdf.result.BooleanResult

  @Override
  protected final Representation getRepresentation(BooleanQueryResultWriterFactory factory,
      MediaType mediaType)
    throws ResourceException
  {
    BooleanResult booleanResult = getBooleanResult();
    return new BooleanResultRepresentation(booleanResult, factory, mediaType);
  }
View Full Code Here

Examples of spark.api.BooleanResult

    String fn = TEST_DIR + testName + FILE_EXT;
    return (BooleanResult) XMLResultsParser.parseResults(null, new FileInputStream(fn), null);
  }

  static void booleanTest(String testName, boolean value, String... metadata) throws Exception {
    BooleanResult r = getTestData(testName);
    assertNotNull(r);
   
    assertEquals(value, r.getResult());
   
    assertTrue(r instanceof ProtocolResult);
    List<String> md = ((ProtocolResult)r).getMetadata();
    assertEquals(Arrays.asList(metadata), md);
  }
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.