Package lupos.engine.operators.messages

Examples of lupos.engine.operators.messages.BoundVariablesMessage


  @Override
  public Message preProcessMessage(final BoundVariablesMessage msg) {
    intersectionVariables = new HashSet<Variable>();
    unionVariables = new HashSet<Variable>();
    final BoundVariablesMessage result = new BoundVariablesMessage(msg);
    for (final Variable i : substitutionsVariableLeft) {
      result.getVariables().add(i);
      intersectionVariables.add(i);
      unionVariables.add(i);
    }
    return result;
  }
View Full Code Here


  }

  @Override
  public Message preProcessMessage(final BoundVariablesMessage msg) {
    this.recomputeVariables();
    final BoundVariablesMessage result = new BoundVariablesMessage(msg);
    result.getVariables().addAll(this.unionVariables);
    /*
     * if(rdfGraph!=null && rdfGraph.isVariable()) {
     * intersectionVariables.add((Variable)rdfGraph);
     * unionVariables.add((Variable)rdfGraph); }
     */
 
View Full Code Here

      this.result = spvi.getResult();
      this.determinePatternMatchers();
      this.rootNode.deleteParents();
      this.rootNode.setParents();
      this.rootNode.detectCycles();
      this.rootNode.sendMessage(new BoundVariablesMessage());
      final CorrectOperatorgraphRulePackage recog = new CorrectOperatorgraphRulePackage();
      recog.applyRules(this.rootNode);
      if (this.rdfs != RDFS.NONE) {
        for (final PatternMatcher zpm : this.patternMatchers) {
          final RDFSRoot ic = new RDFSRoot();
          if (this.rdfs == RDFS.RDFS || this.rdfs == RDFS.OPTIMIZEDRDFS) {
            if (this.externalOntology != null) {
              RDFSchemaInference.addInferenceRulesForInstanceData(ic,
                  zpm);
            } else {
              RDFSchemaInference.addInferenceRules(ic, zpm);
            }
          } else if (this.rdfs == RDFS.RUDIMENTARYRDFS
              || this.rdfs == RDFS.OPTIMIZEDRUDIMENTARYRDFS) {
            if (this.externalOntology != null) {
              RudimentaryRDFSchemaInference
              .addInferenceRulesForInstanceData(ic, zpm);
            } else {
              RudimentaryRDFSchemaInference
              .addInferenceRules(ic, zpm);
            }
          } else if (this.rdfs == RDFS.ALTERNATIVERDFS
              || this.rdfs == RDFS.OPTIMIZEDALTERNATIVERDFS) {
            if (this.externalOntology != null) {
              AlternativeRDFSchemaInference
              .addInferenceRulesForInstanceData(ic, zpm);
            } else {
              AlternativeRDFSchemaInference
              .addInferenceRules(ic, zpm);
            }
          }
          ic.addToPatternMatcher(zpm);
          zpm.deleteParents();
          zpm.setParents();
          zpm.detectCycles();
          zpm.sendMessage(new BoundVariablesMessage());
          if (this.externalOntology != null) {
            this.precompileExternalOntology(zpm);
            zpm.deleteParents();
            zpm.setParents();
            zpm.detectCycles();
            zpm.sendMessage(new BoundVariablesMessage());
            final ExternalOntologyRuleEngine eore = new ExternalOntologyRuleEngine();
            eore.applyRules(zpm);
          }
        }
      }
View Full Code Here

      this.result = spvi.getResult();

      this.rootNode.deleteParents();
      this.rootNode.setParents();
      this.rootNode.detectCycles();
      this.rootNode.sendMessage(new BoundVariablesMessage());
      final DebugContainer<BasicOperatorByteArray> dc = new DebugContainer<BasicOperatorByteArray>(
          "Before a possible correction of the operator graph...",
          "correctoperatorgraphPackageDescription",
          BasicOperatorByteArray.getBasicOperatorByteArray(this.rootNode.deepClone(), prefixInstance));
      final CorrectOperatorgraphRulePackage recog = new CorrectOperatorgraphRulePackage();
      final List<DebugContainer<BasicOperatorByteArray>> correctOperatorGraphRules = recog
      .applyRulesDebugByteArray(this.rootNode, prefixInstance);
      correctOperatorGraphRules.add(0, dc);
      if (this.rdfs != RDFS.NONE) {
        for (final PatternMatcher zpm : this.patternMatchers) {
          final RDFSRoot ic = new RDFSRoot();
          if (this.rdfs == RDFS.RDFS || this.rdfs == RDFS.OPTIMIZEDRDFS) {
            if (this.externalOntology != null) {
              RDFSchemaInference.addInferenceRulesForInstanceData(ic,
                  zpm);
            } else {
              RDFSchemaInference.addInferenceRules(ic, zpm);
            }
          } else if (this.rdfs == RDFS.RUDIMENTARYRDFS
              || this.rdfs == RDFS.OPTIMIZEDRUDIMENTARYRDFS) {
            if (this.externalOntology != null) {
              RudimentaryRDFSchemaInference
              .addInferenceRulesForInstanceData(ic, zpm);
            } else {
              RudimentaryRDFSchemaInference
              .addInferenceRules(ic, zpm);
            }
          } else if (this.rdfs == RDFS.ALTERNATIVERDFS
              || this.rdfs == RDFS.OPTIMIZEDALTERNATIVERDFS) {
            if (this.externalOntology != null) {
              AlternativeRDFSchemaInference
              .addInferenceRulesForInstanceData(ic, zpm);
            } else {
              AlternativeRDFSchemaInference
              .addInferenceRules(ic, zpm);
            }
          }
          ic.addToPatternMatcher(zpm);
          zpm.deleteParents();
          zpm.setParents();
          zpm.detectCycles();
          zpm.sendMessage(new BoundVariablesMessage());
          correctOperatorGraphRules
          .add(new DebugContainer<BasicOperatorByteArray>(
              "After adding RDFS inference rules to the operator graph...",
              "AddRDFSInferenceRules", BasicOperatorByteArray
              .getBasicOperatorByteArray(this.rootNode.deepClone(), prefixInstance)));
          if (this.externalOntology != null) {
            this.precompileExternalOntology(zpm);
            correctOperatorGraphRules
            .add(new DebugContainer<BasicOperatorByteArray>(
                "After the precomilation of RDFS inference rules to the operator graph...",
                "PrecompileRDFSInferenceRules",
                BasicOperatorByteArray
                .getBasicOperatorByteArray(this.rootNode.deepClone(), prefixInstance)));
            zpm.deleteParents();
            zpm.setParents();
            zpm.detectCycles();
            zpm.sendMessage(new BoundVariablesMessage());
            final ExternalOntologyRuleEngine eore = new ExternalOntologyRuleEngine();
            correctOperatorGraphRules
            .addAll(eore.applyRulesDebugByteArray(zpm,
                prefixInstance));
          }
View Full Code Here

        "logicaloptimizationPackageDescription", BasicOperatorByteArray
        .getBasicOperatorByteArray(this.rootNode.deepClone(),
            prefixInstance)));
    final LogicalOptimizationForStreamEngineRulePackage refse = new LogicalOptimizationForStreamEngineRulePackage();
    this.rootNode.detectCycles();
    this.rootNode.sendMessage(new BoundVariablesMessage());
    this.setBindingsVariablesBasedOnOperatorgraph();
    debug.addAll(refse.applyRulesDebugByteArray(this.rootNode, prefixInstance));
    if (this.rdfs == RDFS.OPTIMIZEDRDFS || this.rdfs == RDFS.OPTIMIZEDRUDIMENTARYRDFS
        || this.rdfs == RDFS.OPTIMIZEDALTERNATIVERDFS) {
      // should have been done before
View Full Code Here

    final Date a = new Date();
    this.rootNode.deleteParents();
    this.rootNode.setParents();
    final LogicalOptimizationForStreamEngineRulePackage refse = new LogicalOptimizationForStreamEngineRulePackage();
    this.rootNode.detectCycles();
    this.rootNode.sendMessage(new BoundVariablesMessage());
    this.setBindingsVariablesBasedOnOperatorgraph();
    refse.applyRules(this.rootNode);
    if (this.rdfs == RDFS.OPTIMIZEDRDFS || this.rdfs == RDFS.OPTIMIZEDRUDIMENTARYRDFS
        || this.rdfs == RDFS.OPTIMIZEDALTERNATIVERDFS) {
      // should have been done before
View Full Code Here

    }

    rootOperator.deleteParents();
    rootOperator.setParents();
    rootOperator.detectCycles();
    rootOperator.sendMessage(new BoundVariablesMessage());
    return null;
  }
View Full Code Here

    this.unionVariables = new HashSet<Variable>();
    // fetch-as-needed and join-at-endpoint compute a join with the previous result, i.e. the previous bound variables are also bound afterwards:
    this.unionVariables.addAll(msg.getVariables());
    checkVariables(this.federatedQuery, this.unionVariables);
    this.intersectionVariables.addAll(this.unionVariables);
    final BoundVariablesMessage result = new BoundVariablesMessage(msg);
    result.getVariables().addAll(this.unionVariables);
    return result;
  }
View Full Code Here

  public Message preProcessMessage(final BoundVariablesMessage msg) {
    this.intersectionVariables = new HashSet<Variable>();
    this.unionVariables = new HashSet<Variable>();
    FederatedQuery.checkVariables(this.federatedQuery, this.unionVariables);
    this.intersectionVariables.addAll(this.unionVariables);
    final BoundVariablesMessage result = new BoundVariablesMessage(msg);
    result.getVariables().addAll(this.unionVariables);
    return result;
  }
View Full Code Here

      root_param.deleteParents();
      root_param.setParents();
      final CorrectOperatorgraphRulePackage recog = new CorrectOperatorgraphRulePackage();
      root_param.detectCycles();
      root_param.sendMessage(new BoundVariablesMessage());
      recog.applyRules(root_param);
    }
    return ((new Date()).getTime() - a.getTime());
  }
View Full Code Here

TOP

Related Classes of lupos.engine.operators.messages.BoundVariablesMessage

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.