Package arq.cmd

Examples of arq.cmd.CmdException


    @Override
    protected void processModulesAndArgs()
    {
        if ( getNumPositional() > )
            throw new CmdException("No position arguments (specify DB in spec file or with --dbName DB") ;
    }
View Full Code Here


            else if ( arg.equalsIgnoreCase("Op"))       { printOp = true ; }
            else if ( arg.equalsIgnoreCase("SqlNode"))  { printSqlNode = true ; }
            else if ( arg.equalsIgnoreCase("sql"))      { printSQL = true ; }
            else if ( arg.equalsIgnoreCase("plan"))     { printPlan = true ; }
            else
                throw new CmdException("Not a recognized print form: "+arg+" : Choices are: query, prefix, op, sqlNode, sql") ;
        }
    }
View Full Code Here

                    thing = (Dataset)AssemblerUtils.build( modAssembler.getAssemblerFile(), DatasetAssemblerVocab.tDataset) ;
            }
            catch (ARQException ex)     { throw ex; }
            catch (JenaException ex)    { throw ex ; }
            catch (Exception ex)
            { throw new CmdException("Error creating", ex) ; }
            return thing ;
        }
       
        if ( modAssembler.getLocation() == null )
            throw new CmdException("No assembler file nor location provided") ;
       
        // No assembler - use location to find a database.
        Dataset ds = TDBFactory.createDataset(modAssembler.getLocation()) ;
        return ds ;
    }
View Full Code Here

       
        if ( graphName != null )
        {
            Model m = ds.getNamedModel(graphName) ;
            if ( m == null )
                throw new CmdException("No such named graph (is this a TDB dataset?)") ;
            return m ;
        }
        else
            return ds.getDefaultModel() ;
    }
View Full Code Here

            else if ( arg.equalsIgnoreCase("opt"))      { printOpt = true ; }
            else if ( arg.equalsIgnoreCase("optquad"))  { printQuadOpt = true ; }
            else if ( arg.equalsIgnoreCase("quadopt"))  { printQuadOpt = true ; }
            else if ( arg.equalsIgnoreCase("none"))     { printNone = true ; }
            else
                throw new CmdException("Not a recognized print form: "+arg+" : Choices are: query, op, quad, opt, optquad") ;
        }
       
        if ( ! printQuery && ! printOp && ! printQuad && ! printPlan && ! printOpt && ! printQuadOpt && ! printNone )
            printQuery = true ;
    }
View Full Code Here

            ex.printStackTrace(System.err) ;
        }
        catch (QueryException qEx)
        {
            //System.err.println(qEx.getMessage()) ;
            throw new CmdException("Query Exeception", qEx) ;
        }
        catch (JenaException ex) {
            ex.printStackTrace() ;
            throw ex ; }
        catch (CmdException ex) { throw ex ; }
        catch (Exception ex)
        {
            throw new CmdException("Exception", ex) ;
        }
    }
View Full Code Here

    // Subclass for specialised commands making common updates more convenient
    @Override
    protected void execUpdate(GraphStore graphStore)
    {
        if ( requestFiles.size() == 0 && getPositional().size() == 0 )
            throw new CmdException("Nothing to do") ;
    
        Transactional transactional = (graphStore instanceof Transactional ) ? (Transactional)graphStore : new TransactionalNull() ;
       
        for ( Iterator<String> iter = requestFiles.iterator() ; iter.hasNext() ; )
        {
View Full Code Here

           
            if ( (graphURLs != null) || (namedGraphURLs != null) )
                ds = DatasetUtils.addInGraphs(ds, graphURLs, namedGraphURLs, fileManager, null) ;
        }
        catch (LabelExistsException ex)
        { throw new CmdException(ex.getMessage()) ; }
        catch (JenaException ex)
        { throw ex ; }
        catch (Exception ex)
        { throw new CmdException("Error creating dataset", ex) ; }
    }
View Full Code Here

    /**
     * Handle an unrecognised argument; default is to throw an exception
     * @param argStr The string image of the unrecognised argument
     */
    protected void handleUnrecognizedArg( String argStr ) {
        throw new CmdException("Unknown argument: "+argStr) ;
    }
View Full Code Here

        if ( cmdLine.contains(argSyntax) ) {
            String syntax = cmdLine.getValue(argSyntax) ;
            Lang lang$ = RDFLanguages.nameToLang(syntax) ;
            if ( lang$ == null )
                throw new CmdException("Can not detemine the synatx from '" + syntax + "'") ;
            this.lang = lang$ ;
        }

        if ( cmdLine.contains(argCheck) )
            explicitCheck = true ;

        if ( cmdLine.contains(argNoCheck) )
            explicitNoCheck = true ;

        if ( cmdLine.contains(argStrict) )
            strict = true ;

        if ( cmdLine.contains(argSkip) )
            skipOnBadTerm = true ;
        if ( cmdLine.contains(argNoSkip) )
            skipOnBadTerm = false ;

        if ( cmdLine.contains(argBase) ) {
            baseIRI = cmdLine.getValue(argBase) ;
            IRI iri = IRIResolver.resolveIRI(baseIRI) ;
            if ( iri.hasViolation(false) )
                throw new CmdException("Bad base IRI: " + baseIRI) ;
            if ( !iri.isAbsolute() )
                throw new CmdException("Base IRI must be an absolute IRI: " + baseIRI) ;
        }

        if ( cmdLine.contains(argStop) )
            stopOnBadTerm = true ;

        if ( cmdLine.contains(argSink) )
            bitbucket = true ;

        if ( cmdLine.contains(argRDFS) ) {
            try {
                rdfsVocabFilename = cmdLine.getArg(argRDFS).getValue() ;
                rdfsVocab = FileManager.get().loadModel(rdfsVocabFilename) ;
            } catch (RiotException ex) {
                throw new CmdException("Error in RDFS vocabulary: " + rdfsVocabFilename) ;
            } catch (Exception ex) {
                throw new CmdException("Error: " + ex.getMessage()) ;
            }
        }
    }
View Full Code Here

TOP

Related Classes of arq.cmd.CmdException

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.