org.apache.jena.sparql.engine.ExecutionContext.getContext()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(83)

本文整理了Java中org.apache.jena.sparql.engine.ExecutionContext.getContext()方法的一些代码示例,展示了ExecutionContext.getContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExecutionContext.getContext()方法的具体详情如下:
包路径:org.apache.jena.sparql.engine.ExecutionContext
类名称:ExecutionContext
方法名:getContext

ExecutionContext.getContext介绍

暂无

代码示例

代码示例来源:origin: apache/jena

public OpExecutorPlainTDB(ExecutionContext execCxt)
{
  super(execCxt) ;
  filter = QC2.getFilter(execCxt.getContext()) ;
}

代码示例来源:origin: apache/jena

private void explainQuery(String queryString, int limit, ExecutionContext execCxt, String graphURI) {
  if ( graphURI == null ) {
    Explain.explain(execCxt.getContext(), "Text query: "+queryString) ;
    log.debug("Text query: {} ({})", queryString, limit) ;
  } else {
    Explain.explain(execCxt.getContext(), "Text query <"+graphURI+">: "+queryString) ;
    log.debug("Text query: {} <{}> ({})", queryString, graphURI, limit) ;
  }
}

代码示例来源:origin: apache/jena

public OpExecutorPlainTDB(ExecutionContext execCxt)
{
  super(execCxt) ;
  filter = QC2.getFilter(execCxt.getContext()) ;
}

代码示例来源:origin: rdfhdt/hdt-java

@SuppressWarnings("unchecked")
public OpExecutorPlainHDT(ExecutionContext execCxt)
{
  super(execCxt) ;
  filter = (Predicate<Tuple<HDTId>>)execCxt.getContext().get(HDTJenaConstants.FILTER_SYMBOL);
}

代码示例来源:origin: org.aksw.jena-sparql-api/jena-sparql-api-cache

@SuppressWarnings("unchecked")
protected OpExecutorViewCache(ExecutionContext execCxt) {
  super(execCxt);
  //this.serviceToQef = serviceToQef;
  this.storageMap = (Map<Node, StorageEntry>) execCxt.getContext().get(STORAGE_MAP);
}

代码示例来源:origin: apache/jena

private Cache<String, ListMultimap<String, TextHit>> prepareCache(ExecutionContext execCxt) {
  @SuppressWarnings("unchecked")
  Cache<String, ListMultimap<String, TextHit>> queryCache =
      (Cache<String, ListMultimap<String, TextHit>>) execCxt.getContext().get(cacheSymbol);
  if (queryCache == null) {
    /* doesn't yet exist, need to create it */
    queryCache = CacheFactory.createCache(CACHE_SIZE);
    execCxt.getContext().put(cacheSymbol, queryCache);
  }
  return queryCache;
}

代码示例来源:origin: apache/jena

protected OpExecutor(ExecutionContext execCxt)
{
  this.execCxt = execCxt ;
  this.dispatcher = new ExecutionDispatch(this) ;
  this.hideBNodeVars = execCxt.getContext().isTrue(ARQ.hideNonDistiguishedVariables) ;
  this.stageGenerator = StageBuilder.chooseStageGenerator(execCxt.getContext()) ;
}

代码示例来源:origin: apache/jena

public FunctionEnvBase(ExecutionContext execCxt)
{ 
  this(execCxt.getContext(), execCxt.getActiveGraph(), execCxt.getDataset()) ;
  execContext = execCxt ;
}

代码示例来源:origin: apache/jena

public QueryIterService(QueryIterator input, OpService opService, ExecutionContext context)
{
  super(input, context) ;
  if ( context.getContext().isFalse(Service.serviceAllowed) )
    throw new QueryExecException("SERVICE not allowed") ; 
  this.opService = opService ;
}

代码示例来源:origin: apache/jena

public QueryIterDistinct(QueryIterator qIter, ExecutionContext execCxt) {
  super(qIter, execCxt) ;
  if ( execCxt != null ) {
    memThreshold = execCxt.getContext().getLong(ARQ.spillToDiskThreshold, memThreshold) ;
    if ( memThreshold < 0 )
      throw new ARQException("BAd spillToDiskThreshold: "+memThreshold) ;
  }
}

代码示例来源:origin: apache/jena

@Override
protected QueryIterator exec(Op op, QueryIterator input) {
  if ( level < 0 )
    // Print only at top level (and we're called before level++) 
    Explain.explain("TDB", op, super.execCxt.getContext()) ;
  return super.exec(op, input) ;
}

代码示例来源:origin: apache/jena

@Override
protected QueryIterator exec(Op op, QueryIterator input) {
  if ( level < 0 )
    // Print only at top level (and we're called before level++) 
    Explain.explain("TDB", op, super.execCxt.getContext()) ;
  return super.exec(op, input) ;
}

代码示例来源:origin: apache/jena

