Package com.hp.hpl.jena.sparql

Examples of com.hp.hpl.jena.sparql.ARQInternalErrorException


    private static boolean checkValidPrefixName(String prefixedName)
    {
        // Split it to get the parts.
        int i = prefixedName.indexOf(':') ;
        if ( i < 0 )
            throw new ARQInternalErrorException("Broken short form -- "+prefixedName) ;
        String p = prefixedName.substring(0,i) ;
        String x = prefixedName.substring(i+1) ;
        // Check legality
        if ( checkValidPrefix(p) && checkValidLocalname(x) )
            return true ;
View Full Code Here


            if ( funcOp instanceof E_NotExists )
                fn = "NOT EXISTS" ;
            else if ( funcOp instanceof E_Exists )
                fn = "EXISTS" ;
            else
                throw new ARQInternalErrorException("Unrecognized ExprFunctionOp: "+fn) ;
           
            FormatterElement fmtElt = new FormatterElement(out, context) ;
            out.print(fn) ;
            out.print(" ") ;
            Element el = funcOp.getElement() ;
View Full Code Here

    static public Class<?> loadClass(String classNameOrURI) { return loadClass(classNameOrURI, null) ; }
   
    static public Class<?> loadClass(String classNameOrURI, Class<?> requiredClass)
    {
        if ( classNameOrURI == null )
            throw new ARQInternalErrorException("Null classNameorIRI") ;
       
        if ( classNameOrURI.startsWith("http:") )
            return null ;
        if ( classNameOrURI.startsWith("urn:") )
            return null ;
View Full Code Here

        // No URIs, no blanks nodes by this point
        // And a pair of literals was filterd out first.

        // Should not happen.
        throw new ARQInternalErrorException("Compare: "+node1+"  "+node2) ;
    }
View Full Code Here

   
    private static int compareLiteralsBySyntax(Node node1, Node node2)
    {
        if ( node1 == null || ! node1.isLiteral() ||
        node2 == null || ! node2.isLiteral() )
            throw new ARQInternalErrorException("compareLiteralsBySyntax called with non-literal: ("+node1+","+node2+")") ;

        if ( node1.equals(node2) )
            return Expr.CMP_EQUAL ;

        String lex1 = node1.getLiteralLexicalForm() ;
        String lex2 = node2.getLiteralLexicalForm() ;
       
        int x = StrUtils.strCompare(lex1, lex2) ;
        if ( x != Expr.CMP_EQUAL )
            return x ;
        // Same lexical form. Not .equals()
       
        String lang1 = node1.getLiteralLanguage() ;
        String lang2 = node2.getLiteralLanguage() ;
       
        String dt1 = node1.getLiteralDatatypeURI() ;
        String dt2 = node2.getLiteralDatatypeURI() ;

        if ( lang1 == null )
            throw new ARQInternalErrorException("Language tag is null: "+node1) ;
        if ( lang2 == null )
            throw new ARQInternalErrorException("Language tag is null: "+node2) ;
       
        if ( simpleLiteral(node1) )
            // Node 2 can't be simple because they'd be the same
            return Expr.CMP_LESS ;

        if ( simpleLiteral(node2) )
            return Expr.CMP_GREATER ;
       
        // Neither simple.
       
        // Language before datatypes.
        // Can't both be no lang, no datatype
        // because they are already same lexcial form
        // so they'd be same simple literal.
       
        if ( ! lang1.equals("") && dt2 != null )
            return Expr.CMP_LESS ;
       
        if ( dt1 != null && ! lang2.equals("") )
            return Expr.CMP_GREATER ;
       
        // Both language tags, or both datatypes
       
        if ( dt1 == null && dt2 == null )
        {
              // Syntactic - lang tags case considered
              // case sensitive if necessary
              x = StrUtils.strCompareIgnoreCase(lang1, lang2) ;
              if ( x != Expr.CMP_EQUAL )
                  return x ;
              x = StrUtils.strCompare(lang1, lang2) ;
              if ( x != Expr.CMP_EQUAL )
                  return x ;
              throw new ARQInternalErrorException("compareLiteralsBySyntax: lexical form and languages tags identical on non.equals literals");
        }
       
        // Two datatypes.
        return StrUtils.strCompare(dt1, dt2) ;
    }
View Full Code Here

    final
    public QueryIterator iterator()
    {
        if ( iteratorProduced )
        {
            throw new ARQInternalErrorException("Attempt to use the iterator twice") ;
        }
        iteratorProduced = true ;
        return iteratorOnce() ;
    }
View Full Code Here

            case OP_FLOAT:
                // TODO Should squaring a float keep it a float?
            case OP_DOUBLE:
                return NodeValue.makeDouble( Math.pow(v.getDouble(), 3d) ) ;
            default:
                throw new ARQInternalErrorException("Unrecognized numeric operation : "+v) ;
        }
    }
View Full Code Here

            case OP_DECIMAL:
            case OP_FLOAT:
            case OP_DOUBLE:
                return NodeValue.makeDouble( Math.exp(v.getDouble()) ) ;
            default:
                throw new ARQInternalErrorException("Unrecognized numeric operation : "+v) ;
        }
    }
View Full Code Here

            case OP_FLOAT:
                // TODO Should squaring a float keep it a float?
            case OP_DOUBLE:
                return NodeValue.makeDouble( Math.pow(v.getDouble(), 2d) ) ;
            default:
                throw new ARQInternalErrorException("Unrecognized numeric operation : "+v) ;  
        }
    }
View Full Code Here

            case OP_FLOAT:
                // TODO Should raising a float to a power keep it a float?
            case OP_DOUBLE:
                return NodeValue.makeDouble( Math.pow(v1.getDouble(), v2.getDouble()) ) ;
            default:
                throw new ARQInternalErrorException("Unrecognized numeric operation : "+ v1) ;
        }
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.ARQInternalErrorException

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.