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

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

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

Query.getOffset介绍

暂无

代码示例

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

@Override
public void visitOffset(Query query)
{
  x ^= query.getOffset() ;
}

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

offset = query.getOffset();

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

@Override
public void visitOffset(Query query1)
{
  check("OFFSET", query1.getOffset() == query2.getOffset() ) ;
}

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

@Override
public void visitOffset(Query query) {
  newQuery.setOffset(query.getOffset()) ;
}

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

@Override
public void visitOffset(Query query) {
  newQuery.setOffset(query.getOffset());
}

代码示例来源: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 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

@Override
public void visitOffset(Query query)
{
  if ( query.hasOffset() )
  {
    out.print("OFFSET  "+query.getOffset()) ;
    out.newline() ; 
  }
}

代码示例来源: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: tarql/tarql

/**
 * Sets up a new query execution.
 * 
 * @param source The input CSV file
 * @param options Configuration options for the CSV file
 * @param query The input query
 */
public TarqlQueryExecution(InputStreamSource source, CSVOptions options, TarqlQuery query) {
  if (options == null) {
    options = new CSVOptions();
  }
  if (options.hasColumnNamesInFirstRow() == null) {
    // Presence or absence of header row was not specified on command line or FROM clause.
    // So we fall back to the convention where OFFSET 1 in the query
    // indicates that a header is present. To make that work, we
    // set the OFFSET to 0 and tell the parser to gobble up the first
    // row for column names.
    options = new CSVOptions(options);
    Query firstQuery = query.getQueries().get(0);
    if (firstQuery.getOffset() == 1) {
      options.setColumnNamesInFirstRow(true);
      firstQuery.setOffset(0);
    }
  }
  table = new CSVTable(source, options);
  tq = query;
}

代码示例来源: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: Galigator/openllet

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

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

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

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

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

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

offset = query.getOffset() + 1;
query.setOffset(Query.NOLIMIT);

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

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

相关文章