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

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

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

Query.getLimit介绍

暂无

代码示例

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

@Override
public void visitLimit(Query query)
{
  x ^= query.getLimit() ;
}

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

long limit = query.getLimit(), offset = 0;

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

@Override
public void visitLimit(Query query1)
{
  check("LIMIT", query1.getLimit() == query2.getLimit() ) ;
}

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

@Override
public void visitLimit(Query query) {
  newQuery.setLimit(query.getLimit());
}

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

@Override
public void visitLimit(Query query) {
  newQuery.setLimit(query.getLimit()) ;
}

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

public QueryPaginator(Query query, Long nextOffset)
{
  this.query = query;
  this.nextOffset = query.getOffset() == Query.NOLIMIT ? 0 : query.getOffset();
  this.nextRemaining = query.getLimit() == Query.NOLIMIT ? null : query.getLimit();
}

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

public static Range<Long> toRange(Query query) {
  Range<Long> result = toRange(query.getOffset(), query.getLimit());
  return result;
}

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

public QueryExecution createQueryExecution(Query query) {
  if(limit != null) {
    if(query.getLimit() == Query.NOLIMIT) {
      if(doCloneQuery) {
        query = query.cloneQuery();
      }
      query.setLimit(limit);
    } else {
      long adjustedLimit = Math.min(limit, query.getLimit());
      if(adjustedLimit != query.getLimit()) {
        if(doCloneQuery) {
          query = query.cloneQuery();
        }
        query.setLimit(adjustedLimit);
      }
    }
  }
  return super.createQueryExecution(query);
}

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

@Override
public void visitLimit(Query query)
{
  if ( query.hasLimit() )
  {
    out.print("LIMIT   "+query.getLimit()) ;
    out.newline() ; 
  }
}

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

public PaginationQueryIterator createQueryIterator(Long offset, Long limit) {

    long o = offset == null ? 0 : offset;
    long l = limit == null ? Long.MAX_VALUE : limit;

    long queryOffset = proto.getOffset() == Query.NOLIMIT ? 0 : proto.getOffset();

    long itemOffset = queryOffset + o;

    long queryLimit = proto.getLimit() == Query.NOLIMIT ? Long.MAX_VALUE : proto.getLimit() - o;

    long itemLimit = Math.min(queryLimit, l);
    itemLimit = itemLimit == Long.MAX_VALUE ? Query.NOLIMIT : itemLimit;

    Query clone = proto.cloneQuery();
    clone.setOffset(itemOffset);
    clone.setLimit(itemLimit);

    PaginationQueryIterator result = new PaginationQueryIterator(clone, pageSize);
    return result;
  }
}

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

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

@Override
public QueryExecution createQueryExecution(Query query) {
  Query q = query.cloneQuery();
  long offset = q.getOffset() == Query.NOLIMIT ? 0 : q.getOffset();
  long limit = q.getLimit();
  long o = (offset / pageExpandSize) * pageExpandSize;
  long l;
  if(limit != Query.NOLIMIT) {
    long target = offset + limit;
    long t = ((target / pageExpandSize) + 1) * pageExpandSize;
    l = t - o;
  } else {
    l = Query.NOLIMIT;
  }
  long start = o - offset;
  // Align offset and target to pageExpandSize boundaries
  q.setOffset(o);
  q.setLimit(l);
  QueryExecution qe = qef.createQueryExecution(q);
  //QueryExecutionRange result = new QueryExecutionRange(qe, start, l);
  QueryExecution result = null;
  return result;
}

代码示例来源:origin: com.github.galigator.openllet/openllet-jena

final long limit = _query.hasLimit() ? _query.getLimit() : Long.MAX_VALUE;
results = new SlicedResultSet(results, offset, limit);

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

if (!q.hasLimit() || q.getLimit() > this.maxRows) {
  LOGGER.info("Enforced max rows on results by applying LIMIT {} to the query", this.maxRows);
  q.setLimit(this.maxRows);

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

if (!q.hasLimit() || q.getLimit() > this.maxRows) {
  LOGGER.info("Enforced max rows on results by applying LIMIT {} to the query", this.maxRows);
  q.setLimit(this.maxRows);

代码示例来源:origin: Galigator/openllet

final long limit = _query.hasLimit() ? _query.getLimit() : Long.MAX_VALUE;
results = new SlicedResultSet(results, offset, limit);

代码示例来源:origin: Galigator/openllet

final long limit = _query.hasLimit() ? _query.getLimit() : Long.MAX_VALUE;
results = new SlicedResultSet(results, offset, limit);

代码示例来源:origin: com.marklogic/marklogic-jena

Long offset = null;
if (query.hasLimit()) {
  limit = query.getLimit();
  query.setLimit(Query.NOLIMIT);

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

op = new OpSlice(op, query.getOffset() /*start*/, query.getLimit()/*length*/) ;

相关文章