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

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

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

Query.getSelectNodes介绍

[英]use case: select * list of nodes that are exposed as select
[中]用例:select*显示为select的节点列表

代码示例

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

public List<Exp> getSelectNodesExp() {
  List<Node> list = getSelectNodes();
  return toExp(list);
}

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

Node getProperAndSubSelectNode(Query q, String name) {
  Node node;
  if (Query.test) {
    node = q.getSelectNodes(name);
  } else {
    node = q.getProperAndSubSelectNode(name);
  }
  return node;
}

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

Node getProperAndSubSelectNode(Query q, String name) {
  Node node;
  if (Query.test) {
    node = q.getSelectNodes(name);
  } else {
    node = q.getProperAndSubSelectNode(name);
  }
  return node;
}

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

public Mappings distinctAll() {
  List<Node> list = query.getSelectNodes();
  if (list.isEmpty()) {
    list = query.getSelect();
  }
  if (list.isEmpty()) {
    list = getSelect();
  }
  return distinct(list, list);
}

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

void init(Environment env) {
  if (isDistinct()) {
    // use case: count(distinct exp)           
    if (arity() == 0) {
      // count(distinct *)
      List<Node> nodes = env.getQuery().getSelectNodes();
      group = Group.create(nodes);
      group.setDistinct(true);
    }
    else {
      tree = Distinct.create();
    }
  }
}

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

void initiate(Query q,  boolean b, boolean all){
  this.query = q;
  isDistinct = b;
  isListGroup = q.isListGroup();
  setSelect(q.getSelect());
  if (isDistinct) {
    if (all) {
      List<Node> list = q.getSelectNodes();
      if (list.isEmpty()){
        distinct = group(q.getSelectFun()); 
      }
      else {
        distinct = group(q.toExp(list)); 
      }
    }
    else {
      distinct = group(q.getSelectFun());
    }
    distinct.setDistinct(true);
    distinct.setDuplicate(q.isDistribute());
  }
}

相关文章