Examples of jjtGetNumChildren()


Examples of lupos.endpoint.client.formatreader.tsv.SimpleNode.jjtGetNumChildren()

    final QueryResult result = QueryResult.createInstance();

    try {
      final SimpleNode root = TSVParser.parse(inputStream);
      final LinkedList<Variable> vars = new LinkedList<Variable>();
      for(int i=0; i<root.jjtGetNumChildren(); i++){
        final Node child = root.jjtGetChild(i);
        if(child instanceof ASTVars){
          for(int j=0; j<child.jjtGetNumChildren(); j++){
            final Node childchild = child.jjtGetChild(j);
            if(childchild instanceof ASTVar){
View Full Code Here

Examples of lupos.endpoint.client.formatreader.tsv.SimpleNode.jjtGetNumChildren()

              vars.add(new Variable(((ASTVar)childchild).getName()));
            }
          }
        }
      }
      for(int i=0; i<root.jjtGetNumChildren(); i++){
        final Node child = root.jjtGetChild(i);
        if(child instanceof ASTOneResult){
          final Bindings bindings = bindingsFactory.createInstance();
          final Iterator<Variable> varIt = vars.iterator();
          for(int j=0; j<child.jjtGetNumChildren() && varIt.hasNext(); j++){
View Full Code Here

Examples of lupos.sparql1_1.ASTGroupConstraint.jjtGetNumChildren()

        // TripleContainer
        // or from the whole DataEditor) must be first inserted!

        final ASTGroupConstraint node = SPARQL1_1Parser.parseGroupGraphPatternsAndRDFTerms(content);

        for (int i = 0; i < node.jjtGetNumChildren(); i++) {
          final Node child = node.jjtGetChild(i);

          if (child instanceof ASTGroupConstraint) {
            final VisualQueryGenerator vqg = new VisualQueryGenerator(
                ((VisualGraphOperatorWithPrefix) this.visualGraphs
View Full Code Here

Examples of lupos.sparql1_1.ASTGroupConstraint.jjtGetNumChildren()

      System.out.println("Pasted string does not contain N3-data. Trying { (triple pattern)* } (RDF Term)* format!");

      try {
        final ASTGroupConstraint node = SPARQL1_1Parser.parseN3GroupGraphPatternsAndRDFTerms(content);

        for(int i = 0; i < node.jjtGetNumChildren(); i++) {
          final Node child = node.jjtGetChild(i);

          if(child instanceof ASTGroupConstraint) {
            final VisualDataGenerator vdg = new VisualDataGenerator(((VisualGraphOperatorWithPrefix) this.visualGraphs.get(0)).prefix);
            rdfTermToJoin.addAll((Collection<Operator>) child.jjtAccept((SPARQL1_1ParserVisitor) vdg, rdfHash));
View Full Code Here

Examples of lupos.sparql1_1.ASTSelectQuery.jjtGetNumChildren()

          final ASTSelectQuery selectChild = (ASTSelectQuery) child;

          // SELECT is not the wildcard *...
          if (!selectChild.isSelectAll()) {
            // walk through select children...
            for (int j = 0; j < selectChild.jjtGetNumChildren(); ++j) {
              final Node selectChildChild = selectChild
              .jjtGetChild(j);

              // child of select is variable...
              if (selectChildChild instanceof ASTVar) {
View Full Code Here

Examples of lupos.sparql1_1.Node.jjtGetNumChildren()

        && ((SPARQLDebugViewerCreator) debugViewerCreator).getAST() != null) {

      final Node ast = ((SPARQLDebugViewerCreator) debugViewerCreator).getAST(); // get AST

      // walk through first level children of AST...
      for (int i = 0; i < ast.jjtGetNumChildren(); ++i) {
        final Node child = ast.jjtGetChild(i); // get current child

        if (child instanceof ASTSelectQuery) {
          final ASTSelectQuery selectChild = (ASTSelectQuery) child;
View Full Code Here

Examples of lupos.sparql1_1.Node.jjtGetNumChildren()

                // add name of variable to order...
                if (!resultOrder.contains(var.getName())) {
                  resultOrder.add(var.getName());
                }
              } else if (selectChildChild instanceof ASTAs) {
                for (int j1 = 0; j1 < selectChildChild
                .jjtGetNumChildren(); ++j1) {
                  final Node selectChildChildChild = selectChildChild
                  .jjtGetChild(j1);
                  if (selectChildChildChild instanceof ASTVar) {
                    final ASTVar var = (ASTVar) selectChildChildChild;
View Full Code Here

Examples of lupos.sparql1_1.Node.jjtGetNumChildren()

    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;
      }
    }
    return ret;
  }
View Full Code Here

Examples of lupos.sparql1_1.Node.jjtGetNumChildren()

     * The returned expression is stored in the ret String
     * This way the loop will put together all predicates with every element of the correspondending ObjectList
     */
    for (int i = indexStart; i < node.jjtGetNumChildren(); i+=2) {
      final Node currentObjectList =node.jjtGetChild(i+1);
      for(int j = 0; j < currentObjectList.jjtGetNumChildren(); j++){
        final Node currentObject = currentObjectList.jjtGetChild(j);
        if(currentObject instanceof ASTBlankNodePropertyList || currentObject instanceof ASTCollection){
          ret += node.jjtGetChild(i).accept(this, subject, this.getVarOrBlankNode(currentObject)) + "\n";
          ret += this.visitChild(currentObjectList,j);
        } else {
View Full Code Here

Examples of lupos.sparql1_1.Node.jjtGetNumChildren()

  public Object evaluate(final ASTFunctionCall node, final Bindings b, final Map<Node, Object> d) throws TypeErrorException, NotBoundException {
    final Literal name = LazyLiteral.getLiteral(node.jjtGetChild(0));
    final ExternalFunction externalFunction = EvaluationVisitorImplementation.externalFunctions.get(name);
    if(externalFunction!=null){
      final Node child1 = node.jjtGetChild(1);
      final int number = child1.jjtGetNumChildren();
      final Object[] args = new Object[number];
      for(int i=0; i<number; i++){
        args[i] = child1.jjtGetChild(i).accept(this, b, d);
      }
      return externalFunction.evaluate(args);
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.