Package com.hp.hpl.jena.sparql

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


    {
        if ( indexes.length != bgp.size() )
        {
            String str = String.format("Expected size = %d : actual basic pattern size = %d", indexes.length, bgp.size()) ;
            Log.fatal(this, str) ;
            throw new ARQException(str) ;
        }       
       
        BasicPattern bgp2 = new BasicPattern() ;
        for ( int j = 0 ; j < indexes.length ; j++ )
        {
View Full Code Here


                // In development, there is no properties file.
                return ;

            try { properties.loadFromXML(in) ; }
            catch (InvalidPropertiesFormatException ex)
            { throw new ARQException("Invalid properties file", ex) ; }
            catch (IOException ex)
            { throw new ARQException("Metadata ==> IOException", ex) ; }
        }
        catch (Throwable ex)
        {
            Log.fatal(Metadata.class, "Unexpected Thorwable", ex) ;
            return ;
View Full Code Here

    }
   
    public static Object build(String assemblerFile, Resource type)
    {
        if ( assemblerFile == null )
            throw new ARQException("No assembler file") ;
        Model spec = null ;
        try {
            spec = FileManager.get().loadModel(assemblerFile) ;
        } catch (Exception ex)
        { throw new ARQException("Failed reading assembler description: "+ex.getMessage()) ; }

        Resource root = null ;
        InfoLevel level = ARQ.getExecutionLogging() ;
        ARQ.setExecutionLogging(InfoLevel.NONE) ;
        try {
            root = GraphUtils.findRootByType(spec, type) ;
            if ( root == null )
                return null ;
           
        } catch (TypeNotUniqueException ex)
        { throw new ARQException("Multiple types for: "+DatasetAssemblerVocab.tDataset) ; }
        finally
        { ARQ.setExecutionLogging(level) ; }
        return Assembler.general.open(root) ;
    }
View Full Code Here

    }
   
    protected static void checkGraphName(String uri)
    {
        if ( uri == null )
            throw new ARQException("null for graph name") ;
    }
View Full Code Here

        return (duration < 0) ? duration : timeUnit.toMillis(duration);
    }

    private HttpQuery makeHttpQuery() {
        if (finished)
            throw new ARQException("HTTP execution already closed");

        HttpQuery httpQuery = new HttpQuery(service);
        httpQuery.merge(getServiceParams(service, context));
        httpQuery.addParam(HttpParams.pQuery, queryString);
View Full Code Here

        {
            try {
                return (DatasetDescription)context.get(ARQConstants.sysDatasetDescription) ;
            } catch (ClassCastException ex)
            {
                throw new ARQException("Unexpected type (expected DatasetDescription): "+ex.getMessage()) ;
            }
        }
       
        if ( query != null && query.hasDatasetDescription() )
            return query.getDatasetDescription() ;
View Full Code Here

    /** Execute a query, expecting the result to be one row, one column.  Return that one RDFNode */
    public static RDFNode getExactlyOne(String qs, Dataset ds)
    {
        Query q = QueryFactory.create(qs) ;
        if ( q.getResultVars().size() != 1 )
            throw new ARQException("getExactlyOne: Must have exactly one result columns") ;
        String varname = q.getResultVars().get(0) ;
        QueryExecution qExec = QueryExecutionFactory.create(q, ds);
        return getExactlyOne(qExec, varname) ;
    }
View Full Code Here

    {
        try {
            ResultSet rs = qExec.execSelect() ;
           
            if ( ! rs.hasNext() )
                throw new ARQException("Not found: var ?"+varname) ;

            QuerySolution qs = rs.nextSolution() ;
            RDFNode r = qs.get(varname) ;
            if ( rs.hasNext() )
                throw new ARQException("More than one: var ?"+varname) ;
            return r ;
        } finally { qExec.close() ; }
    }
View Full Code Here

            if ( rs.hasNext() )
            {
                QuerySolution qs2 = rs.next();
                RDFNode r2 = qs2.get(varname) ;
                if ( rs.hasNext() )
                    throw new ARQException("More than one: var ?"+varname+ " -> "+r+", "+r2+", ...") ;
                else
                    throw new ARQException("Found two matches: var ?"+varname+ " -> "+r+", "+r2) ;
            }
            return r ;
        } finally { qExec.close() ; }
    }
View Full Code Here

        super(variables, rows) ;
    }

    @Override
    public void addBinding(Binding binding) {
        throw new ARQException("Can't add bindings to an existing data table") ;
    }
View Full Code Here

TOP

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

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.