Package org.openjena.atlas.lib

Examples of org.openjena.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


    @Override
    public void finishPair(long currLine, long currCol)
    {
        if ( value == null )
            throw new InternalErrorException("null for 'value' (bad finishPair() allignment)") ;
       
        String k = keys.pop();
        JsonObject obj = objects.peek() ;
        if ( obj.hasKey(k) )
            Log.warn("JSON", "Duplicate key '"+k+"' for object ["+currLine+","+currCol+"]") ;
View Full Code Here

    @Override
    public void finishPair(long currLine, long currCol)
    {
        if ( value == null )
            throw new InternalErrorException("null for 'value' (bad finishPair() allignment)") ;
       
        String k = keys.pop();
        JsonObject obj = objects.peek() ;
        if ( obj.hasKey(k) )
            Log.warn("JSON", "Duplicate key '"+k+"' for object ["+currLine+","+currCol+"]") ;
View Full Code Here

    }

    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

            {
                Model model = ModelFactory.createDefaultModel() ;
                for ( String uri : graphURLs )
                {
                    if ( uri == null || uri.equals("") )
                        throw new InternalErrorException("Default graph URI is null or the empty string";

                    try {
                        //TODO Clearup - RIOT integration.
                        GraphLoadUtils.loadModel(model, uri, MaxTriples) ;
                        log.info(format("[%d] Load (default graph) %s", action.id, uri)) ;
                    } catch (RiotException ex) {
                        log.info(format("[%d] Parsing error loading %s: %s", action.id, uri, ex.getMessage())) ;
                        errorBadRequest("Failed to load URL (parse error) "+uri+" : "+ex.getMessage()) ;
                    } catch (Exception ex)
                    {
                        log.info(format("[%d] Failed to load (default) %s: %s", action.id, uri, ex.getMessage())) ;
                        errorBadRequest("Failed to load URL "+uri) ;
                    }
                }
                dataset.setDefaultModel(model) ;
            }
            // ---- Named graphs
            if ( namedGraphs != null )
            {
                for ( String uri : namedGraphs )
                {
                    if ( uri == null || uri.equals("") )
                        throw new InternalErrorException("Named graph URI is null or the empty string";

                    try {
                        Model model = ModelFactory.createDefaultModel() ;
                        GraphLoadUtils.loadModel(model, uri, MaxTriples) ;
                        log.info(format("[%d] Load (named graph) %s", action.id, uri)) ;
View Full Code Here

            {
                Model model = ModelFactory.createDefaultModel() ;
                for ( String uri : graphURLs )
                {
                    if ( uri == null || uri.equals("") )
                        throw new InternalErrorException("Default graph URI is null or the empty string";

                    try {
                        //TODO Clearup - RIOT integration.
                        GraphLoadUtils.loadModel(model, uri, MaxTriples) ;
                        log.info(format("[%d] Load (default graph) %s", action.id, uri)) ;
                    } catch (RiotException ex) {
                        log.info(format("[%d] Parsing error loading %s: %s", action.id, uri, ex.getMessage())) ;
                        errorBadRequest("Failed to load URL (parse error) "+uri+" : "+ex.getMessage()) ;
                    } catch (Exception ex)
                    {
                        log.info(format("[%d] Failed to load (default) %s: %s", action.id, uri, ex.getMessage())) ;
                        errorBadRequest("Failed to load URL "+uri) ;
                    }
                }
                dataset.setDefaultModel(model) ;
            }
            // ---- Named graphs
            if ( namedGraphs != null )
            {
                for ( String uri : namedGraphs )
                {
                    if ( uri == null || uri.equals("") )
                        throw new InternalErrorException("Named graph URI is null or the empty string";

                    try {
                        Model model = ModelFactory.createDefaultModel() ;
                        GraphLoadUtils.loadModel(model, uri, MaxTriples) ;
                        log.info(format("[%d] Load (named graph) %s", action.id, uri)) ;
View Full Code Here

TOP

Related Classes of org.openjena.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.