ARQ.getContext
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.jena.query.ARQ.getContext(Showing top 15 results out of 315)

origin: org.apache.jena/jena-arq

  private NodeValue cast(String input$) {
    Expr input = ExprUtils.parse(input$) ;
    ARQ.getContext().set(ARQConstants.sysCurrentTime, NodeFactoryExtra.nowAsDateTime()) ;
    FunctionEnv env = new ExecutionContext(ARQ.getContext(), null, null, null) ; 
    return input.eval(null, env) ;
  }
}
origin: org.apache.jena/jena-arq

/** Apply static transformations to a query to optimize it */
public static Op optimize(Op op, Context context)
{
  if ( context == null )
    context = ARQ.getContext() ;
  // Call-through to somewhere to manage all the optimizations
  if ( op == null )
    return null ;
  return Optimize.optimize(op, context) ;
}   

origin: org.apache.jena/jena-arq

public static DescribeHandlerRegistry get(Context context)
{
  if ( context == null )
    return null ;
  return (DescribeHandlerRegistry)ARQ.getContext().get(ARQConstants.registryDescribeHandlers) ;
}

origin: apache/jena

public static void printPlan(Query query, QueryExecution qe)
{
  QueryEngineFactory f = QueryEngineRegistry.findFactory(query, qe.getDataset().asDatasetGraph(), ARQ.getContext()) ;
  if ( f == null )
    System.err.println("printPlan: Unknown engine type: "+Lib.className(qe)) ;
  
  Plan plan = f.create(query, qe.getDataset().asDatasetGraph(), BindingRoot.create(), ARQ.getContext()) ;
  SerializationContext sCxt = new SerializationContext(query) ;
  IndentedWriter out = IndentedWriter.stdout ;

  plan.output(out, sCxt) ;
  out.flush();
}
origin: apache/jena

public static void register() {
  init() ;
  String NS = ARQ.PATH ;
  ContextMBean cxtBean = new ContextMBean(ARQ.getContext()) ;
  QueryEngineInfo qeInfo = QueryEngineBase.queryEngineInfo ;
  // Done in ARQ initialization --
  // register(NS+".system:type=SystemInfo", ARQ.systemInfo) ;
  register(NS + ".system:type=Context", cxtBean) ;
  register(NS + ".system:type=Engine", qeInfo) ;
}
origin: apache/jena

@Test
public void query_with_auth_12() {
  ARQ.getContext().remove(Service.serviceContext);
  QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(authServiceQuery, "ASK { }");
  // Auth credentials for valid user with correct password
  qe.setClient(withCreds("allowed", "password"));
  Assert.assertTrue(qe.execAsk());
 }

origin: apache/jena

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 ;
  return f.create(query, dataset, input, context) ;
}
// ---------------- Internal routines
origin: org.apache.jena/jena-arq

  private static Context setupContext(Context context, DatasetGraph dataset)
  {
    // To many copies?
    if ( context == null )      // Copy of global context to protect against change.
      context = ARQ.getContext() ;
    context = context.copy() ;

    if ( dataset.getContext() != null )
      context.putAll(dataset.getContext()) ;
    
    context.set(ARQConstants.sysCurrentTime, NodeFactoryExtra.nowAsDateTime()) ;
    return context ; 
  }
}
origin: org.apache.jena/jena-arq

public static void init() {
  // Intialize if there is no registry already set 
  FunctionRegistry reg = new FunctionRegistry() ;
  StandardFunctions.loadStdDefs(reg) ;
  set(ARQ.getContext(), reg) ;
}

origin: org.apache.jena/jena-arq

public static NodeValue eval(Expr expr, Binding binding)
{
  Context context = ARQ.getContext().copy() ;
  context.set(ARQConstants.sysCurrentTime, NodeFactoryExtra.nowAsDateTime()) ;
  FunctionEnv env = new ExecutionContext(context, null, null, null) ; 
  NodeValue r = expr.eval(binding, env) ;
  return r ;
}

origin: apache/jena

/**
 * Create a new generator
 * @param context Context
 */
public AlgebraGenerator(Context context)
{
  this (context != null ? context : ARQ.getContext().copy(), 0) ;
}

origin: apache/jena

private static void setupJS() {
  Context cxt = ARQ.getContext();
  cxt.set(ARQ.symJavaScriptLibFile, JS_LIB_FILE);
  cxt.set(ARQ.symJavaScriptFunctions, "function inc(x) { return x+1 }");
  EnvJavaScript.reset();
}

origin: org.apache.jena/jena-arq

public synchronized static PropertyFunctionRegistry get()
{
  // Intialize if there is no registry already set 
  PropertyFunctionRegistry reg = get(ARQ.getContext()) ;
  if ( reg == null )
  {
    reg = standardRegistry() ;
    set(ARQ.getContext(), reg) ; 
  }
  return reg ;
}

origin: apache/jena

  private NodeValue cast(String input$) {
    Expr input = ExprUtils.parse(input$) ;
    ARQ.getContext().set(ARQConstants.sysCurrentTime, NodeFactoryExtra.nowAsDateTime()) ;
    FunctionEnv env = new ExecutionContext(ARQ.getContext(), null, null, null) ; 
    return input.eval(null, env) ;
  }
}
origin: apache/jena

  private static Context setupContext(Context context, DatasetGraph dataset)
  {
    // To many copies?
    if ( context == null )      // Copy of global context to protect against change.
      context = ARQ.getContext() ;
    context = context.copy() ;

    if ( dataset.getContext() != null )
      context.putAll(dataset.getContext()) ;
    
    context.set(ARQConstants.sysCurrentTime, NodeFactoryExtra.nowAsDateTime()) ;
    return context ; 
  }
}
org.apache.jena.queryARQgetContext

Popular methods of ARQ

  • setStrictMode
    Set strict mode for a given Context. Does not influence expression evaluation because NodeValues are
  • getExecLogger
    The execution logger
  • init
  • isTrue
  • set
  • setNormalMode
    Explicitly set the values for normal operation. Does not influence expression evaluation.
  • defaultSettings
  • enableBlankNodeResultLabels
    Turn on/off processing of blank node labels in queries
  • enableOptimizer
    Globally switch the default optimizer on and off : Note that storage subsystems may also be applying
  • getHttpRequestLogger
    The HTTP Request logger
  • isFalse
  • isStrictMode
  • isFalse,
  • isStrictMode,
  • isTrueOrUndef,
  • setExecutionLogging,
  • setFalse,
  • unset

Popular classes and methods

  • startActivity (Activity)
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)