Package lupos.engine.operators.singleinput

Examples of lupos.engine.operators.singleinput.Construct


      subOperator = minus;
    }

    // 1. Construct erstellen
    if (generateTriples) {
      final Construct construct = new Construct();
      subOperator.addSucceedingOperator(construct);
      construct.addPrecedingOperator(subOperator);
      final List<TriplePattern> patterns = new ArrayList<TriplePattern>();
      for (final Uniterm term : obj.getHead().getPredicates()) {
        if (((RulePredicate) term).isTriple()) {
          final TriplePattern pattern = this.unitermToTriplePattern(term);
          patterns.add(pattern);
        }
      }
      construct.setTemplates(patterns);
      // Fuer jedes Triplepattern in Construct ein Generate fuer Inferenz erstellen
      // wird, falls es keinen Consumer gibt, spaeter wieder entfernt
      for (final TriplePattern pattern : construct.getTemplates()) {
        final Generate generateTriplesOp = new Generate(pattern.getItems());
        generateTriplesOp.addPrecedingOperator(subOperator);
        subOperator.addSucceedingOperator(new OperatorIDTuple(generateTriplesOp, subOperator.getSucceedingOperators().size()));
        generateTriplesOp.addPrecedingOperator(subOperator);
        // TripleProduzenten registrieren
View Full Code Here


      } else {
        cu = new LinkedList<URILiteral>();
        cu.add((URILiteral)entry.getSecond());
      }
      muo.setURIs(cu);
      Construct construct=entry.getFirst();
      construct.addSucceedingOperator(muo);
      connection.connect(muo);
    }
    if(ops.size()>1){
      SeveralSucceedingOperators endOp = new SeveralSucceedingOperators();
      for(Tuple<Construct, Item> entry: graphConstraints){
View Full Code Here

        cu = new LinkedList<URILiteral>();
        cu.add((URILiteral)entry.getSecond());
      }
      muo.setURIs(cu);
      muo.setSucceedingOperator(new OperatorIDTuple(result, 0));
      Construct construct = entry.getFirst();
      construct.setSucceedingOperator(new OperatorIDTuple(muo, 0));
      this.indexScanCreator.createEmptyIndexScanAndConnectWithRoot(new OperatorIDTuple(construct, 0));
    }
  }
View Full Code Here

  public LinkedList<Tuple<Construct, Item>> getGraphConstructs(final Node node) {
    final LinkedList<Tuple<Construct, Item>> graphConstructs = new LinkedList<Tuple<Construct, Item>>();
    final Collection<TriplePattern> operators = this.collectTriplePatternOfChildren(node);
    if(operators.size()>0){
      final Construct c = new Construct();
      c.setTemplates(operators);
      graphConstructs.add(new Tuple<Construct, Item>(c, null));
    }
    for(int i=0; i<node.jjtGetNumChildren();i++){
      final Node child = node.jjtGetChild(i);
      if(child instanceof ASTGraphConstraint){
        final Collection<TriplePattern> otp = this.collectTriplePatternOfChildren(child);
        if(otp.size()>0){
          final Construct c2 = new Construct();
          c2.setTemplates(otp);
          final Node childchild=child.jjtGetChild(0);
          Item item=null;
          if (childchild instanceof ASTQuotedURIRef) {
            try {
              item=LiteralFactory.createURILiteralWithoutLazyLiteral("<"+ childchild.toString() + ">");
View Full Code Here

    // first determine those operations, which generate triples of the result (and delete the other ones (and their preceding operators...))
    // also replace Construct operators with Generate operators!
    final LinkedList<Generate> listOfConstructedTripel = new LinkedList<Generate>();
    for(final BasicOperator bo: new LinkedList<BasicOperator>(resultInference.getPrecedingOperators())){
      if(bo instanceof Construct){
        final Construct construct = (Construct)bo;
        // split construct and replace them with Generate operators!
        for(final TriplePattern tp: construct.getTemplates()){
          final Generate generate = new Generate(tp);
          for(final BasicOperator father: construct.getPrecedingOperators()){
            father.addSucceedingOperator(generate);
            generate.addPrecedingOperator(father);
          }
          listOfConstructedTripel.add(generate);
          // remove old construct
          for(final BasicOperator father: new HashSet<BasicOperator>(construct.getPrecedingOperators())){
            father.removeSucceedingOperator(construct);
            construct.removePrecedingOperator(father);
          }
        }
      } else if(bo instanceof ConstructPredicate){
        final ConstructPredicate cp = (ConstructPredicate) bo;
        boolean toDelete = true;
View Full Code Here

TOP

Related Classes of lupos.engine.operators.singleinput.Construct

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.