org.apache.jena.query.Query.addOrderBy()方法的使用及代码示例

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

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

Query.addOrderBy介绍

暂无

代码示例

代码示例来源:origin: apache/jena

  1. /**
  2. * Add an expression to the order by clause.
  3. * @param expr The expression to add.
  4. * @param order The direction of the ordering.
  5. */
  6. public void addOrderBy(Expr expr, Order order) {
  7. query.addOrderBy(expr, order == Order.ASCENDING ? Query.ORDER_ASCENDING
  8. : Query.ORDER_DESCENDING);
  9. }

代码示例来源:origin: apache/jena

  1. /**
  2. * Add an order by clause
  3. * @param condition The SortCondition to add to the order by.
  4. */
  5. public void addOrderBy(SortCondition condition) {
  6. query.addOrderBy(condition);
  7. }

代码示例来源:origin: apache/jena

  1. /**
  2. * Add a var to the order by clause.
  3. * @param var The var to sort by.
  4. * @param order The direction of the ordering.
  5. */
  6. public void addOrderBy(Var var, Order order) {
  7. query.addOrderBy(var, order == Order.ASCENDING ? Query.ORDER_ASCENDING
  8. : Query.ORDER_DESCENDING);
  9. }

代码示例来源:origin: apache/jena

  1. /**
  2. * Add an expression to the order by clause.
  3. * Sorts in Default order.
  4. * @param expr The expression to add.
  5. */
  6. public void addOrderBy(Expr expr) {
  7. query.addOrderBy(expr, Query.ORDER_DEFAULT);
  8. }

代码示例来源:origin: org.apache.jena/jena-querybuilder

  1. /**
  2. * Add an expression to the order by clause.
  3. * @param expr The expression to add.
  4. * @param order The direction of the ordering.
  5. */
  6. public void addOrderBy(Expr expr, Order order) {
  7. query.addOrderBy(expr, order == Order.ASCENDING ? Query.ORDER_ASCENDING
  8. : Query.ORDER_DESCENDING);
  9. }

代码示例来源:origin: apache/jena

  1. /**
  2. * Add a var to the order by clause.
  3. * Sorts in default order
  4. * @param var The var to use for sorting
  5. */
  6. public void addOrderBy(Var var) {
  7. query.addOrderBy(var, Query.ORDER_DEFAULT);
  8. }

代码示例来源:origin: org.apache.jena/jena-querybuilder

  1. /**
  2. * Add an expression to the order by clause.
  3. * Sorts in Default order.
  4. * @param expr The expression to add.
  5. */
  6. public void addOrderBy(Expr expr) {
  7. query.addOrderBy(expr, Query.ORDER_DEFAULT);
  8. }

代码示例来源:origin: org.apache.jena/jena-querybuilder

  1. /**
  2. * Add an order by clause
  3. * @param condition The SortCondition to add to the order by.
  4. */
  5. public void addOrderBy(SortCondition condition) {
  6. query.addOrderBy(condition);
  7. }

代码示例来源:origin: org.apache.jena/jena-querybuilder

  1. /**
  2. * Add a var to the order by clause.
  3. * Sorts in default order
  4. * @param var The var to use for sorting
  5. */
  6. public void addOrderBy(Var var) {
  7. query.addOrderBy(var, Query.ORDER_DEFAULT);
  8. }

代码示例来源:origin: org.apache.jena/jena-querybuilder

  1. /**
  2. * Add a var to the order by clause.
  3. * @param var The var to sort by.
  4. * @param order The direction of the ordering.
  5. */
  6. public void addOrderBy(Var var, Order order) {
  7. query.addOrderBy(var, order == Order.ASCENDING ? Query.ORDER_ASCENDING
  8. : Query.ORDER_DESCENDING);
  9. }

代码示例来源:origin: apache/jena

  1. public void addOrderBy(Expr expr, int direction)
  2. {
  3. SortCondition sc = new SortCondition(expr, direction) ;
  4. addOrderBy(sc) ;
  5. }

