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

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

本文整理了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

  1. /**
  2. * PPrint SPARQL query into SPIN Turtle using Visitor, parse SPIN Turtle
  3. * into RDF Graph, PPrint RDF graph using templates back into SPARQL
  4. */
  5. public String toSpinSparql(String sparql) throws EngineException {
  6. if (isDebug) {
  7. System.out.println("Input: \n" + sparql);
  8. }
  9. Query qq = exec.compile(sparql);
  10. if (isSPARQLCompliant && !qq.isCorrect()) {
  11. return sparql;
  12. }
  13. return toSpinSparql(exec.getAST(qq));
  14. }

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

  1. /**
  2. * Implement SPARQL compliance
  3. */
  4. Mappings sparqlQueryUpdate(String squery, Dataset ds, int entail) throws EngineException {
  5. getEvaluator().setMode(Evaluator.SPARQL_MODE);
  6. setSPARQLCompliant(true);
  7. if (entail != STD_ENTAILMENT) {
  8. // include RDF/S entailments in the default graph
  9. if (ds == null) {
  10. ds = Dataset.create();
  11. }
  12. if (ds.getFrom() == null) {
  13. ds.defFrom();
  14. }
  15. complete(ds);
  16. }
  17. // SPARQL compliance
  18. ds.complete();
  19. Mappings map = query(squery, null, ds);
  20. if (!map.getQuery().isCorrect()) {
  21. map.clear();
  22. }
  23. return map;
  24. }

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

  1. void complete(Query qCurrent, ASTQuery ast) {
  2. qCurrent.collect();
  3. //qCurrent.setSelectFun(select(qCurrent, ast));
  4. select(qCurrent, ast);
  5. qCurrent.setOrderBy(orderBy(qCurrent, ast));
  6. qCurrent.setGroupBy(groupBy(qCurrent, ast));
  7. qCurrent.setDistinct(ast.isDistinct());
  8. // generate a DISTINCT(?x) for distinct ?x
  9. qCurrent.distinct();
  10. qCurrent.setFrom(nodes(ast.getActualFrom()));
  11. qCurrent.setNamed(nodes(ast.getActualNamed()));
  12. // sort from uri to speed up verification at query time
  13. // Producer may use dichotomy
  14. qCurrent.setFrom(sort(qCurrent.getFrom()));
  15. qCurrent.setNamed(sort(qCurrent.getNamed()));
  16. qCurrent.setLimit(Math.min(ast.getMaxResult(), ast.getMaxProjection()));
  17. qCurrent.setOffset(ast.getOffset());
  18. qCurrent.setGraphNode(createNode());
  19. if (qCurrent.isCorrect()) {
  20. // check semantics of select vs aggregates and group by
  21. boolean correct = qCurrent.check();
  22. if (!correct) {
  23. qCurrent.setCorrect(false);
  24. } else {
  25. qCurrent.setCorrect(ast.isCorrect());
  26. }
  27. }
  28. }

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

  1. void complete(Query qCurrent, ASTQuery ast) {
  2. qCurrent.collect();
  3. //qCurrent.setSelectFun(select(qCurrent, ast));
  4. select(qCurrent, ast);
  5. qCurrent.setOrderBy(orderBy(qCurrent, ast));
  6. qCurrent.setGroupBy(groupBy(qCurrent, ast));
  7. qCurrent.setDistinct(ast.isDistinct());
  8. // generate a DISTINCT(?x) for distinct ?x
  9. qCurrent.distinct();
  10. qCurrent.setFrom(nodes(ast.getActualFrom()));
  11. qCurrent.setNamed(nodes(ast.getActualNamed()));
  12. // sort from uri to speed up verification at query time
  13. // Producer may use dichotomy
  14. qCurrent.setFrom(sort(qCurrent.getFrom()));
  15. qCurrent.setNamed(sort(qCurrent.getNamed()));
  16. qCurrent.setLimit(Math.min(ast.getMaxResult(), ast.getMaxProjection()));
  17. qCurrent.setOffset(ast.getOffset());
  18. qCurrent.setGraphNode(createNode());
  19. if (qCurrent.isCorrect()) {
  20. // check semantics of select vs aggregates and group by
  21. boolean correct = qCurrent.check();
  22. if (!correct) {
  23. qCurrent.setCorrect(false);
  24. } else {
  25. qCurrent.setCorrect(ast.isCorrect());
  26. }
  27. }
  28. }

相关文章