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

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

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

Query.setCorrect介绍

暂无

代码示例

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

void bindings(Query q, ASTQuery ast) {
    Exp bind = bindings(ast.getValues());
    if (bind == null) {
      q.setCorrect(false);
      q.addError("Value Bindings: ", "#values != #variables");
    } else {
      q.setValues(bind);
      if (ast.getValues().isMoved()) {
        //q.setTemplateMappings(bind.getMappings());
        q.getValues().setPostpone(true);
      } 
//            else {
//                q.setMappings(bind.getMappings());
//                q.setBindingNodes(bind.getNodeList());
//            }
    }
  }

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

/**
 * insert data {<a> ex:p <b>} Ground pattern (no variable) Processed as a
 * construct query in the target graph
 */
Mappings insert(Query q, Composite ope, Mapping m) {
  ASTQuery ast = createAST(q, ope);
  ast.setInsert(true);
  Exp exp = ope.getData();
  if (!exp.validateData(ast)) {
    if (isDebug) {
      logger.debug("** Update: insert not valid: " + exp);
    }
    q.setCorrect(false);
    return Mappings.create(q);
  }
  if (exp != null) {
    ast.setBody(BasicGraphPattern.create());
    ast.setInsert(exp);
    ast.setInsertData(true);
  }
  // Processed as a construct (add) on target graph
  //return manager.query(q, ast);
  return update(q, ast, m);
}

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

void bindings(Query q, ASTQuery ast) {
    Exp bind = bindings(ast.getValues());
    if (bind == null) {
      q.setCorrect(false);
      q.addError("Value Bindings: ", "#values != #variables");
    } else {
      q.setValues(bind);
      if (ast.getValues().isMoved()) {
        //q.setTemplateMappings(bind.getMappings());
        q.getValues().setPostpone(true);
      } 
//            else {
//                q.setMappings(bind.getMappings());
//                q.setBindingNodes(bind.getNodeList());
//            }
    }
  }

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

/**
 * insert data {<a> ex:p <b>} Ground pattern (no variable) Processed as a
 * construct query in the target graph
 */
Mappings insert(Query q, Composite ope, Mapping m) {
  ASTQuery ast = createAST(q, ope);
  ast.setInsert(true);
  Exp exp = ope.getData();
  if (!exp.validateData(ast)) {
    if (isDebug) {
      logger.debug("** Update: insert not valid: " + exp);
    }
    q.setCorrect(false);
    return Mappings.create(q);
  }
  if (exp != null) {
    ast.setBody(BasicGraphPattern.create());
    ast.setInsert(exp);
    ast.setInsertData(true);
  }
  // Processed as a construct (add) on target graph
  //return manager.query(q, ast);
  return update(q, ast, m);
}

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

q.setCorrect(false);
if (isDebug) {
  logger.debug("** Failure: " + u);

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

q.setCorrect(false);
if (isDebug) {
  logger.debug("** Failure: " + u);

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

/**
 * delete data {<a> ex:p <b>} Ground pattern (no variable) Processed by
 * Construct as a delete query in the target graph
 *
 */
Mappings delete(Query q, Composite ope, Mapping m) {
  ASTQuery ast = createAST(q, ope);
  ast.setDelete(true);
  Exp exp = ope.getData();
  if (!exp.validateData(ast) || !exp.validateDelete()) {
    q.setCorrect(false);
    q.addError("** Update: delete not valid: ", exp);
    return Mappings.create(q);
  }
  if (exp != null) {
    ast.setBody(BasicGraphPattern.create());
    ast.setDelete(exp);
    ast.setDeleteData(true);
  }
  return update(q, ast, m);
}

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

/**
 * delete data {<a> ex:p <b>} Ground pattern (no variable) Processed by
 * Construct as a delete query in the target graph
 *
 */
Mappings delete(Query q, Composite ope, Mapping m) {
  ASTQuery ast = createAST(q, ope);
  ast.setDelete(true);
  Exp exp = ope.getData();
  if (!exp.validateData(ast) || !exp.validateDelete()) {
    q.setCorrect(false);
    q.addError("** Update: delete not valid: ", exp);
    return Mappings.create(q);
  }
  if (exp != null) {
    ast.setBody(BasicGraphPattern.create());
    ast.setDelete(exp);
    ast.setDeleteData(true);
  }
  return update(q, ast, m);
}

代码示例来源: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());
    }
  }
}

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

q.setCorrect(false);
q.addError("Error: Blank Node in Delete", "");
return Mappings.create(q);

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

q.setCorrect(false);
q.addError("Error: Blank Node in Delete", "");
return Mappings.create(q);

相关文章