Package org.apache.jena.atlas.lib

Examples of org.apache.jena.atlas.lib.InternalErrorException


    }

    private static Triple triple(NodeTable nodeTable, NodeId s, NodeId p, NodeId o)
    {
        if ( ! NodeId.isConcrete(s) )
            throw new InternalErrorException("Invalid id for subject: "+fmt(s,p,o)) ;
        if ( ! NodeId.isConcrete(p) )
            throw new InternalErrorException("Invalid id for predicate: "+fmt(s,p,o)) ;
        if ( ! NodeId.isConcrete(o) )
            throw new InternalErrorException("Invalid id for object: "+fmt(s,p,o)) ;
       
        Node sNode = nodeTable.getNodeForNodeId(s) ;
        if ( sNode == null )
            throw new InternalErrorException("Invalid id node for subject (null node): "+fmt(s,p,o)) ;

        Node pNode = nodeTable.getNodeForNodeId(p) ;
        if ( pNode == null )
        {
            nodeTable.getNodeForNodeId(p) ;
            throw new InternalErrorException("Invalid id node for predicate (null node): "+fmt(s,p,o)) ;
        }
       
        Node oNode = nodeTable.getNodeForNodeId(o) ;
        if ( oNode == null )
            throw new InternalErrorException("Invalid id node for object (null node): "+fmt(s,p,o)) ;
       
        return new Triple(sNode, pNode, oNode) ;
    }
View Full Code Here


        try {
            e = new StringEntity(content, "UTF-8");
            e.setContentType(contentType);
            execHttpPost(url, e, acceptType, handler, httpClient, httpContext, authenticator);
        } catch (UnsupportedEncodingException e1) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        } finally {
            closeEntity(e);
        }
    }
View Full Code Here

        try {
            e = new StringEntity(content, "UTF-8");
            e.setContentType(contentType);
            execHttpPut(url, e, httpClient, httpContext, authenticator);
        } catch (UnsupportedEncodingException e1) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        } finally {
            closeEntity(e);
        }
    }
View Full Code Here

            for (Pair p : params.pairs())
                nvps.add(new BasicNameValuePair(p.getName(), p.getValue()));
            HttpEntity e = new UrlEncodedFormEntity(nvps, "UTF-8");
            return e;
        } catch (UnsupportedEncodingException e) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        }
    }
View Full Code Here

    public BlankNodeAllocatorHash() {
        reset() ;
        try {
            mDigest = MessageDigest.getInstance(DigestAlgorithm) ;
        } catch (NoSuchAlgorithmException e) {
            throw new InternalErrorException("failed to create message digest", e) ;
        }

        Getter<String, Node> getter = new Getter<String, Node>() {
            @Override
            public Node get(String key) {
View Full Code Here

   
    /** Get a B object for an A object in scope S object */
    public B get(S scope, A item)
    {
        if ( item == null )
            throw new InternalErrorException("null in MapWithScope.get(,null)") ;
       
        Map<A, B> map = scopePolicy.getScope(scope) ;
        if ( map == null )
            // No map - no item->allocation tracking.
            return allocator.alloc(scope, item) ;
View Full Code Here

        {
            if ( node.isURI() )         return labelForURI(node) ;
            if ( node.isLiteral() )     return labelForLiteral(node) ;
            if ( node.isBlank() )       return labelForBlank(node) ;
            if ( node.isVariable() )    return labelForVar(node) ;
            throw new InternalErrorException("Node type not supported: "+node) ;
        }
View Full Code Here

   
    public BlankNodeAllocatorHash()
    {
        reset() ;
        try { mDigest = MessageDigest.getInstance(DigestAlgorithm) ; }
        catch (NoSuchAlgorithmException e) { throw new InternalErrorException("failed to create message digest", e) ; }
       
        Getter<String, Node> getter = new Getter<String, Node>() {
            @Override public Node get(String key) { return alloc(key) ; }
        } ;
        Cache<String, Node> cache1 = CacheFactory.createCache(CacheSize) ;
View Full Code Here

   
    /** Get a B object for an A object in scope S object */
    public B get(S scope, A item)
    {
        if ( item == null )
            throw new InternalErrorException("null in MapWithScope.get(,null)") ;
       
        Map<A, B> map = scopePolicy.getScope(scope) ;
        if ( map == null )
            // No map - no item->allocation tracking.
            return allocator.alloc(item) ;
View Full Code Here

        {
            if ( node.isURI() )         return labelForURI(node) ;
            if ( node.isLiteral() )     return labelForLiteral(node) ;
            if ( node.isBlank() )       return labelForBlank(node) ;
            if ( node.isVariable() )    return labelForVar(node) ;
            throw new InternalErrorException("Node type not supported: "+node) ;
        }
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.lib.InternalErrorException

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.