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

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

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

Query.isCorrect介绍

暂无

代码示例

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

/**
 * PPrint SPARQL query into SPIN Turtle using Visitor, parse SPIN Turtle
 * into RDF Graph, PPrint RDF graph using templates back into SPARQL
 */
public String toSpinSparql(String sparql) throws EngineException {
  if (isDebug) {
    System.out.println("Input: \n" + sparql);
  }
  Query qq = exec.compile(sparql);
  if (isSPARQLCompliant && !qq.isCorrect()) {
    return sparql;
  }
  return toSpinSparql(exec.getAST(qq));
}

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

/**
 * Implement SPARQL compliance
 */
Mappings sparqlQueryUpdate(String squery, Dataset ds, int entail) throws EngineException {
  getEvaluator().setMode(Evaluator.SPARQL_MODE);
  setSPARQLCompliant(true);
  if (entail != STD_ENTAILMENT) {
    // include RDF/S entailments in the default graph
    if (ds == null) {
      ds = Dataset.create();
    }
    if (ds.getFrom() == null) {
      ds.defFrom();
    }
    complete(ds);
  }
  // SPARQL compliance
  ds.complete();
  Mappings map = query(squery, null, ds);
  if (!map.getQuery().isCorrect()) {
    map.clear();
  }
  return map;
}

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

相关文章