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

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

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

Query.complete介绍

[英]Only on global query, not on subquery
[中]仅在全局查询上,不在子查询上

代码示例

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

public Query and(Query q2) {
  Query q1 = this;
  Exp exp = Exp.create(AND, q1, q2);
  Query q = Query.create(exp).complete(q1, q2);
  return q;
}

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

/**
 * Only on global query, not on subquery
 */
public void complete(Producer prod) {
  if (isCompiled()) {
    return;
  } else {
    setCompiled(true);
  }
  // sort edges according to var connexity, assign filters
  // recurse on subquery
  querySorter.compile(prod);
  setAggregate();
  // recurse on subquery
  index(this, getBody(), true, false, -1);
  for (Exp ee : getSelectFun()) {
    // use case: query node created to hold fun result
    Node snode = ee.getNode();
    index(snode);
    // use case: select (exists{?x :p ?y} as ?b)
    if (ee.getFilter() != null) {
      index(this, ee.getFilter());
    }
  }
  complete2();
  for (Query q : getQueries()) {
    q.complete(prod);
  }
}

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

/**
 * ********************************************************************
 *
 * Pipeline using operators on queries: union/and/optional/minus
 * q1.union(q2).and(q3).optional(q4).minus(q5)
 *
 *********************************************************************
 */
public Query union(Query q2) {
  Query q1 = this;
  Exp exp = Exp.create(UNION, q1, q2);
  Query q = Query.create(exp).complete(q1, q2);
  return q;
}

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

public Query minus(Query q2) {
  Query q1 = this;
  Exp exp = Exp.create(MINUS, q1, Exp.create(AND, q2));
  Query q = Query.create(exp).complete(q1, q2);
  return q;
}

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

public Query optional(Query q2) {
  Query q1 = this;
  Exp exp = Exp.create(AND, q1, Exp.create(OPTION, Exp.create(AND, q2)));
  Query q = Query.create(exp).complete(q1, q2);
  return q;
}

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

void initMemory(Query q) {
  if (memory == null) {
    // when subquery, memory is already assigned
    // assign stack index to EDGE and NODE
    q.complete(producer);//service while1 / Query
    memory = new Memory(match, evaluator); 
    memory.setEval(this);
    getEvaluator().init(memory);
    // create memory bind stack
    memory.init(q);
    if (hasEvent) {
      memory.setEventManager(manager);
    }
    producer.init(q);
    evaluator.start(memory);
    debug = q.isDebug();
    if (q.isAlgebra()){
      complete(q);
    }
    if (debug){
      System.out.println(q);
    }
  }
}

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

queryCache.put(query.getLabel(), q);
q.complete(getEnvironment().getQuery(), getPluginTransform().getContext());
Mappings map = exec.sparqlQuery(q, m);
if (map.getGraph() == null){

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

/**
 * This PluginImpl was created for executing a Method such as java:report()
 * where java: = <function:// ...>
 * This PluginImpl contains Environment and Producer use case: JavaCompiler
 * external function
 */
public IDatatype kgram(IDatatype query, IDatatype... ldt) {
  Graph g = getGraph(getProducer());
  Mapping m = null;
  if (ldt.length > 0) {
    m = createMapping(getProducer(), ldt, 0);
  }
  QueryProcess exec = QueryProcess.create(g, true);
  try {
    Query q = exec.compile(query.getLabel());
    q.complete(getEnvironment().getQuery(), getPluginTransform().getContext());
    Mappings map = exec.sparqlQuery(q, m);
    if (map.getGraph() == null) {
      return DatatypeMap.createObject(map);
    } else {
      return DatatypeMap.createObject(map.getGraph());
    }
  } catch (EngineException e) {
    return DatatypeMap.createObject(new Mappings());
  }
}

相关文章