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

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

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

Query.getExtNode介绍

暂无

代码示例

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

/**
 * get node with going in select sub query go into its own select because
 * order by may reuse a select variable use case: transformer find node for
 * select & group by
 */
public Node getProperAndSubSelectNode(String name) {
  return getExtNode(name, true);
}

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

public Node getNode(String name) {
  return getExtNode(name);
}

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

public Node getExtNode(String name) {
  return getExtNode(name, false);
}

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

Node getOuterNodeSelf(Node subNode) {
  Node n = getExtNode(subNode.getLabel());
  if (n == null) {
    return subNode;
  }
  return n;
}

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

/**
 * TODO: must also join: {select ?x where {?x rdf:first ?y}} filter (exists
 * {?x}) minus {?x} and also {minus {select ?x where }} filter exists
 * {{select ?x where }}
 *
 * embedding select * must evolve as well
 */
Node getOuterNode(Node subNode) {
  return getExtNode(subNode.getLabel());
}

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

/**
 * use case: select * list of nodes that are exposed as select *
 */
public List<Node> getSelectNodes() {
  List<Node> list = new ArrayList<Node>();
  for (Node node : patternNodes) {
    list.add(node);
  }
  for (Node node : patternSelectNodes) {
    if (!list.contains(node)) {
      Node ext = getExtNode(node);
      add(list, ext);
    }
  }
  return list;
}

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

public Node getExtNode(Node qNode) {
  return getExtNode(qNode.getLabel());
}

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

/**
 *
 * use case: select ?x
 */
public Node getSelectNodes(String name) {
  Node node = get(patternNodes, name);
  if (node != null) {
    return node;
  }
  node = get(patternSelectNodes, name);
  if (node != null) {
    return getExtNode(node);
  }
  return node;
}

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

/**
 * use case: result of st:apply-templates-all() list = list of ?out results
 * of templates create Mappings (?out = value) apply st:aggregate(?out) on
 * Mappings Use the st:aggregate of the query q that called
 * st:apply-templates-all() if q is member of this transformation, otherwise
 * get the st:profile of this transformation to get the appropriate
 * st:aggregate definition if any
 */
IDatatype result(Environment env, List<Node> list) {
  Query q = (env == null) ? null : env.getQuery();
  Query tq = (q != null && contains(q)) ? q : qe.getTemplate();
  Memory mem = new Memory(exec.getMatcher(), exec.getEvaluator());
  exec.getEvaluator().init(mem);
  if (env != null){ 
    mem.share(mem.getBind(), env.getBind());
    mem.setEval(env.getEval());
  }
  mem.init(tq);
  Node out = tq.getExtNode(OUT, true);
  Mappings map = Mappings.create(tq);
  for (Node node : list) {
    map.add(Mapping.create(out, node));
  }
  mem.setResults(map);
  // execute st:aggregate(?out)
  Node node = map.apply(exec.getEvaluator(), tq.getTemplateGroup(), mem, exec.getProducer());
  return (IDatatype) node.getDatatypeValue();
}

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

/**
 * use case: result of st:apply-templates-all() list = list of ?out results
 * of templates create Mappings (?out = value) apply st:aggregate(?out) on
 * Mappings Use the st:aggregate of the query q that called
 * st:apply-templates-all() if q is member of this transformation, otherwise
 * get the st:profile of this transformation to get the appropriate
 * st:aggregate definition if any
 */
IDatatype result(Environment env, List<Node> list) {
  Query q = (env == null) ? null : env.getQuery();
  Query tq = (q != null && contains(q)) ? q : qe.getTemplate();
  Memory mem = new Memory(exec.getMatcher(), exec.getEvaluator());
  exec.getEvaluator().init(mem);
  if (env != null){ 
    mem.share(mem.getBind(), env.getBind());
    mem.setEval(env.getEval());
  }
  mem.init(tq);
  Node out = tq.getExtNode(OUT, true);
  Mappings map = Mappings.create(tq);
  for (Node node : list) {
    map.add(Mapping.create(out, node));
  }
  mem.setResults(map);
  // execute st:aggregate(?out)
  Node node = map.apply(exec.getEvaluator(), tq.getTemplateGroup(), mem, exec.getProducer());
  return (IDatatype) node.getDatatypeValue();
}

相关文章