Package lupos.engine.operators.singleinput.generate

Examples of lupos.engine.operators.singleinput.generate.Generate


public class RuleFindAllGenerates extends Rule {

  @Override
  protected void init() {
    final Generate generate = new Generate();

    subGraphMap = new HashMap<BasicOperator, String>();
    subGraphMap.put(generate, "generate");

    startNode = generate;
View Full Code Here


      final Map<String, BasicOperator> mso,
      final BasicOperator rootOperator) {

    // wie BasicOperator.deepClone

    final Generate generate = (Generate) mso.get("generate");
    RDFSRuleEngine0.generates.add(generate);
    return null;
  }
View Full Code Here

  }

  protected static void addTps(final Item data, final Root ic,
      final TripleOperator tp, final Item a, final Item b, final Item c,
      final TriplePattern... tps) {
    final Generate g = new Generate(tp, a, b, c);
    if (tps.length == 1) {
      final TriplePattern tpo = tps[0];
      tpo.setSucceedingOperator(new OperatorIDTuple(g, 0));
      final Collection<TriplePattern> ctp = new LinkedList<TriplePattern>();
      ctp.add(tpo);
View Full Code Here

      final Root ic, final TripleOperator tp, final Item a,
      final Item b, final Item c, final String filter,
      final TriplePattern tp2) {
    try {
      final Filter f = new Filter(filter);
      final Generate g = new Generate(tp, a, b, c);
      f.addSucceedingOperator(new OperatorIDTuple(g, 0));
      tp2.setSucceedingOperator(new OperatorIDTuple(f, 0));
      final Collection<TriplePattern> ctp = new LinkedList<TriplePattern>();
      ctp.add(tp2);
      ic.addSucceedingOperator(new OperatorIDTuple(ic.newIndexScan(
View Full Code Here

      final String filter2, final TriplePattern tp1,
      final TriplePattern tp2) {
    try {
      final Filter f1 = new Filter(filter1);
      final Filter f2 = new Filter(filter2);
      final Generate g = new Generate(tp, a, b, c);
      final Join join = new Join();
      f1.addSucceedingOperator(new OperatorIDTuple(join, 0));
      f2.addSucceedingOperator(new OperatorIDTuple(join, 1));
      join.addSucceedingOperator(new OperatorIDTuple(g, 0));
      tp1.setSucceedingOperator(new OperatorIDTuple(f1, 0));
View Full Code Here

      final Root ic, final TripleOperator tp, final Item a,
      final Item b, final Item c, final String filter1,
      final TriplePattern tp1, final TriplePattern tp2) {
    try {
      final Filter f1 = new Filter(filter1);
      final Generate g = new Generate(tp, a, b, c);
      final Join join = new Join();
      f1.addSucceedingOperator(new OperatorIDTuple(join, 0));
      join.addSucceedingOperator(new OperatorIDTuple(g, 0));
      tp1.setSucceedingOperator(new OperatorIDTuple(f1, 0));
      tp2.setSucceedingOperator(new OperatorIDTuple(join, 1));
View Full Code Here

    this.doNotConnectInferenceRules = doNotConnectInferenceRules;
  }

  @Override
  protected void init() {
    final Generate generate = new Generate();

    subGraphMap = new HashMap<BasicOperator, String>();
    subGraphMap.put(generate, "generate");

    startNode = generate;
View Full Code Here

    startNode = generate;
  }

  @Override
  protected boolean checkPrecondition(final Map<String, BasicOperator> mso) {
    final Generate generate = (Generate) mso.get("generate");
    // Connect still not switched Generates
    return (generate.getSucceedingOperators().size() > 0)
        && (!(generate.getSucceedingOperators().get(0).getOperator() instanceof TriplePattern));
  }
View Full Code Here

  @Override
  public Tuple<Collection<BasicOperator>, Collection<BasicOperator>> transformOperatorGraph(
      final Map<String, BasicOperator> mso,
      final BasicOperator rootOperator) {
    final Generate generate = (Generate) mso.get("generate");

    // PatternMatcher has only TriplePattern as sons
    final List<OperatorIDTuple> pats = rootOperator
        .getSucceedingOperators();

    final LinkedList<OperatorIDTuple> possiblePats = new LinkedList<OperatorIDTuple>();
    // Find possible TriplePattern objects
    TriplePattern pat;
    for (int a = 0; a < pats.size(); a++) {
      if (pats.get(a).getOperator() instanceof TriplePattern) {
        pat = (TriplePattern) pats.get(a).getOperator();
        if (matchPossible(generate.getValueOrVariable(),
            pat.getItems(), doNotConnectInferenceRules)) {
          possiblePats.add(new OperatorIDTuple(pat, 0));
          pat.addPrecedingOperator(generate);
        }
      }
    }
    rootOperator.removePrecedingOperator(generate);
    // Set new successors of Generate object
    if (possiblePats.size() > 0) {
      // System.out.println(generate.toString() + "----"
      // + possiblePats.toString());
      generate.setSucceedingOperators(possiblePats);
    } else {
      generate.setSucceedingOperators(new LinkedList<OperatorIDTuple>());
    }

    // rootOperator.deleteParents();
    // rootOperator.setParents();
    // rootOperator.detectCycles();
View Full Code Here

public class RuleSplitGenerate extends Rule {

  @Override
  protected void init() {
    final Generate generate = new Generate();

    subGraphMap = new HashMap<BasicOperator, String>();
    subGraphMap.put(generate, "generate");

    startNode = generate;
View Full Code Here

TOP

Related Classes of lupos.engine.operators.singleinput.generate.Generate

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.