Tabnine Logo
Or.getLeftArg
Code IndexAdd Tabnine to your IDE (free)

How to use
getLeftArg
method
in
org.openrdf.query.algebra.Or

Best Java code snippets using org.openrdf.query.algebra.Or.getLeftArg (Showing top 10 results out of 315)

origin: org.openrdf.sesame/sesame-queryalgebra-evaluation

@Override
public void meet(Or or) {
  super.meet(or);
  if (or.getLeftArg().equals(or.getRightArg())) {
    or.replaceWith(or.getLeftArg());
  }
}
origin: apache/marmotta

@Override
public void meet(Or node) throws RuntimeException {
  builder.append("(");
  node.getLeftArg().visit(this);
  builder.append(" OR ");
  node.getRightArg().visit(this);
  builder.append(")");
}
origin: org.openrdf.sesame/sesame-sail-rdbms

@Override
public void meet(Or node)
  throws UnsupportedRdbmsOperatorException
{
  result = or(bool(node.getLeftArg()), bool(node.getRightArg()));
}
origin: eu.fbk.knowledgestore/ks-server

@Override
public void meet(final Or n) {
  final QueryModelNode p = n.getParentNode();
  final boolean needPar = p instanceof Not || p instanceof And || p instanceof MathExpr
      || p instanceof ListMemberOperator || p instanceof Compare;
  emitIf(needPar, "(").emit(n.getLeftArg()).emit(" || ").emit(n.getRightArg())
      .emitIf(needPar, ")");
}
origin: org.openrdf.sesame/sesame-spin

@Override
public void meet(Or node)
  throws RDFHandlerException
{
  Resource currentSubj = subject;
  flushPendingStatement();
  handler.handleStatement(valueFactory.createStatement(subject, RDF.TYPE, SP.OR));
  predicate = SP.ARG1_PROPERTY;
  node.getLeftArg().visit(this);
  predicate = SP.ARG2_PROPERTY;
  node.getRightArg().visit(this);
  subject = currentSubj;
  predicate = null;
}
origin: eu.fbk.rdfpro/rdfpro-rules

@Override
public void meet(final Or n) {
  final QueryModelNode p = n.getParentNode();
  final boolean needPar = p instanceof Not || p instanceof And || p instanceof MathExpr
      || p instanceof ListMemberOperator || p instanceof Compare;
  emitIf(needPar, "(").emit(n.getLeftArg()).emit(" || ").emit(n.getRightArg())
      .emitIf(needPar, ")");
}
origin: org.openrdf.sesame/sesame-queryalgebra-evaluation

if (isConstant(or.getLeftArg()) && isConstant(or.getRightArg())) {
  boolean value = strategy.isTrue(or, EmptyBindingSet.getInstance());
  or.replaceWith(new ValueConstant(BooleanLiteral.valueOf(value)));
else if (isConstant(or.getLeftArg())) {
  boolean leftIsTrue = strategy.isTrue(or.getLeftArg(), EmptyBindingSet.getInstance());
  if (leftIsTrue) {
    or.replaceWith(new ValueConstant(BooleanLiteral.TRUE));
    or.replaceWith(or.getLeftArg());
origin: org.openrdf.sesame/sesame-queryalgebra-evaluation

  private boolean containsSameTerm(ValueExpr node) {
    if (node instanceof SameTerm) {
      return true;
    }
    if (node instanceof Or) {
      Or or = (Or)node;
      boolean left = containsSameTerm(or.getLeftArg());
      return left || containsSameTerm(or.getRightArg());
    }
    if (node instanceof And) {
      And and = (And)node;
      boolean left = containsSameTerm(and.getLeftArg());
      return left || containsSameTerm(and.getRightArg());
    }
    return false;
  }
}
origin: org.openrdf.sesame/sesame-queryalgebra-evaluation

public Value evaluate(Or node, BindingSet bindings)
  throws ValueExprEvaluationException, QueryEvaluationException
{
  try {
    Value leftValue = evaluate(node.getLeftArg(), bindings);
    if (QueryEvaluationUtil.getEffectiveBooleanValue(leftValue) == true) {
      // Left argument evaluates to true, we don't need to look any
      // further
      return BooleanLiteral.TRUE;
    }
  }
  catch (ValueExprEvaluationException e) {
    // Failed to evaluate the left argument. Result is 'true' when
    // the right argument evaluates to 'true', failure otherwise.
    Value rightValue = evaluate(node.getRightArg(), bindings);
    if (QueryEvaluationUtil.getEffectiveBooleanValue(rightValue) == true) {
      return BooleanLiteral.TRUE;
    }
    else {
      throw new ValueExprEvaluationException();
    }
  }
  // Left argument evaluated to 'false', result is determined
  // by the evaluation of the right argument.
  Value rightValue = evaluate(node.getRightArg(), bindings);
  return BooleanLiteral.valueOf(QueryEvaluationUtil.getEffectiveBooleanValue(rightValue));
}
origin: org.openrdf.sesame/sesame-queryalgebra-evaluation

@Override
public void meet(Filter filter) {
  if (filter.getCondition() instanceof Or && containsSameTerm(filter.getCondition())) {
    Or orNode = (Or)filter.getCondition();
    TupleExpr filterArg = filter.getArg();
    ValueExpr leftConstraint = orNode.getLeftArg();
    ValueExpr rightConstraint = orNode.getRightArg();
    // remove filter
    filter.replaceWith(filterArg);
    // Push UNION down below other filters to avoid cloning them
    TupleExpr node = findNotFilter(filterArg);
    Filter leftFilter = new Filter(node.clone(), leftConstraint);
    Filter rightFilter = new Filter(node.clone(), rightConstraint);
    Union union = new Union(leftFilter, rightFilter);
    node.replaceWith(union);
    filter.getParentNode().visit(this);
  }
  else {
    super.meet(filter);
  }
}
org.openrdf.query.algebraOrgetLeftArg

Popular methods of Or

  • <init>
  • getRightArg
  • getParentNode
  • replaceWith
  • visitChildren

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • setScale (BigDecimal)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now