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

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

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

Query.getSelect介绍

暂无

代码示例

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

void setQuery(Query q){
  query = q;
  select = new Vector<String> ();
  for (Node node : q.getSelect()){
    select.add(node.getLabel());
  }
}

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

void setQuery(Query q){
  query = q;
  select = new ArrayList<String> ();
  for (Node node : q.getSelect()){
    select.add(node.getLabel());
  }
}

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

for (Node qv : q.getSelect()) {
  sb.append(qv.getLabel());
  sb.append(SPACE);
  for (Node var : q.getSelect()) {
    Node val = m.getNode(var);
    if (val == null) {

代码示例来源:origin: fr.inria.wimmics/kgengine

Mappings translate(LBind lb){
  ASTQuery ast = lb.getAST();
  Query query = exec.compile(ast);
  Mappings lMap =  Mappings.create(query);
  for (Bind b : lb){
    List<Node> list = new ArrayList<Node>();
    
    for (Node qNode : query.getSelect()){
      IDatatype dt = b.getDatatypeValue(qNode.getLabel());
      if (dt == null){
        list.add(null);
      }
      else {
        Node node = graph.getNode(dt, true, false);
        list.add(node);
      }
    }
    Mapping map = Mapping.create(query.getSelect(), list);
    lMap.add(map);
  }
  return lMap;
}

代码示例来源:origin: fr.inria.wimmics/kggui

Mappings translate(LBind lb){
  ASTQuery ast = lb.getAST();
  Query query = exec.compile(ast);
  Mappings lMap =  Mappings.create(query);
  for (Bind b : lb){
    List<Node> list = new ArrayList<Node>();
    
    for (Node qNode : query.getSelect()){
      IDatatype dt = b.getDatatypeValue(qNode.getLabel());
      if (dt == null){
        list.add(null);
      }
      else {
        Node node = graph.getNode(dt, true, false);
        list.add(node);
      }
    }
    Mapping map = Mapping.create(query.getSelect(), list);
    lMap.add(map);
  }
  return lMap;
}

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

void body() {
  Node resultVariable = graph.addProperty(RESULTVARIABLE);
    for (Node n : query.getSelect()) {
    graph.addEdge(root, resultVariable, getVariable(n));
  }
  int i = 0;
  for (Mapping m : map) {
    process(m,  i++);
  }
}

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

void body(Serializer sb) {
  Query q = map.getQuery();
  for (Node n : q.getSelect()) {
    sb.append("rs:resultVariable '", getName(n));
    sb.appendPNL("'");
  }
  int i = 0;
  for (Mapping m : map) {
    process(m, sb, i++);
  }
}

代码示例来源:origin: fr.inria.wimmics/kggui

void fillTable(Mappings map) {
  Query q = map.getQuery();
  List<fr.inria.edelweiss.kgram.api.core.Node> vars = q.getSelect();
  if (q.isUpdate() && map.size() > 0){            
    vars = map.get(0).getQueryNodeList();

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

void process(Mapping m, Serializer sb, int i){
  Query q = map.getQuery();        
  sb.appendNL("rs:solution [");
  sb.appendPNL("rs:index ", i);
  for (Node n : q.getSelect()){
    if (m.getNode(n) != null){
      sb.appendNL("rs:binding [");
      sb.append("rs:variable '", getName(n));
      sb.appendPNL("'");
      sb.appendNL("rs:value ",     m.getValue(n));
      sb.appendPNL("]");
    }
  }
  sb.appendPNL("]");
}

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

void process(Mapping m,  int i){
  Node solution   = graph.addProperty(SOLUTION);        
  Node index      = graph.addProperty(INDEX);
  Node binding    = graph.addProperty(BINDING);
  Node variable   = graph.addProperty(VARIABLE);
  Node value      = graph.addProperty(VALUE);
  
  Node sol = graph.addBlank(bnid());
  graph.addEdge(root, solution, sol);
  graph.addEdge(sol, index, graph.addLiteral(i));
  for (Node n : query.getSelect()){
    if (m.getNode(n) != null){
      Node bind = graph.addBlank(bnid());
      graph.addEdge(sol, binding, bind);
      graph.addEdge(bind, variable, getVariable(n));
      graph.addEdge(bind, value, graph.addNode((IDatatype) m.getValue(n)));               
    }
  }
}

相关文章