Package lupos.rif.operator

Examples of lupos.rif.operator.PredicateIndexScan


        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){
View Full Code Here


  public Object visit(final RulePredicate obj, final Object arg) throws RIFException {
    final BasicOperator zpattern = this.generatePattern(obj, arg);
    if (zpattern instanceof PredicatePattern) {
      final PredicatePattern predPat = (PredicatePattern) zpattern;
      if (this.predicateIndex == null) {
        this.predicateIndex = new PredicateIndexScan();
        this.indexScanCreator.getRoot().addSucceedingOperator(new OperatorIDTuple(this.predicateIndex, this.indexScanCreator.getRoot().getSucceedingOperators().size()));
        this.predicateIndex.addPrecedingOperator(this.indexScanCreator.getRoot());
      }
      this.predicateIndex.addSucceedingOperator(new OperatorIDTuple(predPat, this.predicateIndex.getSucceedingOperators().size()));
      predPat.addPrecedingOperator(this.predicateIndex);
View Full Code Here

 
  private final Root root;

  public BackwardChainingGraphBuilder(final IndexScanCreatorInterface indexScanCreator, Root root) {
    super(indexScanCreator);
    predicateIndex = new PredicateIndexScan();
    this.root = root;
  }
View Full Code Here

    datasetIndex = new InitializeDatasetIndexScan(root);
    root.addSucceedingOperator(datasetIndex);

    // Conclusion auswerten
    // TODO: erstmal nur ohne Equality, conjunction, disjunction und exists
    PredicateIndexScan conclusionIndex = null;
    if (obj.getConclusion() instanceof RulePredicate) {
      final RulePredicate predicate = (RulePredicate) obj.getConclusion();
      conclusionIndex = new PredicateIndexScan();
      root.addSucceedingOperator(conclusionIndex);
      Predicate toAdd = null;
      if (predicate.isTriple()) {
        final Triple triple = (Triple) predicate.toDataStructure();
        toAdd = new Predicate();
        toAdd.setName(triple.getPredicate());
        toAdd.getParameters().addAll(
            Arrays.asList(triple.getSubject(), triple.getObject()));
      } else
        toAdd = (Predicate) predicate.toDataStructure();
      conclusionIndex.addPredicateFact(toAdd);
    }

    // TODO: nur eine Regel enthalten, welche direkt auf die conclusion
    // passt,
    // sp�ter auswahl der richtigen Regel
View Full Code Here

TOP

Related Classes of lupos.rif.operator.PredicateIndexScan

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.