fr.inria.corese.kgram.core.Query.setContext()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(157)

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

Query.setContext介绍

暂无

代码示例

代码示例来源:origin: fr.inria.corese/kgram

/**
 * @param Context the Context to set
 */
public void setContext(Object context) {
  if (query == null){
    this.context = context;
  }
  else {
    query.setContext(context);
  }
}

代码示例来源:origin: Wimmics/corese

/**
* Transformation templates share Transformer Context
* Query and Template alone have own Context
*/
@Override
public Context getContext(Environment env, Producer p) {
  Context c = getQueryContext(env, p);
  if (c == null){
    c = getTransformerContext(env, p);
    env.getQuery().setContext(c);
  }
  return c;
}

代码示例来源:origin: Wimmics/corese

void context(){
  if (getContext() != null){
    for  (Rule r : getRules()){
      r.getQuery().setContext(getContext());
    }
  }
}

代码示例来源:origin: Wimmics/corese

void init(RuleEngine re){
  if (getContext() != null){
    for (Rule r : re.getRules()){
      r.getQuery().setContext(getContext());
    }
  }
}

代码示例来源:origin: fr.inria.corese/kgram

/**
 * Use case: PluginImpl kgram()
 * Query inherits q transformer information
 * @param q 
 */
public void complete(Query q, Object context){
  setEnvironment(q.getEnvironment());
  setTransformer(q.getTransformer());
  setContext(context);
}

代码示例来源:origin: Wimmics/corese

Context getQueryContext(Environment env, Producer p) {
  Query q = env.getQuery().getGlobalQuery();
  Context c = (Context) q.getContext(); 
  if (c == null && ! q.isTransformationTemplate()){
    //  std Query or Template alone
    c = new Context();
    q.setContext(c);
  }
  return c;
}

代码示例来源:origin: Wimmics/corese

IDatatype call(String name, Function function, IDatatype[] param, Context c) throws EngineException {
  Eval eval = getEval();
  eval.getMemory().getQuery().setContext(c);
  return new Funcall(name).call((Interpreter) eval.getEvaluator(),
      (Binding) eval.getMemory().getBind(),
      eval.getMemory(), eval.getProducer(), function, param);
}

代码示例来源:origin: Wimmics/corese

q.setAlgebra(isAlgebra());
if (ast.getContext() != null) {
  q.setContext(ast.getContext());

代码示例来源:origin: fr.inria.corese/compiler

q.setAlgebra(isAlgebra());
if (ast.getContext() != null) {
  q.setContext(ast.getContext());

相关文章