Package java.util.concurrent

Examples of java.util.concurrent.ConcurrentSkipListMap$Node


  private static void determineVariables(final Node root,
      final Set<String> variables) {
    if (root instanceof ASTSelectQuery) {
      for (int i = 0; i < root.jjtGetNumChildren(); i++) {
        final Node node = root.jjtGetChild(i);
        if (node instanceof ASTGroupConstraint)
          determineVariables(node, variables);
      }
    } else {
      if (root instanceof ASTVar) {
View Full Code Here


  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();

          // get child of PrefixDecl to get the namespace...
          final Node prefixDeclChild = child.jjtGetChild(0);

          // if child of PrefixDecl is QuotedURIRef...
          if (prefixDeclChild instanceof ASTQuotedURIRef) {
            // get namespace...
            final String namespace = ((ASTQuotedURIRef) prefixDeclChild).toQueryString();
View Full Code Here

    return msg;
  }

  public FederatedQuery(final Node federatedQuery) {
    this.federatedQuery = federatedQuery;
    final Node child0 = this.federatedQuery.jjtGetChild(0);
    if (child0 instanceof ASTVar) {
      this.endpoint = new Variable(((ASTVar) child0).getName());
    } else {
      this.endpoint = LiteralFactory.createURILiteralWithoutLazyLiteralWithoutException("<" + child0.toString() + ">");
    }
    this.variablesInServiceCall = new HashSet<Variable>();
    FederatedQuery.checkVariables(this.federatedQuery.jjtGetChild(1), this.variablesInServiceCall);
    this.surelyBoundVariablesInServiceCall = this.getSurelyBoundVariables();
  }
View Full Code Here

      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();

          // get child of PrefixDecl to get the namespace...
          final Node prefixDeclChild = child.jjtGetChild(0);

          // if child of PrefixDecl is QuotedURIRef...
          if (prefixDeclChild instanceof ASTQuotedURIRef) {
            // get namespace...
            final String namespace = ((ASTQuotedURIRef) prefixDeclChild)
View Full Code Here

        // 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
                    .get(0)).prefix);

            final Object data = child.jjtAccept(
                (SPARQL1_1ParserVisitor) vqg, rdfHash);

            result.add(data);

            final Operator newOp = (Operator) data;
View Full Code Here

  }

  public void registerElementsInPrefixInstance(final SimpleNode root) {
    // walk through children of root node...
    for (int i = 0; i < root.jjtGetNumChildren(); ++i) {
      final Node child = root.jjtGetChild(i); // get current child

      // if children is a prefix declaration...
      if (child instanceof ASTPrefixDecl) {
        // get prefix...
        final String prefixString = ((ASTPrefixDecl) child).getPrefix();

        // get child of PrefixDecl to get the name space...
        final Node prefixDeclChild = child.jjtGetChild(0);

        // if child of PrefixDecl is QuotedURIRef...
        if (prefixDeclChild instanceof ASTQuotedURIRef) {
          // get name space...
          final String namespace = ((ASTQuotedURIRef) prefixDeclChild)
View Full Code Here

public abstract class ServiceGeneratorToJoinWithOriginal extends ServiceGenerator {
  @Override
  public void insertFederatedQueryOperator(final ASTService node, final OperatorConnection connection){
    SeveralSucceedingOperators sso = new SeveralSucceedingOperators();
    BasicOperator federatedQuery = this.getFederatedQuery(node);
    Node child0 = node.jjtGetChild(0);
    if(child0 instanceof ASTVar){
      Sort sort = new Sort();
      LinkedList<Variable> listOfVars = new LinkedList<Variable>();
      listOfVars.add(new Variable(((ASTVar)child0).getName()));
      ComparatorVariables comparator = new ComparatorVariables(listOfVars);
View Full Code Here

      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));
          }
          else {
            // it is an RDF term!
            final Item item = SPARQLCoreParserVisitorImplementation.getItem(child);
View Full Code Here

      final HashMap<Item, QueryRDFTerm> rdfHash = new HashMap<Item, QueryRDFTerm>();
      final LinkedHashSet<Operator> rdfTermToJoin = new LinkedHashSet<Operator>();

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

        if (n instanceof ASTTripleSet) {
          final QueryRDFTerm rdft = (QueryRDFTerm) n.jjtAccept(
              this, rdfHash);

          rdfTermToJoin.add(rdft);

        } else if (n instanceof ASTUnionConstraint
            || n instanceof ASTGraphConstraint) {
          numberUnionOrGraphConstraints++;
        }
      }

      int numberJoinPartner = numberUnionOrGraphConstraints;

      if (rdfTermToJoin.size() > 0) {
        numberJoinPartner++;
      }

      Operator testOP = null;

      if (numberJoinPartner > 1) {
        final Join joinOp = new Join();

        int j = 0;

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

          if (n instanceof ASTUnionConstraint
              || n instanceof ASTGraphConstraint) {
            testOP = (Operator) n.jjtAccept(
                this, data);

            if (testOP != null) {
              joinOp.addSucceedingOperator(new OperatorIDTuple<Operator>(
                  testOP, j));
            }

            j++;
          }
        }

        if (rdfTermToJoin.size() > 0) {
          final TripleContainer opContainer = new TripleContainer(
              rdfTermToJoin);

          joinOp.addSucceedingOperator(new OperatorIDTuple<Operator>(
              opContainer, j));
        }

        testOP = joinOp;
      } else { // There should be only triple patterns or one
        // ASTUnionConstraint / ASTGraphConstraint
        for (int i = 0; i < node.jjtGetNumChildren(); i++) {
          final Node n = node.jjtGetChild(i);

          if (n instanceof ASTTripleSet) {
            final TripleContainer opContainer = new TripleContainer(
                rdfTermToJoin);

            testOP = opContainer;

            break;
          } else if (n instanceof ASTUnionConstraint
              || n instanceof ASTGraphConstraint) {
            testOP = (Operator) n.jjtAccept(
                this, data);

            break;
          }
        }
      }

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

        if (n instanceof ASTOptionalConstraint) {
          final Optional optional = new Optional();

          if (testOP != null) {
            optional.addSucceedingOperator(new OperatorIDTuple<Operator>(
                testOP, 0));
          }

          testOP = (Operator) n.jjtAccept(
              this, null);

          if (testOP != null) {
            optional.addSucceedingOperator(new OperatorIDTuple<Operator>(
                testOP, 1));
          }

          testOP = optional;
        }
      }

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

        Operator filterOp = null;

        if (n instanceof ASTFilterConstraint) {
          filterOp = (Operator) n.jjtAccept(
              this, data);

          if (filterOp != null) {
            filterOp.addSucceedingOperator(new OperatorIDTuple<Operator>(
                testOP, 0));
View Full Code Here

    final int numberChildren = node.jjtGetNumChildren();
    final String graphConstraint = null;

    Item item=null;

    final Node child = node.jjtGetChild(0);

    if (child instanceof ASTQuotedURIRef) {
      try {
        item = LiteralFactory.createURILiteral(((ASTQuotedURIRef) child).getQRef());
      } catch (final URISyntaxException e) {
View Full Code Here

TOP

Related Classes of java.util.concurrent.ConcurrentSkipListMap$Node

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.