Package org.openrdf.query.parser.sparql.ast

Examples of org.openrdf.query.parser.sparql.ast.VisitorException


      String prefix = qname.substring(0, colonIdx);
      String localName = qname.substring(colonIdx + 1);

      String namespace = prefixMap.get(prefix);
      if (namespace == null) {
        throw new VisitorException("QName '" + qname + "' uses an undefined prefix");
      }

      // Replace the qname node with a new IRI node in the parent node
      ASTIRI iriNode = new ASTIRI(SyntaxTreeBuilderTreeConstants.JJTIRI);
      iriNode.setValue(namespace + localName);
View Full Code Here


    try {
      uri = valueFactory.createURI(node.getValue());
    }
    catch (IllegalArgumentException e) {
      // invalid URI
      throw new VisitorException(e.getMessage());
    }

    return new ValueConstant(uri);
  }
View Full Code Here

  @Override
  public Object visit(ASTQName node, Object data)
    throws VisitorException
  {
    throw new VisitorException("QNames must be resolved before building the query model");
  }
View Full Code Here

  @Override
  public Object visit(ASTBlankNode node, Object data)
    throws VisitorException
  {
    throw new VisitorException(
        "Blank nodes must be replaced with variables before building the query model");
  }
View Full Code Here

      try {
        datatype = valueFactory.createURI(datatypeNode.getValue());
      }
      catch (IllegalArgumentException e) {
        // invalid URI
        throw new VisitorException(e.getMessage());
      }
      literal = valueFactory.createLiteral(label, datatype);
    }
    else if (lang != null) {
      literal = valueFactory.createLiteral(label, lang);
View Full Code Here

      if (bnodeID == null) {
        return null;
      }
      String varName = conversionMap.get(bnodeID);
      if (varName == null && usedBNodeIDs.contains(bnodeID)) {
        throw new VisitorException("BNodeID already used in another scope: " + bnodeID);
      }
      return varName;
    }
View Full Code Here

    private String findVarName(String bnodeID) throws VisitorException {
      if (bnodeID == null)
        return null;
      String varName = conversionMap.get(bnodeID);
      if (varName == null && usedBNodeIDs.contains(bnodeID))
        throw new VisitorException(
            "BNodeID already used in another scope: " + bnodeID);
      return varName;
    }
View Full Code Here

      String prefix = qname.substring(0, colonIdx);
      String localName = qname.substring(colonIdx + 1);

      String namespace = prefixMap.get(prefix);
      if (namespace == null) {
        throw new VisitorException("QName '" + qname + "' uses an undefined prefix");
      }

      // Replace the qname node with a new IRI node in the parent node
      ASTIRI iriNode = new ASTIRI(SyntaxTreeBuilderTreeConstants.JJTIRI);
      iriNode.setValue(namespace + localName);
View Full Code Here

        value = SPARQLUtil.decodeString(value);
        stringNode.setValue(value);
      }
      catch (IllegalArgumentException e) {
        // Invalid escape sequence
        throw new VisitorException(e.getMessage());
      }

      return super.visit(stringNode, data);
    }
View Full Code Here

  @Override
  public Object visit(ASTQName node, Object data)
    throws VisitorException
  {
    throw new VisitorException("QNames must be resolved before building the query model");
  }
View Full Code Here

TOP

Related Classes of org.openrdf.query.parser.sparql.ast.VisitorException

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.