Package lupos.rif.operator

Examples of lupos.rif.operator.InsertTripleIndexScan


    this.equalityMap = HashMultimap.create();
    this.usesEqualities = false;
    // 1. Fakten muessen als erstes ausgewertet werden und dann in allen
    // Operatorbaeumen beruecksichtigt werden.
    this.predicateIndex = null;
    InsertTripleIndexScan insertTripleIndex = null;
    for (final IExpression fact : obj.getFacts()) {
      if (fact instanceof Equality) {
        final Equality eq = (Equality) fact;
        this.equalityMap.put(eq.leftExpr, eq.rightExpr);
        this.equalityMap.put(eq.rightExpr, eq.leftExpr);
        this.usesEqualities = true;
      } else {
        final Object item = ((RulePredicate) fact).toDataStructure();
        if (item instanceof Triple) {
          insertTripleIndex = insertTripleIndex == null ? new InsertTripleIndexScan(this.indexScanCreator) : insertTripleIndex;
          insertTripleIndex.addTripleFact((Triple) item);
        } else if (item instanceof Predicate) {
          this.predicateIndex = this.predicateIndex == null ? new PredicateIndexScan() : this.predicateIndex;
          this.predicateIndex.addPredicateFact((Predicate) item);
        }
      }
    }
    if (insertTripleIndex != null){
      this.indexScanCreator.getRoot().addSucceedingOperator(new OperatorIDTuple(insertTripleIndex, 0));
      insertTripleIndex.addPrecedingOperator(this.indexScanCreator.getRoot());
    }
    if (this.predicateIndex != null){
      this.indexScanCreator.getRoot().addSucceedingOperator(new OperatorIDTuple(this.predicateIndex, 1));
      this.predicateIndex.addPrecedingOperator(this.indexScanCreator.getRoot());
    }
View Full Code Here


    this.root = root;
  }

  public Object visit(Document obj, Object arg) throws RIFException {
    // Initialisierungen
    InsertTripleIndexScan insertTripleIndex = null;
    for (Rule fact : obj.getRules())
      if (!fact.isImplication() && fact.getDeclaredVariables().isEmpty()) {
        final Object item = ((RulePredicate) fact.getHead())
        .toDataStructure();
        if (item instanceof Triple) {
          insertTripleIndex = insertTripleIndex == null ? new InsertTripleIndexScan(indexScanCreator)
          : insertTripleIndex;
          insertTripleIndex.addTripleFact((Triple) item);
        } else if (item instanceof Predicate) {
          predicateIndex.addPredicateFact((Predicate) item);
        }
      }
    if (insertTripleIndex != null)
View Full Code Here

TOP

Related Classes of lupos.rif.operator.InsertTripleIndexScan

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.