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

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

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

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

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

/**
 * Add an order by clause
 * @param condition The SortCondition to add to the order by.
 */
public void addOrderBy(SortCondition condition) {
  query.addOrderBy(condition);
}

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

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

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

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

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

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

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

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

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

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

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

/**
 * Add an order by clause
 * @param condition The SortCondition to add to the order by.
 */
public void addOrderBy(SortCondition condition) {
  query.addOrderBy(condition);
}

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

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

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

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

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

public void addOrderBy(Expr expr, int direction)
{
  SortCondition sc = new SortCondition(expr, direction) ;
  addOrderBy(sc) ;
}

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

@Override
public void visitOrderBy(Query query) {
  if (query.hasOrderBy()) {
    for (SortCondition sc : query.getOrderBy())
      newQuery.addOrderBy(sc);
  }
}

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

@Override
public void visitOrderBy(Query query) {
  if ( query.hasOrderBy() ) {
    for (SortCondition sc : query.getOrderBy())
      newQuery.addOrderBy(sc) ;
  }
}

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

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

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

public static Query createQueryList(OrderedConcept orderedConcept, Long limit, Long offset) {
  Concept concept = orderedConcept.getConcept();
  Query result = createQueryList(concept, limit, offset);
  for(SortCondition sc : orderedConcept.getOrderBy()) {
    result.addOrderBy(sc);
  }
  return result;
}

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

public static Query createQueryList(OrderedConcept orderedConcept, Range<Long> range) {
  Concept concept = orderedConcept.getConcept();
  Query result = createQueryList(concept, range);
  for(SortCondition sc : orderedConcept.getOrderBy()) {
    result.addOrderBy(sc);
  }
  return result;
}

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

public void addOrderBy(String varName, int direction)
{ 
  varName = Var.canonical(varName) ;
  SortCondition sc = new SortCondition(new ExprVar(varName), direction) ;
  addOrderBy(sc) ;
}

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

/**
 * Copy all the modifications from the Solution Modifier argument
 * @param solutionModifier The solution modifier to copy from.
 */
public void addAll(SolutionModifierHandler solutionModifier) {
  List<SortCondition> lst = solutionModifier.query.getOrderBy();
  if (lst != null) {
    for (SortCondition sc : lst) {
      query.addOrderBy(sc);
    }
  }
  query.getGroupBy().addAll(solutionModifier.query.getGroupBy());
  query.getHavingExprs().addAll(solutionModifier.query.getHavingExprs());
  query.setLimit(solutionModifier.query.getLimit());
  query.setOffset(solutionModifier.query.getOffset());
}

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

@Override
public void visit(OpProject opProject)
{
  /*
  if(dialect.equals(Dialect.VIRTUOSO)) {
    if(opProject.getSubOp() instanceof OpExtend) {
      //Set<Var> vars = GetVarsMentioned.getVarsMentioned(opProject.getSubOp());
      //OpProject project = new OpProject(opExtend, new ArrayList<Var>(vars));
      Query query = MyOpAsQuery.asQuery(opProject);
      //System.out.println(query);
      ElementSubQuery elt = new ElementSubQuery(query);
      ElementGroup g = currentGroup() ;
      g.addElement(elt) ;
      return;
    }
  }*/
  // Defer adding result vars until the end.
  // OpGroup generates dupes otherwise
  this.projectVars = opProject.getVars();
  opProject.getSubOp().visit(this) ;
}

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

/**
 * Copy all the modifications from the Solution Modifier argument
 * @param solutionModifier The solution modifier to copy from.
 */
public void addAll(SolutionModifierHandler solutionModifier) {
  List<SortCondition> lst = solutionModifier.query.getOrderBy();
  if (lst != null) {
    for (SortCondition sc : lst) {
      query.addOrderBy(sc);
    }
  }
  query.getGroupBy().addAll(solutionModifier.query.getGroupBy());
  query.getHavingExprs().addAll(solutionModifier.query.getHavingExprs());
  query.setLimit(solutionModifier.query.getLimit());
  query.setOffset(solutionModifier.query.getOffset());
}

相关文章