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

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


   
    // ----
   
    public static Procedure build(Node procId, PropFuncArg subjArg, PropFuncArg objArg, ExecutionContext execCxt)
    {
        Context context = execCxt.getContext() ;
        PropertyFunctionRegistry reg = choosePropFuncRegistry(context) ;
        PropertyFunctionFactory f = reg.get(procId.getURI()) ;
        PropertyFunction pf = f.create(procId.getURI()) ;
        pf.build(subjArg, procId, objArg, execCxt) ;
        //Make wrapper
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

     * @param Query the Query to execute.
     * @return An HttpQuery configured as per the context.
     */
    private static HttpQuery configureQuery(String uri, Context parentContext, Query query) {
      HttpQuery httpQuery = new HttpQuery(uri);
      Context context = new Context(parentContext);

      // add the context settings from the service context
      @SuppressWarnings("unchecked")
      Map<String, Context> serviceContextMap = (Map<String, Context>) context.get(serviceContext);
      if (serviceContextMap != null)
      {
        Context serviceContext = serviceContextMap.get(uri);
        if (serviceContext != null) context.putAll(serviceContext);
      }

      // configure the query object.
      httpQuery.merge(QueryEngineHTTP.getServiceParams(uri, context));
View Full Code Here

        AssemblerUtils.register(g) ;
    }

    private static Context defaultSettings()   
    {
        Context context = new Context() ;
        setNormalMode(context) ;
        return context ;
    }
View Full Code Here

    {
        this.query = query ;
        this.queryString = queryString ;
        this.service = serviceURI ;
        // Copy the global context to freeze it.
        this.context = new Context(ARQ.getContext()) ;
    }
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

//    }
   
    Symbol p1 = Symbol.create("p1") ;
    Symbol p2 = Symbol.create("p2") ;
   
    @Test public void testCxt1() { Context cxt = new Context(); }
View Full Code Here

   
    @Test public void testCxt1() { Context cxt = new Context(); }
   
    @Test public void testCxt2()
    {
        Context cxt = new Context();
        assertTrue("Defined in empty context", !cxt.isDefined(p1)) ;
        cxt.set(p1, "v") ;
        assertTrue("Not defined after .set", cxt.isDefined(p1)) ;
        Object v = cxt.get(p1) ;
        assertSame("Not the same", "v", v) ;
    }
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.