Package com.hp.hpl.jena.sparql.lang.sparql_11

Examples of com.hp.hpl.jena.sparql.lang.sparql_11.ParseException


        _parse(sink, r) ;
    }
   
    private void _parse(UpdateSink sink, Reader r)
    {
        SPARQLParser11 parser = null ;
        try {
            parser = new SPARQLParser11(r) ;
            parser.setUpdateSink(sink) ;
            parser.UpdateUnit() ;
        }
        catch (com.hp.hpl.jena.sparql.lang.sparql_11.ParseException ex)
        {
            throw new QueryParseException(ex.getMessage(),
                                          ex.currentToken.beginLine,
View Full Code Here


     *            Arguments
     * @throws ParseException
     *             Thrown if the expression string is not valid syntax
     */
    public void add(String uri, String expr, List<Var> args) throws ParseException {
        Expr e = new SPARQLParser11(new StringReader(expr)).Expression();
        if (!preserveDependencies) {
            // If not allowing dependencies expand expression fully
            e = ExprTransformer.transform(new ExprTransformExpand(this.definitions), e);
        }

View Full Code Here

   
    // All throwable handling.
    private static void perform(Query query, String string, Action action)
    {
        Reader in = new StringReader(string) ;
        SPARQLParser11 parser = new SPARQLParser11(in) ;

        try {
            query.setStrict(true) ;
            parser.setQuery(query) ;
            action.exec(parser) ;
        }
        catch (com.hp.hpl.jena.sparql.lang.sparql_11.ParseException ex)
        {
            throw new QueryParseException(ex.getMessage(),
View Full Code Here

     *            Arguments
     * @throws ParseException
     *             Thrown if the expression string is not valid syntax
     */
    public void add(String uri, String expr, List<Var> args) throws ParseException {
        Expr e = new SPARQLParser11(new StringReader(expr)).Expression();
        if (!preserveDependencies) {
            // If not allowing dependencies expand expression fully
            e = ExprTransformer.transform(new ExprTransformExpand(this.definitions), e);
        }

View Full Code Here

   
    // All throwable handling.
    private static void perform(Query query, String string, Action action)
    {
        Reader in = new StringReader(string) ;
        SPARQLParser11 parser = new SPARQLParser11(in) ;

        try {
            query.setStrict(true) ;
            parser.setQuery(query) ;
            action.exec(parser) ;
        }
        catch (com.hp.hpl.jena.sparql.lang.sparql_11.ParseException ex)
        {
            throw new QueryParseException(ex.getMessage(),
View Full Code Here

        return _parse(update, r) ;
    }
   
    private UpdateRequest _parse(UpdateRequest update, Reader r)
    {
        SPARQLParser11 parser = null ;
        try {
            parser = new SPARQLParser11(r) ;
            parser.setUpdateRequest(update) ;
            parser.UpdateUnit() ;
            validateParsedUpdate(update) ;
            return update ;
        }
        catch (com.hp.hpl.jena.sparql.lang.sparql_11.ParseException ex)
        {
View Full Code Here

     * @param expr Expression String (in SPARQL syntax)
     * @param args Arguments
     * @throws ParseException Thrown if the expression string is not valid syntax
     */
    public void add(String uri, String expr, List<Var> args) throws ParseException {
        Expr e = new SPARQLParser11(new StringReader(expr)).Expression();
        if (!preserveDependencies) {
            //If not allowing dependencies expand expression fully
            e = ExprTransformer.transform(new ExprTransformExpand(this.definitions), e);
       
       
View Full Code Here

      if (mode == EvaluationMode.DEMO) {
        this.enableOrDisableButtons(queryOrRif);
      }
      return true;
    } else if (e instanceof ParseException) {
      final ParseException pe = (ParseException) e;
      this.displayErrorMessage(pe.getMessage(), false, queryOrRif);

      int line;
      int column;

      // get precise line and column...
      if (pe.currentToken.next == null) {
        line = pe.currentToken.beginLine;
        column = pe.currentToken.beginColumn;
      } else {
        line = pe.currentToken.next.beginLine;
        column = pe.currentToken.next.beginColumn;
      }

      this.setErrorPosition(line, column, queryOrRif);
      if (mode == EvaluationMode.DEMO) {
        this.enableOrDisableButtons(queryOrRif);
      }
      return true;
    } else if(e instanceof lupos.rif.generated.parser.ParseException){
      final lupos.rif.generated.parser.ParseException pe = (lupos.rif.generated.parser.ParseException) e;
      this.displayErrorMessage(pe.getMessage(), false, queryOrRif);

      int line;
      int column;

      // get precise line and column...
View Full Code Here

  public void handleParseError(Throwable t) throws ModificationException {
    int line = 0;
    int column = 0;

    if(t instanceof ParseException) {
      ParseException pe = (ParseException) t;

      // get precise line and column...
      if(pe.currentToken.next == null) {
        line = pe.currentToken.beginLine;
        column = pe.currentToken.beginColumn;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.lang.sparql_11.ParseException

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.