Package lupos.sparql1_1

Examples of lupos.sparql1_1.Node.jjtGetNumChildren()


  }

  protected boolean handleInAndNotIn(final Node node, final Bindings b, final Map<Node, Object> d) throws NotBoundException, TypeErrorException {
    final Object arg1 = Helper.unlazy(this.resultOfChildZero(node, b, d));
    final Node child1 = node.jjtGetChild(1);
    for(int i=0; i<child1.jjtGetNumChildren(); i++) {
      final Object arg2 = Helper.unlazy(child1.jjtGetChild(i).accept(this, b, d));
      if(Helper.equals(arg1, arg2)) {
        return true;
      }
    }
View Full Code Here


  }

  @Override
  public Object evaluate(final ASTCoalesceFuncNode node, final Bindings b, final Map<Node, Object> d) throws NotBoundException, TypeErrorException {
    final Node child0 = node.jjtGetChild(0);
    for(int i=0; i<child0.jjtGetNumChildren(); i++){
      try {
        return Helper.unlazy(child0.jjtGetChild(i).accept(this, b, d));
      } catch(final Error e){
        // ignore...
      } catch(final Exception e){
View Full Code Here

    // Dealing with the HAVING clause
    for (int i = 0; i < numberChildren; i++) {
      final Node childi = node.jjtGetChild(i);
      if (childi instanceof ASTHaving) {
        for (int k = 0; k < childi.jjtGetNumChildren(); k++) {
          if (childi.jjtGetChild(k) instanceof ASTFilterConstraint) {
            final Having filter = new Having((ASTFilterConstraint) childi
                .jjtGetChild(k));
            this.processExistChildren(node, graphConstraint, filter);
            filter.setEvaluator(this.evaluator);
View Full Code Here

      final LinkedList<AddComputedBinding> listOfAddComputedBindings = new LinkedList<AddComputedBinding>();
      ASTVar variable = null;
      final Node childi = node.jjtGetChild(j);
      onlyAggregations = true;
      if (childi instanceof ASTGroup) {
        for (int i = 0; i < childi.jjtGetNumChildren(); i++) {
          if (childi.jjtGetChild(i) instanceof ASTAdditionNode
              || childi.jjtGetChild(i) instanceof ASTSubtractionNode
              || childi.jjtGetChild(i) instanceof ASTMultiplicationNode
              || childi.jjtGetChild(i) instanceof ASTDivisionNode) {
            throw new Error(
View Full Code Here

        literal = (allowLazyLiteral) ? LiteralFactory
            .createLiteral(content) : LiteralFactory
            .createLiteralWithoutLazyLiteral(content);
      }
    } else if (n instanceof ASTDoubleCircumflex) {
      if (n.jjtGetNumChildren() != 2) {
        System.err.println(n + " is expected to have 2 children!");
      } else {
        final String content = getLiteral(n.jjtGetChild(0), false).toString();
        final String type = getLiteral(n.jjtGetChild(1), false).toString();
View Full Code Here

  @Override
  public DebugContainerQuery<BasicOperatorByteArray, Node> compileQueryDebugByteArray(
      final String query, final Prefix prefixInstance) throws ParseException {
    final SimpleNode root = StreamSPARQL1_1Parser.parse(query);
    if(root!=null){
      for (int i = 0; i < root.jjtGetNumChildren(); ++i) {
        final Node child = root.jjtGetChild(i); // get current child

        if (child instanceof ASTPrefixDecl) {
          // get prefix...
          final String prefix = ((ASTPrefixDecl) child).getPrefix();
View Full Code Here

    if (this.rdfs == RDFS.OPTIMIZEDRDFS || this.rdfs == RDFS.OPTIMIZEDRUDIMENTARYRDFS || this.rdfs == RDFS.OPTIMIZEDALTERNATIVERDFS) {
      dcq = this.rdfsStreamQueryToIndexQueryDebugByteArray(query, root_param, prefixInstance);
    } else {
      final SimpleNode root = SPARQL1_1Parser.parse(query);

      for (int i = 0; i < root.jjtGetNumChildren(); ++i) {
        final Node child = root.jjtGetChild(i); // get current child

        if (child instanceof ASTPrefixDecl) {
          // get prefix...
          final String prefix = ((ASTPrefixDecl) child).getPrefix();
View Full Code Here

    n.jjtSetParent(parent);
    this.applyRules(node);
    String ret = "";
    final String prefix = (parent instanceof ASTOrderConditions || parent instanceof ASTHaving)? "" : "FILTER";
    final String postfix = (parent instanceof ASTOrderConditions || parent instanceof ASTHaving)? "" : ".\n";
    final int numberOfChildren = n.jjtGetNumChildren();
    for (int i = 0; i < numberOfChildren; i++) {
      final Node currentChild=n.jjtGetChild(i);
      for(int j=0; j<currentChild.jjtGetNumChildren();j++){
        ret += prefix + "(" + this.visitChild(currentChild, j) + ")"+postfix;
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.