Package com.hp.hpl.jena.sparql.util

Examples of com.hp.hpl.jena.sparql.util.Context


       
        String uri = request.getRequestURI() ;
        initResponse(request, response) ;
       
        DatasetRef desc = null ;
        Context cxt = ARQ.getContext() ;
       
        try {
            if ( request.getQueryString() == null && queryStringHandling == PlainRequestFlag.DIFFERENT )
            {
                boolean requestContinue = requestNoQueryString(request, response) ;
                if ( ! requestContinue )
                    return ;
            }

            uri = mapRequestToDataset(uri) ;

            if ( uri != null )
            {
                desc = DatasetRegistry.get().get(uri) ;
                if ( desc == null )
                {
                    errorNotFound("No dataset for URI: "+uri) ;
                    return ;
                }
                //cxt = desc.dataset.getContext() ;
            }
            else {
                desc = new DatasetRef();
                desc.dataset = dummyDSG;
            }
            perform(id, desc, request, response) ;
            //serverlog.info(String.format("[%d] 200 Success", id)) ;
        } catch (QueryCancelledException ex)
        {
            // Also need the per query info ...
          String message = String.format("The query timed out (restricted to %s ms)", cxt.get(ARQ.queryTimeout));
          responseSendError(response, HttpSC.REQUEST_TIMEOUT_408, message);
            // Log message done by printResponse in a moment.
        } catch (ActionErrorException ex)
        {
            if ( ex.exception != null )
View Full Code Here


    public void testNoSpill()
    {
        iterator.setCallback(new Callback() { @Override
        public void call() { /* do nothing */ } });
        assertEquals(0, iterator.getReturnedElementCount());
        Context context = new Context() ;
        ExecutionContext executionContext = new ExecutionContext(context, (Graph)null, (DatasetGraph)null, (OpExecutorFactory)null) ;
        QueryIterSort qIter = new QueryIterSort(iterator, comparator, executionContext) ;
        try
        {
            assertEquals(0, iterator.getReturnedElementCount()) ;
View Full Code Here

    public void testCleanAfterClose()
    {
        iterator.setCallback(new Callback() { @Override
        public void call() { /* do nothing */ } });
        assertEquals(0, iterator.getReturnedElementCount());
        Context context = new Context() ;
        context.set(ARQ.spillToDiskThreshold, 10L) ;
        ExecutionContext executionContext = new ExecutionContext(context, (Graph)null, (DatasetGraph)null, (OpExecutorFactory)null) ;
        QueryIterSort qIter = new QueryIterSort(iterator, comparator, executionContext) ;
        try
        {
            assertEquals(0, iterator.getReturnedElementCount()) ;
View Full Code Here

    public void testCleanAfterExhaustion()
    {
        iterator.setCallback(new Callback() { @Override
        public void call() { /* do nothing */ } });
        assertEquals(0, iterator.getReturnedElementCount());
        Context context = new Context() ;
        context.set(ARQ.spillToDiskThreshold, 10L) ;
        ExecutionContext executionContext = new ExecutionContext(context, (Graph)null, (DatasetGraph)null, (OpExecutorFactory)null) ;
        QueryIterSort qIter = new QueryIterSort(iterator, comparator, executionContext) ;
       
        // Usually qIter should be in a try/finally block, but we are testing the case that the user forgot to do that.
        // As a failsafe, QueryIteratorBase should close it when the iterator is exhausted.
View Full Code Here

    @Test(expected=QueryCancelledException.class)
    public void testCancelInterruptsInitialisation()
    {

        assertEquals(0, iterator.getReturnedElementCount());
        Context context = new Context() ;
        context.set(ARQ.spillToDiskThreshold, 10L) ;
        ExecutionContext executionContext = new ExecutionContext(context, (Graph)null, (DatasetGraph)null, (OpExecutorFactory)null) ;
        QueryIterSort qIter = new QueryIterSort(iterator, comparator, executionContext) ;
        try
        {
            assertEquals(0, iterator.getReturnedElementCount()) ;
View Full Code Here

   
    @Test(expected=QueryCancelledException.class)
    public void testCancelInterruptsExternalSortAfterStartingIteration()
    {
        assertEquals(0, iterator.getReturnedElementCount());
        Context context = new Context() ;
        context.set(ARQ.spillToDiskThreshold, 10L) ;
        ExecutionContext executionContext = new ExecutionContext(context, (Graph)null, (DatasetGraph)null, (OpExecutorFactory)null) ;
        QueryIterSort qIter = new QueryIterSort(iterator, comparator, executionContext) ;
        try
        {
            assertEquals(0, iterator.getReturnedElementCount()) ;
View Full Code Here

    {
        iterator = new CallbackIterator(unsorted.iterator(), 25, null);
        iterator.setCallback(new Callback() { @Override
        public void call() { /* do nothing */ } });
        assertEquals(0, iterator.getReturnedElementCount());
        Context context = new Context() ;
        context.set(ARQ.spillToDiskThreshold, 10L) ;
        ExecutionContext executionContext = new ExecutionContext(context, (Graph)null, (DatasetGraph)null, (OpExecutorFactory)null) ;
        QueryIterSort qIter = new QueryIterSort(iterator, comparator, executionContext) ;
        try
        {
            assertTrue(qIter.hasNext()) ;
View Full Code Here

    }

    private static Plan makePlan(Query query, DatasetGraph dataset, Binding input, Context context)
    {
        if ( context == null )
            context = new Context(ARQ.getContext()) ;
        if ( input == null )
            input = BindingRoot.create() ;
        QueryEngineFactory f = findFactory(query, dataset, context) ;
        if ( f == null )
            return null ;
View Full Code Here

        SystemARQ.StrictDateTimeFO      = false ;
        SystemARQ.ValueExtensions       = true ;
        SystemARQ.SameValueAsString     = true ;
        SystemARQ.EnableRomanNumerals   = false ;

        Context context = new Context() ;
        context.unset(optimization) ;
        //context.set(hideNonDistiguishedVariables, true) ;
        context.set(strictSPARQL,                  false) ;
        context.set(constantBNodeLabels,           true) ;
        context.set(enablePropertyFunctions,       true) ;
        context.set(regexImpl,                     javaRegex) ;

        return context ;
    }
View Full Code Here

    private boolean closed  = false ;
    private boolean active  = false ;   // In a transaction, or preparing.
   
    public BlockMgrJournal(Transaction txn, FileRef fileRef, BlockMgr underlyingBlockMgr)
    {
        Context context = txn.getBaseDataset().getContext() ;
        String mode = (null != context) ? (String) context.get(TDB.transactionJournalWriteBlockMode, "") : "" ;
        if ("direct".equalsIgnoreCase(mode))
        {
            writeBlockBufferAllocator = new BufferAllocatorDirect() ;
        }
        else if ("mapped".equalsIgnoreCase(mode))
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.util.Context

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.