Package com.hp.hpl.jena.sparql.resultset

Examples of com.hp.hpl.jena.sparql.resultset.SPARQLResult


        validateQuery(action, query) ;
       
        // Assumes finished whole thing by end of sendResult.
        action.beginRead() ;
        try {
            SPARQLResult result = executeQuery(action, query, queryStringLog) ;
            sendResults(action, result) ;
        } finally { action.endRead() ; }
    }
View Full Code Here


//            // Not necessary if we are inside a read lock until the end of sending results.
//            rs = ResultSetFactory.copyResults(rs) ;

            log.info(format("[%d] OK/select", action.id)) ;
            return new SPARQLResult(rs) ;
        }

        if ( query.isConstructType() )
        {
            Model model = qexec.execConstruct() ;
            log.info(format("[%d] OK/construct", action.id)) ;
            return new SPARQLResult(model) ;
        }

        if ( query.isDescribeType() )
        {
            Model model = qexec.execDescribe() ;
            log.info(format("[%d] OK/describe",action.id)) ;
            return new SPARQLResult(model) ;
        }

        if ( query.isAskType() )
        {
            boolean b = qexec.execAsk() ;
            log.info(format("[%d] OK/ask",action.id)) ;
            return new SPARQLResult(b) ;
        }

        errorBadRequest("Unknown query type - "+queryStringLog) ;
        return null ;
    }
View Full Code Here

        action.beginRead() ;
        QueryExecution qExec = null ;
        try {
            Dataset dataset = decideDataset(action, query, queryStringLog) ;
            qExec = createQueryExecution(query, dataset) ;
            SPARQLResult result = executeQuery(action, qExec, query, queryStringLog) ;
            sendResults(action, result, query.getPrologue()) ;
        } finally {
            if ( qExec != null )
                qExec.close() ;
            action.endRead() ; }
View Full Code Here

            // Not necessary if we are inside a read transaction or lock until the end of sending results.
           
            //rs = ResultSetFactory.copyResults(rs) ;

            log.info(format("[%d] exec/select", action.id)) ;
            return new SPARQLResult(rs) ;
        }

        if ( query.isConstructType() )
        {
            Model model = qExec.execConstruct() ;
            log.info(format("[%d] exec/construct", action.id)) ;
            return new SPARQLResult(model) ;
        }

        if ( query.isDescribeType() )
        {
            Model model = qExec.execDescribe() ;
            log.info(format("[%d] exec/describe",action.id)) ;
            return new SPARQLResult(model) ;
        }

        if ( query.isAskType() )
        {
            boolean b = qExec.execAsk() ;
            log.info(format("[%d] exec/ask",action.id)) ;
            return new SPARQLResult(b) ;
        }

        errorBadRequest("Unknown query type - "+queryStringLog) ;
        return null ;
    }
View Full Code Here

    static public void main(String... args) throws Exception
    {
        String FILE = "../ARQ/testing/ResultSet/output.srj" ;
        //String FILE = "../ARQ/testing/ARQ/Ask/ask-2.srj" ;
        InputStream in = new FileInputStream(FILE) ;
        SPARQLResult r = new JSONInput().process(in, null) ;
        if ( r.isBoolean() )
            System.out.println("ASK: "+r.getBooleanResult()) ;
        if ( r.isResultSet() )
            ResultSetFormatter.out(r.getResultSet()) ;
    }
View Full Code Here

            ResultSetFormatter.out(r.getResultSet()) ;
    }
   
    public static ResultSet fromJSON(InputStream input)
    {
        SPARQLResult r = new JSONInput().process(input, null) ;
        return r.getResultSet() ;
    }
View Full Code Here

            return null ;
        ResultsFormat format = ResultsFormat.guessSyntax(resultFile) ;

        if ( ResultsFormat.isRDFGraphSyntax(format) ) {
            Model m = FileManager.get().loadModel(resultFile) ;
            return new SPARQLResult(m) ;
        }

        // Attempt to handle as a resulset or boolean result.s
        SPARQLResult x = ResultSetFactory.result(resultFile) ;
        return x ;
    }
View Full Code Here

        action.beginRead() ;
        QueryExecution qExec = null ;
        try {
            Dataset dataset = decideDataset(action, query, queryStringLog) ;
            qExec = createQueryExecution(query, dataset) ;
            SPARQLResult result = executeQuery(action, qExec, query, queryStringLog) ;
           
            // Deals with exceptions itself.
            sendResults(action, result, query.getPrologue()) ;
        } catch (QueryCancelledException ex) {
            // Additional counter information.
View Full Code Here

            // to see if the timeout-end-of-query goes off. 
           
            //rs = ResultSetFactory.copyResults(rs) ;

            log.info(format("[%d] exec/select", action.id)) ;
            return new SPARQLResult(rs) ;
        }

        if ( query.isConstructType() )
        {
            Model model = qExec.execConstruct() ;
            log.info(format("[%d] exec/construct", action.id)) ;
            return new SPARQLResult(model) ;
        }

        if ( query.isDescribeType() )
        {
            Model model = qExec.execDescribe() ;
            log.info(format("[%d] exec/describe",action.id)) ;
            return new SPARQLResult(model) ;
        }

        if ( query.isAskType() )
        {
            boolean b = qExec.execAsk() ;
            log.info(format("[%d] exec/ask",action.id)) ;
            return new SPARQLResult(b) ;
        }

        errorBadRequest("Unknown query type - "+queryStringLog) ;
        return null ;
    }
View Full Code Here

            return null ;
        ResultsFormat format = ResultsFormat.guessSyntax(resultFile) ;

        if ( ResultsFormat.isRDFGraphSyntax(format) ) {
            Model m = FileManager.get().loadModel(resultFile) ;
            return new SPARQLResult(m) ;
        }

        // Attempt to handle as a resulset or boolean result.s
        SPARQLResult x = ResultSetFactory.result(resultFile) ;
        return x ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.resultset.SPARQLResult

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.