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

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

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

Query.isConstruct介绍

暂无

代码示例

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

  1. public boolean isSelect(){
  2. return ! (isConstruct() || isUpdate() || isDelete());
  3. }

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

  1. public static Construct create(Query q) {
  2. Construct cons = new Construct(q);
  3. if (q.isDetail()) {
  4. if (q.isConstruct()) {
  5. cons.setInsertList(new ArrayList<Edge>());
  6. } else {
  7. cons.setDeleteList(new ArrayList<Edge>());
  8. }
  9. }
  10. return cons;
  11. }

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

  1. public int getLimitOffset() {
  2. // when order by/group by/count(), return all results, group sort agg, and then apply offset/limit
  3. if (!isConstruct()
  4. && (isOrderBy() || hasGroupBy() || isAggregate())) {
  5. return Integer.MAX_VALUE;
  6. }
  7. if (limit < Integer.MAX_VALUE - offset) {
  8. return limit + offset;
  9. } else {
  10. return limit;
  11. }
  12. }

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

  1. void finish(Query qq) {
  2. setNbsolutions(size());
  3. if (qq.hasGroupBy() && !qq.isConstruct()) {
  4. // after group by (and aggregate), leave one Mapping for each group
  5. // with result of the group
  6. groupBy();
  7. } else if (qq.getHaving() != null) {
  8. // clause 'having' with no group by
  9. // select (max(?x) as ?max where {}
  10. // having(?max > 100)
  11. having();
  12. } else if (qq.isAggregate() && !qq.isConstruct()) {
  13. clean();
  14. }
  15. }

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

  1. if (q.isConstruct()) {
  2. displayGraph((Graph) map.getGraph(), ast.getNSM());

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

  1. /**
  2. * pname is property name queries are construct where find a query with
  3. * construct {?x pname ?y} process the query use case: ProducerImpl
  4. * getEdges() computed by construct-where
  5. */
  6. Mappings process(Node start, String pname, int index) {
  7. for (Query q : getQueries()) {
  8. if (q.isConstruct()) {
  9. Exp cons = q.getConstruct();
  10. for (Exp ee : cons.getExpList()) {
  11. if (ee.isEdge()) {
  12. Edge edge = ee.getEdge();
  13. if (edge.getLabel().equals(pname)) {
  14. Mapping bind = null;
  15. if (start != null) {
  16. bind = Mapping.create(edge.getNode(index), start);
  17. }
  18. Mappings map = process(q, bind);
  19. return map;
  20. }
  21. }
  22. }
  23. }
  24. }
  25. return null;
  26. }

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

  1. String mapToString(){
  2. Query q = map.getQuery();
  3. if (q == null) {
  4. return "";
  5. }
  6. ASTQuery ast = (ASTQuery) q.getAST();
  7. if (q.isTemplate()
  8. || (q.hasPragma(Pragma.TEMPLATE) && map.getGraph() != null)) {
  9. return TemplateFormat.create(map).toString();
  10. } else {
  11. if (type == UNDEF_FORMAT) {
  12. if (q.isConstruct()) {
  13. type = getConstructFormat();
  14. }
  15. else {
  16. type = getSelectFormat();
  17. }
  18. }
  19. return process(map, type);
  20. }
  21. }

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

  1. String query(String query){
  2. try {
  3. Mappings map = exec.query(query);
  4. Query q = map.getQuery();
  5. ASTQuery ast = (ASTQuery) q.getAST();
  6. String str = null;
  7. if (q.isConstruct() && map.getGraph()!=null){
  8. Graph g = (Graph) map.getGraph();
  9. RDFFormat p = RDFFormat.create(g, ast.getNSM());
  10. str = p.toString();
  11. }
  12. else {
  13. XMLFormat f = XMLFormat.create(map);
  14. str = f.toString();
  15. }
  16. return str;
  17. }
  18. catch (EngineException e) {
  19. // TODO Auto-generated catch block
  20. e.printStackTrace();
  21. }
  22. return null;
  23. }

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

  1. /**
  2. * query is the global Query ast is the current update action use case:
  3. * delete insert data delete insert where In case of data, fake an empty
  4. * where and process as a where update.
  5. */
  6. Mappings update(Query query, ASTQuery ast, Mapping m) {
  7. //System.out.println("** QP:\n" + m.getBind());
  8. exec.logStart(query);
  9. Query q = exec.compile(ast, ds);
  10. Mapping mm = m;
  11. if (m != null && m.size() == 0 && m.getBind() != null) {
  12. // m contains LDScript binding stack
  13. // generate appropriate Mapping for query q from this stack.
  14. mm = Mapping.create(q, m.getBind());
  15. }
  16. Mappings map = exec.query(q, mm);
  17. //Mappings map = exec.basicQuery(ast, null, ds);
  18. //Query q = map.getQuery();
  19. // PRAGMA: update can be both delete & insert
  20. if (q.isDelete()) {
  21. manager.delete(q, map, ds);
  22. }
  23. if (q.isConstruct()) {
  24. // insert
  25. manager.insert(q, map, ds);
  26. }
  27. exec.logFinish(query, map);
  28. return map;
  29. }

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

  1. /**
  2. * query is the global Query ast is the current update action use case:
  3. * delete insert data delete insert where In case of data, fake an empty
  4. * where and process as a where update.
  5. */
  6. Mappings update(Query query, ASTQuery ast, Mapping m) {
  7. //System.out.println("** QP:\n" + m.getBind());
  8. exec.logStart(query);
  9. Query q = exec.compile(ast, ds);
  10. Mapping mm = m;
  11. if (m != null && m.size() == 0 && m.getBind() != null) {
  12. // m contains LDScript binding stack
  13. // generate appropriate Mapping for query q from this stack.
  14. mm = Mapping.create(q, m.getBind());
  15. }
  16. Mappings map = exec.query(q, mm);
  17. //Mappings map = exec.basicQuery(ast, null, ds);
  18. //Query q = map.getQuery();
  19. // PRAGMA: update can be both delete & insert
  20. if (q.isDelete()) {
  21. manager.delete(q, map, ds);
  22. }
  23. if (q.isConstruct()) {
  24. // insert
  25. manager.insert(q, map, ds);
  26. }
  27. exec.logFinish(query, map);
  28. return map;
  29. }

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

  1. map = synQuery(q, m);
  2. if (q.isConstruct()) {

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

  1. Query qq = sub.getQuery();
  2. qq.setFun(true);
  3. if (qq.isConstruct() || qq.isUpdate()) {

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

  1. Query qq = sub.getQuery();
  2. qq.setFun(true);
  3. if (qq.isConstruct() || qq.isUpdate()) {

相关文章