private static QueryIterator executeBGP(BasicPattern pattern, QueryIterator input, ExecutionContext execCxt) {
  if (pattern.isEmpty())
    return input ;
  boolean hideBNodeVars = execCxt.getContext().isTrue(ARQ.hideNonDistiguishedVariables) ;
  StageGenerator gen = StageBuilder.executeInline ;
  QueryIterator qIter = gen.execute(pattern, input, execCxt) ;
  // Remove non-distinguished variables here.
  // Project out only named variables.
  if (hideBNodeVars)
    qIter = new QueryIterDistinguishedVars(qIter, execCxt) ;
  return qIter ;
}

代码示例来源:origin: apache/jena

private static int existsPath(Graph graph, Node subject, Path path, final Node object, ExecutionContext execCxt) {
    if ( ! subject.isConcrete() || !object.isConcrete() )
      throw new ARQInternalErrorException("Non concrete node for existsPath evaluation") ;
    Iterator<Node> iter = PathEval.eval(graph, subject, path, execCxt.getContext()) ;
    Predicate<Node> filter = node -> Objects.equals(node,  object); 
    // See if we got to the node we're interested in finishing at.
    iter = Iter.filter(iter, filter) ;
    long x = Iter.count(iter) ; 
    return (int)x ;
  }
}

代码示例来源:origin: apache/jena

/** Load the data bag with. Filter incoming by the already seen in-memory elements */  
private void loadDataBag() {
  ThresholdPolicy<Binding> policy = ThresholdPolicyFactory.policyFromContext(super.getExecContext().getContext()) ;
  Comparator<Binding> comparator = new BindingComparator(new ArrayList<SortCondition>(), super.getExecContext()) ;
  this.db = BagFactory.newDistinctBag(policy, SerializationFactoryFinder.bindingSerializationFactory(), comparator) ;
  for(;;) {
    Binding b = getInputNextUnseen() ;
    if ( b == null )
      break ;
    db.add(b) ;
  }
}

代码示例来源:origin: apache/jena

public QueryIterSort(final QueryIterator qIter, final Comparator<Binding> comparator,
    final ExecutionContext context) {
  super(null, context);
  this.embeddedIterator = qIter;
  ThresholdPolicy<Binding> policy = ThresholdPolicyFactory.policyFromContext(context.getContext());
  this.db = BagFactory.newSortedBag(policy, SerializationFactoryFinder.bindingSerializationFactory(), comparator);
  this.setIterator(new SortedBindingIterator(qIter));
}

代码示例来源:origin: apache/jena

public static Procedure build(Node procId, ExprList args, ExecutionContext execCxt)
{
  Context context = execCxt.getContext() ;
  ProcedureRegistry reg = chooseProcedureRegistry(context) ;
  ProcedureFactory f = reg.get(procId.getURI()) ;
  Procedure proc = f.create(procId.getURI()) ;
  args.prepareExprs(context) ;        // Allow args to build as well.
  proc.build(procId, args, execCxt) ;
  return proc ;
}

代码示例来源:origin: apache/jena

public static Procedure build(Node procId, PropFuncArg subjArg, PropFuncArg objArg, ExecutionContext execCxt)
{
  Context context = execCxt.getContext() ;
  PropertyFunctionRegistry reg = PropertyFunctionRegistry.chooseRegistry(context) ;
  PropertyFunctionFactory f = reg.get(procId.getURI()) ;
  PropertyFunction pf = f.create(procId.getURI()) ;
  pf.build(subjArg, procId, objArg, execCxt) ;
  //Make wrapper
  return new ProcedurePF(pf, subjArg, procId, objArg) ;
}

代码示例来源:origin: apache/jena

@Override
protected QueryIterator execute(OpDatasetNames dsNames, QueryIterator input)
{ 
  DatasetGraphTDB ds = (DatasetGraphTDB)execCxt.getDataset() ;
  Predicate<Tuple<NodeId>> filter = QC2.getFilter(execCxt.getContext()) ;
  Node gn = dsNames.getGraphNode() ;
  if ( Var.isVar(gn) )
    return SolverLib.graphNames(ds, dsNames.getGraphNode(), input, filter, execCxt) ;
  else
    return SolverLib.testForGraphName(ds, dsNames.getGraphNode(), input, filter, execCxt) ;
}

代码示例来源:origin: apache/jena

@Override
protected QueryIterator execute(OpDatasetNames dsNames, QueryIterator input)
{ 
  DatasetGraphTDB ds = (DatasetGraphTDB)execCxt.getDataset() ;
  Predicate<Tuple<NodeId>> filter = QC2.getFilter(execCxt.getContext()) ;
  Node gn = dsNames.getGraphNode() ;
  if ( Var.isVar(gn) )
    return SolverLib.graphNames(ds, dsNames.getGraphNode(), input, filter, execCxt) ;
  else
    return SolverLib.testForGraphName(ds, dsNames.getGraphNode(), input, filter, execCxt) ;
}

相关文章