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

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

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

Query.create介绍

[英]path(?from path ?to) . filter(?from = cst || ?to = cst) create {path(?from path ?to) . filter(?from = cst)} UNION {path(?from path ?to) . filter(?to = cst)}
[中]路径(?从路径?到)。filter(?from=cst | |?to=cst)创建{path(?from path?to)。filter(?from=cst)}联合{path(?from path?to)。filter(?to=cst)}

代码示例

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

Query create(Exp exp) {
  Query q = Query.create(exp);
  if (sort != null) {
    q.set(sort);
  }
  return q;
}

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

Query create(Exp exp) {
  Query q = Query.create(exp);
  if (sort != null) {
    q.set(sort);
  }
  return q;
}

代码示例来源: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

/**
 * ********************************************************************
 *
 * 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/compiler

/**
 * For query and subquery Generate a new compiler for each (sub) query in
 * order to get fresh new nodes
 */
Query compile(ASTQuery ast) {
  Exp ee = compile(ast.getExtBody(), false);
  Query q = Query.create(ee);
  q.setUseBind(isUseBind);
  compileFunction(q, ast);
  q.setAST(ast);
  q.setHasFunctional(ast.hasFunctional());
  q.setService(ast.getService());
  // use same compiler
  values(q, ast);
  path(q, ast);
  return q;
}

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

/**
 * For query and subquery Generate a new compiler for each (sub) query in
 * order to get fresh new nodes
 */
Query compile(ASTQuery ast) {
  Exp ee = compile(ast.getExtBody(), false);
  Query q = Query.create(ee);
  q.setUseBind(isUseBind);
  compileFunction(q, ast);
  q.setAST(ast);
  q.setHasFunctional(ast.hasFunctional());
  q.setService(ast.getService());
  // use same compiler
  values(q, ast);
  path(q, ast);
  return q;
}

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

/**
 * Compile Graph into a BGP Generate a Query
 */
public Query getQuery() {
  Transformer t = Transformer.create();
  ASTQuery ast = ASTQuery.create();
  ast.setSelectAll(true);
  ast.setBody(BasicGraphPattern.create());
  ast = visitor.visit(ast);
  graph = visitor.visit(graph);
  Exp exp = getExp(graph);
  Query q = Query.create(exp);
  q.setAST(ast);
  q = t.transform(q, ast);
  q.setDebug(isDebug);
  q = visitor.visit(q);
  if (isConstruct()) {
    // TODO: blanks in construct should be renamed
    q.setConstruct(q.getBody());
    q.setConstruct(true);
  }
  return q;
}

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

/**
 * Compile Graph into a BGP Generate a Query
 */
public Query getQuery() {
  Transformer t = Transformer.create();
  ASTQuery ast = ASTQuery.create();
  ast.setSelectAll(true);
  ast.setBody(BasicGraphPattern.create());
  ast = visitor.visit(ast);
  graph = visitor.visit(graph);
  Exp exp = getExp(graph);
  Query q = Query.create(exp);
  q.setAST(ast);
  q = t.transform(q, ast);
  q.setDebug(isDebug);
  q = visitor.visit(q);
  if (isConstruct()) {
    // TODO: blanks in construct should be renamed
    q.setConstruct(q.getBody());
    q.setConstruct(true);
  }
  return q;
}

相关文章