代码示例来源:origin: apache/jena

  1. @Override
  2. public void visitOrderBy(Query query) {
  3. if (query.hasOrderBy()) {
  4. for (SortCondition sc : query.getOrderBy())
  5. newQuery.addOrderBy(sc);
  6. }
  7. }

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

  1. @Override
  2. public void visitOrderBy(Query query) {
  3. if ( query.hasOrderBy() ) {
  4. for (SortCondition sc : query.getOrderBy())
  5. newQuery.addOrderBy(sc) ;
  6. }
  7. }

代码示例来源:origin: apache/jena

  1. public void addOrderBy(Node var, int direction)
  2. {
  3. if ( ! var.isVariable() )
  4. throw new QueryException("Not a variable: "+var) ;
  5. SortCondition sc = new SortCondition(var, direction) ;
  6. addOrderBy(sc) ;
  7. }

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

  1. public static Query createQueryList(OrderedConcept orderedConcept, Long limit, Long offset) {
  2. Concept concept = orderedConcept.getConcept();
  3. Query result = createQueryList(concept, limit, offset);
  4. for(SortCondition sc : orderedConcept.getOrderBy()) {
  5. result.addOrderBy(sc);
  6. }
  7. return result;
  8. }

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

  1. public static Query createQueryList(OrderedConcept orderedConcept, Range<Long> range) {
  2. Concept concept = orderedConcept.getConcept();
  3. Query result = createQueryList(concept, range);
  4. for(SortCondition sc : orderedConcept.getOrderBy()) {
  5. result.addOrderBy(sc);
  6. }
  7. return result;
  8. }

代码示例来源:origin: apache/jena

  1. public void addOrderBy(String varName, int direction)
  2. {
  3. varName = Var.canonical(varName) ;
  4. SortCondition sc = new SortCondition(new ExprVar(varName), direction) ;
  5. addOrderBy(sc) ;
  6. }

代码示例来源:origin: apache/jena

  1. /**
  2. * Copy all the modifications from the Solution Modifier argument
  3. * @param solutionModifier The solution modifier to copy from.
  4. */
  5. public void addAll(SolutionModifierHandler solutionModifier) {
  6. List<SortCondition> lst = solutionModifier.query.getOrderBy();
  7. if (lst != null) {
  8. for (SortCondition sc : lst) {
  9. query.addOrderBy(sc);
  10. }
  11. }
  12. query.getGroupBy().addAll(solutionModifier.query.getGroupBy());
  13. query.getHavingExprs().addAll(solutionModifier.query.getHavingExprs());
  14. query.setLimit(solutionModifier.query.getLimit());
  15. query.setOffset(solutionModifier.query.getOffset());
  16. }

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

  1. @Override
  2. public void visit(OpProject opProject)
  3. {
  4. /*
  5. if(dialect.equals(Dialect.VIRTUOSO)) {
  6. if(opProject.getSubOp() instanceof OpExtend) {
  7. //Set<Var> vars = GetVarsMentioned.getVarsMentioned(opProject.getSubOp());
  8. //OpProject project = new OpProject(opExtend, new ArrayList<Var>(vars));
  9. Query query = MyOpAsQuery.asQuery(opProject);
  10. //System.out.println(query);
  11. ElementSubQuery elt = new ElementSubQuery(query);
  12. ElementGroup g = currentGroup() ;
  13. g.addElement(elt) ;
  14. return;
  15. }
  16. }*/
  17. // Defer adding result vars until the end.
  18. // OpGroup generates dupes otherwise
  19. this.projectVars = opProject.getVars();
  20. opProject.getSubOp().visit(this) ;
  21. }

代码示例来源:origin: org.apache.jena/jena-querybuilder

  1. /**
  2. * Copy all the modifications from the Solution Modifier argument
  3. * @param solutionModifier The solution modifier to copy from.
  4. */
  5. public void addAll(SolutionModifierHandler solutionModifier) {
  6. List<SortCondition> lst = solutionModifier.query.getOrderBy();
  7. if (lst != null) {
  8. for (SortCondition sc : lst) {
  9. query.addOrderBy(sc);
  10. }
  11. }
  12. query.getGroupBy().addAll(solutionModifier.query.getGroupBy());
  13. query.getHavingExprs().addAll(solutionModifier.query.getHavingExprs());
  14. query.setLimit(solutionModifier.query.getLimit());
  15. query.setOffset(solutionModifier.query.getOffset());
  16. }

相关文章