Package com.google.common.collect

Examples of com.google.common.collect.BstTesting$SimpleNode


    this.items = items;
  }

  public void addPredicate(RDFTerm child, String predicate) throws ModificationException {
    try {
      SimpleNode node = SPARQL1_1Parser.parseVerbWithoutVar(predicate, this.prefix.getPrefixNames());

      this.addPredicate(child, this.getItem(node));
    }
    catch(Throwable t) {
      this.handleParseError(t);
View Full Code Here


  private static String determineNewQuery(final String oldQuery,
      final SPARQLParserVisitorImplementationDumper spvid) {
    try {
      // get root node...
      final SimpleNode root = SPARQL1_1Parser.parse(oldQuery);
      return (String) spvid.visit(root);
    } catch (final ParseException e) {
      System.out.println(e);
      e.printStackTrace();
    }
View Full Code Here

  }

  private static String determineNewQueryProjectionWithoutVariable(
      final String oldQuery, final Variable v) {
    try {
      final SimpleNode root = SPARQL1_1Parser.parse(oldQuery);
      return determineNewQuery(oldQuery,
          new SPARQLParserVisitorImplementationDumper() {
        @Override
        public String visit(final ASTSelectQuery node) {
          String ret = "SELECT ";
View Full Code Here

    });
  }

  private String refineQuery(final String oldQuery, final Variable toBeRefined) {
    try {
      final SimpleNode root = SPARQL1_1Parser.parse(oldQuery);
      final HashSet<String> variables = new HashSet<String>();
      determineVariables(root, variables);
      String varSO = "SO";
      while (variables.contains(varSO))
        varSO += "a";
View Full Code Here

    });
  }

  private static HashSet<String> determineVariables(final String query) {
    try {
      final SimpleNode root = SPARQL1_1Parser.parse(query);
      final HashSet<String> variables = new HashSet<String>();
      determineVariables(root, variables);
      return variables;
    } catch (final ParseException e) {
      System.out.println(e);
View Full Code Here

  private static String determineNewQueryRenamedVariable(
      final String currentBrowserQuery, final Variable toBeRenamed,
      String newName) {
    try {
      final SimpleNode root = SPARQL1_1Parser.parse(currentBrowserQuery);

      try {
        SPARQL1_1Parser.parseVar(newName);
      } catch (final Throwable e) {
        try {
View Full Code Here

  }

  @Override
  public long compileQuery(final String query) throws ParseException {
    final Date a = new Date();
    SimpleNode root = StreamSPARQL1_1Parser.parse(query);
    try {
      final SPARQL2CoreSPARQLParserVisitorImplementationDumper spvid = SPARQL2CoreSPARQLParserVisitorImplementationDumper.createInstance();
      final String corequery = (root==null)?"":(String) spvid.visit(root);
      root = StreamSPARQL1_1Parser.parse(corequery);
      // checkForTimeFunc(root);
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();

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

            // add namespace and prefix to predefined list
            // of prefix instance...
            prefixInstance.getPredefinedList().put(namespace, prefix);
          }
        }
      }
    }

    SPARQL2CoreSPARQLParserVisitorImplementationDumper spvid;
    try {
      spvid = SPARQL2CoreSPARQLParserVisitorImplementationDumper.createInstance();
      final String corequery = (root==null)?"":(String) spvid.visit(root);

      final SimpleNode rootCoreSPARQL = StreamSPARQL1_1Parser.parse(corequery);

      // checkForTimeFunc(rootCoreSPARQL);

      final StreamOperatorGraphGenerator spvi = StreamOperatorGraphGenerator.createOperatorGraphGenerator(this);
      spvi.visit((ASTQuery)rootCoreSPARQL);
View Full Code Here

    this.rootNode = root_param;
    if (this.rdfs == RDFS.OPTIMIZEDRDFS || this.rdfs == RDFS.OPTIMIZEDRUDIMENTARYRDFS
        || this.rdfs == RDFS.OPTIMIZEDALTERNATIVERDFS) {
      this.rdfsStreamQueryToIndexQuery(query, root_param);
    } else {
      SimpleNode root = SPARQL1_1Parser.parse(query);

      final SPARQL2CoreSPARQLParserVisitorImplementationDumper spvid = SPARQL2CoreSPARQLParserVisitorImplementationDumper.createInstance();
      final String corequery = (root==null)?"":(String) spvid.visit(root);

      root = SPARQL1_1Parser.parse(corequery);
View Full Code Here

    final DebugContainerQuery<BasicOperatorByteArray, Node> dcq;
    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();

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

            // add namespace and prefix to predefined list
            // of prefix instance...
            prefixInstance.getPredefinedList().put(namespace,
                prefix);
          }
        }
      }

      final SPARQL2CoreSPARQLParserVisitorImplementationDumper spvid = SPARQL2CoreSPARQLParserVisitorImplementationDumper.createInstance();

      final String corequery = (root==null)?"":(String) spvid.visit(root);

      final SimpleNode root_CoreSPARQL = SPARQL1_1Parser.parse(corequery);

      if(root_CoreSPARQL==null){
        this.result = new Result();
        root_param.setSucceedingOperator(new OperatorIDTuple(this.result,0));
      } else {
View Full Code Here

TOP

Related Classes of com.google.common.collect.BstTesting$SimpleNode

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.