Package lupos.engine.operators.application

Examples of lupos.engine.operators.application.CollectRIFResult


                  }

                  System.out.println("Evaluate query ...");

                  if (evaluator instanceof CommonCoreQueryEvaluator || evaluator instanceof BasicIndexRuleEvaluator) {
                    final CollectRIFResult crr = new CollectRIFResult(false);
                    final Result resultOperator = (evaluator instanceof CommonCoreQueryEvaluator)?((CommonCoreQueryEvaluator<Node>)evaluator).getResultOperator(): ((BasicIndexRuleEvaluator)evaluator).getResultOperator();
                    resultOperator.addApplication(crr);
                    evaluator.evaluateQuery();
                    this.resultQueryEvaluator = crr.getQueryResults();
                  } else {
                    this.resultQueryEvaluator = new QueryResult[1];
                    this.resultQueryEvaluator[0] = evaluator.getResult();
                  }
View Full Code Here


  public QueryResult getResult() throws Exception {
    return this.getResult(false);
  }

  public QueryResult getResult(final boolean oneTime) throws Exception {
    final CollectRIFResult cr = new CollectRIFResult(oneTime);
    this.evaluator.getResultOperator().addApplication(cr);
    this.evaluator.evaluateQuery();
    return cr.getResult();
  }
View Full Code Here

  public QueryResult[] getResults() throws Exception {
    return this.getResults(false);
  }

  public QueryResult[] getResults(final boolean oneTime) throws Exception {
    final CollectRIFResult cr = new CollectRIFResult(oneTime);
    this.evaluator.getResultOperator().addApplication(cr);
    this.evaluator.evaluateQuery();
    return cr.getQueryResults();
  }
View Full Code Here

    this.evaluator.evaluateQuery();
    return cr.getQueryResults();
  }

  public CollectRIFResult getCollectedResults(final boolean oneTime) throws Exception {
    final CollectRIFResult cr = new CollectRIFResult(oneTime);
    this.evaluator.getResultOperator().addApplication(cr);
    this.evaluator.evaluateQuery();
    return cr;
  }
View Full Code Here

   *
   * @return return a rule result with all predicates rif:error, which are detected errors in the ontology!
   * @throws Exception
   */
  public RuleResult inferTriplesAndStoreInDataset() throws Exception {
    final CollectRIFResult cr = this.getCollectedResults(true);
    final RuleResult result = new RuleResult();
    if(this.evaluator instanceof BasicIndexQueryEvaluator){
      for(final QueryResult qr: cr.getQueryResults()){
        if(qr instanceof GraphResult){
          final GraphResult gr = (GraphResult) qr;
          for(final Triple t: gr.getGraphResultTriples()){
            final Collection<Indices> ci = ((BasicIndexQueryEvaluator)this.evaluator).getDataset().getDefaultGraphIndices();
            for (final Indices indices : ci) {
              indices.add(t);
            }
          }
        } else if(qr instanceof RuleResult){
          final RuleResult rr = (RuleResult) qr;
          for(final Predicate predicate: rr.getPredicateResults()){
            if(rif_error.equals(predicate.getName())){
              result.getPredicateResults().add(predicate);
            }
          }
        }
      }
    } else if (this.evaluator instanceof StreamQueryEvaluator) {
      String s = "";
      for(final QueryResult qr: cr.getQueryResults()){
        if(qr instanceof GraphResult){
          final GraphResult gr = (GraphResult) qr;
          // TODO duplicated triple elimination!
          for(final Triple t: gr.getGraphResultTriples()){
            if(!t.getSubject().isBlank() && !t.getSubject().isURI()){
View Full Code Here

TOP

Related Classes of lupos.engine.operators.application.CollectRIFResult

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.