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

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

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

Query.getFrom介绍

暂无

代码示例

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

/**
 * SPARQL algebra requires kgram to compute BGP exp and return Mappings
  List<Node> from = query.getFrom(gNode);
  Mappings map = p.getMappings(gNode, from, exp, memory);
 */
Mappings exec(Node gNode, Producer p, Exp exp, Mapping m){
  if (true){
    List<Node> from = query.getFrom(gNode);
    Mappings map = p.getMappings(gNode, from, exp, memory);
    return map;
  }
  Stack stack = Stack.create(exp);
  set(stack); 
  if (m != null){
    process(exp, m);
  }
  eval(p, gNode, stack, 0);
  Mappings map = Mappings.create(query);
  map.add(results);
  memory.start();
  results.clear();
  return map;
}

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

/**
 * inherit from and from named
 */
void inherit(Query q) {
  if (!isService()) {
    setFrom(q.getFrom());
    setNamed(q.getNamed());
  }
}

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

private int bgp(Producer p, Node gNode, Exp exp, Stack stack, int n) {
  int backtrack = n - 1;
  List<Node> from = query.getFrom(gNode);
  Mappings map = p.getMappings(gNode, from, exp, memory);
  
  for (Mapping m : map) {
    if (stop) {
      return STOP;
    }
    m.fixQueryNodes(query);
    boolean b = memory.push(m, n, false);
    if (b) {
      int back = eval(p, gNode, stack, n + 1);
      memory.pop(m);
      if (back < n) {
        return back;
      }
    }
  }
  return backtrack;
}

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

List<Node> from = query.getFrom(gNode);
  if (!p.isGraphNode(nextGraph, query.getFrom(nextGraph), env)) {
    return env.getIndex(nextGraph);
} else if (query.getFrom(nextGraph).size() > 0) {

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

Matcher mm = match;
int backtrack = n - 1;
for (Node graph : prod.getGraphNodes(gNode, qq.getFrom(gNode), env)) {
  if (//member(graph, query.getFrom(gNode)) && 
      mm.match(gNode, graph, env)

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

graphNodes = prod.getGraphNodes(name, qq.getFrom(name), env);

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

/**
 * Check occurrence of edge
 * If edge has an associated query, check class/property definition in ontology
 */
void edge(Node gNode, Exp exp, Environment env){
  Edge edge = exp.getEdge();
  boolean exist = false, match = false, define = false;
  for (Edge ent : producer.getEdges(gNode, query.getFrom(gNode), edge, env)){
    if (ent != null){
      exist = true;
      if (matcher.match(edge, ent, env)){
        match = true;
        break;
      }
    }
  }
  
  Query q = query.get(edge);
  if (q != null){
    Eval ee = Eval.create(producer, eval.getEvaluator(), matcher);
    Mappings map = ee.query(q);
    define = map.size()>0;
    report(edge, exist, match, define);
  }
  else {
    report(edge, exist, match);
  }
}

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

List<Node> list = qq.getFrom(gNode);

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

boolean isSuccess = false;
List<Node> list = qq.getFrom(gNode);
Node bNode = gNode;

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

void complete(Query qCurrent, ASTQuery ast) {
  qCurrent.collect();
  //qCurrent.setSelectFun(select(qCurrent, ast));
  select(qCurrent, ast);
  qCurrent.setOrderBy(orderBy(qCurrent, ast));
  qCurrent.setGroupBy(groupBy(qCurrent, ast));
  qCurrent.setDistinct(ast.isDistinct());
  // generate a DISTINCT(?x) for distinct ?x
  qCurrent.distinct();
  qCurrent.setFrom(nodes(ast.getActualFrom()));
  qCurrent.setNamed(nodes(ast.getActualNamed()));
  // sort from uri to speed up verification at query time 
  // Producer may use dichotomy
  qCurrent.setFrom(sort(qCurrent.getFrom()));
  qCurrent.setNamed(sort(qCurrent.getNamed()));
  qCurrent.setLimit(Math.min(ast.getMaxResult(), ast.getMaxProjection()));
  qCurrent.setOffset(ast.getOffset());
  qCurrent.setGraphNode(createNode());
  if (qCurrent.isCorrect()) {
    // check semantics of select vs aggregates and group by
    boolean correct = qCurrent.check();
    if (!correct) {
      qCurrent.setCorrect(false);
    } else {
      qCurrent.setCorrect(ast.isCorrect());
    }
  }
}

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

void complete(Query qCurrent, ASTQuery ast) {
  qCurrent.collect();
  //qCurrent.setSelectFun(select(qCurrent, ast));
  select(qCurrent, ast);
  qCurrent.setOrderBy(orderBy(qCurrent, ast));
  qCurrent.setGroupBy(groupBy(qCurrent, ast));
  qCurrent.setDistinct(ast.isDistinct());
  // generate a DISTINCT(?x) for distinct ?x
  qCurrent.distinct();
  qCurrent.setFrom(nodes(ast.getActualFrom()));
  qCurrent.setNamed(nodes(ast.getActualNamed()));
  // sort from uri to speed up verification at query time 
  // Producer may use dichotomy
  qCurrent.setFrom(sort(qCurrent.getFrom()));
  qCurrent.setNamed(sort(qCurrent.getNamed()));
  qCurrent.setLimit(Math.min(ast.getMaxResult(), ast.getMaxProjection()));
  qCurrent.setOffset(ast.getOffset());
  qCurrent.setGraphNode(createNode());
  if (qCurrent.isCorrect()) {
    // check semantics of select vs aggregates and group by
    boolean correct = qCurrent.check();
    if (!correct) {
      qCurrent.setCorrect(false);
    } else {
      qCurrent.setCorrect(ast.isCorrect());
    }
  }
}

相关文章