Tabnine Logo
Slice
Code IndexAdd Tabnine to your IDE (free)

How to use
Slice
in
org.openrdf.query.algebra

Best Java code snippets using org.openrdf.query.algebra.Slice (Showing top 20 results out of 315)

origin: apache/marmotta

@Override
public void meet(Slice node) throws RuntimeException {
  if(node.hasLimit())
    limit = node.getLimit();
  if(node.hasOffset())
    offset = node.getOffset();
}
origin: org.openrdf.sesame/sesame-spin

public void visitAsk(Resource ask)
  throws OpenRDFException
{
  tupleNode = new SingletonSet();
  tupleRoot = new Slice(tupleNode, 0, 1);
  visitWhere(ask);
}
origin: org.openrdf.sesame/sesame-sail-rdbms

@Override
public void meet(Slice node)
  throws RuntimeException
{
  super.meet(node);
  if (node.getArg() instanceof SelectQuery) {
    SelectQuery query = (SelectQuery)node.getArg();
    if (node.getOffset() > 0) {
      query.setOffset(node.getOffset());
    }
    if (node.getLimit() >= 0) {
      query.setLimit(node.getLimit());
    }
    node.replaceWith(query);
  }
}
origin: org.openrdf.sesame/sesame-queryalgebra-model

public Slice(TupleExpr arg, long offset2, long limit2) {
  super(arg);
  setOffset(offset2);
  setLimit(limit2);
}
origin: org.openrdf.sesame/sesame-queryalgebra-model

@Override
public boolean equals(Object other) {
  if (other instanceof Slice && super.equals(other)) {
    Slice o = (Slice)other;
    return offset == o.getOffset() && limit == o.getLimit();
  }
  return false;
}
origin: org.openrdf.sesame/sesame-queryrender

Slice aSlice = new Slice();
  aSlice.setLimit(mLimit);
  aSlice.setOffset(mOffset);
origin: apache/marmotta

@Override
public void meet(Slice node) throws RuntimeException {
  TupleExpr child = node.getArg();
  if(!isSupported(child) && child instanceof UnaryTupleOperator) {
    UnaryTupleOperator replacement = (UnaryTupleOperator)child.clone();
    // switch positions of child and node
    node.replaceWith(replacement);
    node.setArg(((UnaryTupleOperator) child).getArg().clone());
    replacement.setArg(node.clone());
    // visit the newly inserted replacement node (i.e. the clone of child now containing the old "node" as
    // child, so "node" can be bubbled down further if needed)
    replacement.visit(this);
  }
}
origin: org.openrdf.sesame/sesame-spin

  @Override
  public void meet(Slice node)
    throws RDFHandlerException
  {
    if (!isSubQuery) { // ignore root slice
      node.getArg().visit(this);
    }
    else {
      super.meet(node);
    }
  }
}
origin: org.openrdf.elmo/elmo-repository

@Override
public void meet(Slice node) {
  handleType(SeRQO.SLICE);
  handleLiteral(SeRQO.LIMIT, node.getLimit());
  handleLiteral(SeRQO.OFFSET, node.getOffset());
  super.meet(node);
}
origin: org.openrdf.sesame/sesame-spin

Slice slice = new Slice(tupleRoot);
if (offset > 0L) {
  slice.setOffset(offset);
  slice.setLimit(limit);
origin: org.openrdf.elmo/elmo-repository

@Override
public void meet(Slice node) {
  if (predicate.equals(SeRQO.LIMIT)) {
    Literal lit = (Literal) object;
    node.setLimit(lit.intValue());
  } else if (predicate.equals(SeRQO.OFFSET)) {
    Literal lit = (Literal) object;
    node.setOffset(lit.intValue());
  } else {
    super.meet(node);
  }
}
origin: org.openrdf.sesame/sesame-queryrender

/**
 * @inheritDoc
 */
@Override
public void meet(final Slice theSlice)
  throws Exception
{
  if (theSlice.hasOffset()) {
    mOffset = theSlice.getOffset();
  }
  if (theSlice.hasLimit()) {
    mLimit = theSlice.getLimit();
  }
  theSlice.visitChildren(this);
}
origin: eu.fbk.rdfpro/rdfpro-rules

offset = slice.getOffset() < 0 ? null : slice.getOffset();
limit = slice.getLimit() < 0 ? null : slice.getLimit();
if (form == null && slice.getOffset() == 0 && slice.getLimit() == 1) {
  if (forceSelect) {
    form = Form.SELECT;
origin: com.mysema.rdf/rdfbean-sesame

Long limit = modifiers.getLimit();
Long offset = modifiers.getOffset();
tuple = new Slice(
    tuple,
    offset != null ? offset.intValue() : 0,
origin: org.openrdf.sesame/sesame-queryalgebra-evaluation

public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Slice slice, BindingSet bindings)
  throws QueryEvaluationException
{
  CloseableIteration<BindingSet, QueryEvaluationException> result = evaluate(slice.getArg(), bindings);
  if (slice.hasOffset()) {
    result = new OffsetIteration<BindingSet, QueryEvaluationException>(result, slice.getOffset());
  }
  if (slice.hasLimit()) {
    result = new LimitIteration<BindingSet, QueryEvaluationException>(result, slice.getLimit());
  }
  return result;
}
origin: eu.fbk.knowledgestore/ks-server

offset = slice.getOffset() < 0 ? null : slice.getOffset();
limit = slice.getLimit() < 0 ? null : slice.getLimit();
if (form == null && slice.getOffset() == 0 && slice.getLimit() == 1) {
  if (forceSelect) {
    form = Form.SELECT;
origin: com.mysema.rdf/rdfbean-sesame2

Long limit = modifiers.getLimit();
Long offset = modifiers.getOffset();
tuple = new Slice(
    tuple,
    offset != null ? offset.intValue() : 0,
origin: org.apache.rya/rya.sail

public CloseableIteration evaluate(Slice slice, BindingSet bindings)
    throws QueryEvaluationException {
  CloseableIteration result = evaluate(slice.getArg(), bindings);
  if (slice.hasOffset()) {
    result = new OffsetIteration(result, slice.getOffset());
  }
  if (slice.hasLimit()) {
    result = new LimitIteration(result, slice.getLimit());
  }
  return result;
}
origin: com.mysema.rdf/rdfbean-sesame3

Long limit = modifiers.getLimit();
Long offset = modifiers.getOffset();
tuple = new Slice(
    tuple,
    offset != null ? offset.intValue() : 0,
origin: org.openrdf.sesame/sesame-queryalgebra-evaluation

/**
 * Returns the limit of the current variable bindings before any further
 * projection.
 */
protected long getLimit(QueryModelNode node) {
  long offset = 0;
  if (node instanceof Slice) {
    Slice slice = (Slice)node;
    if (slice.hasOffset() && slice.hasLimit()) {
      return slice.getOffset() + slice.getLimit();
    }
    else if (slice.hasLimit()) {
      return slice.getLimit();
    }
    else if (slice.hasOffset()) {
      offset = slice.getOffset();
    }
  }
  QueryModelNode parent = node.getParentNode();
  if (parent instanceof Distinct || parent instanceof Reduced || parent instanceof Slice) {
    long limit = getLimit(parent);
    if (offset > 0L && limit < Long.MAX_VALUE) {
      return offset + limit;
    }
    else {
      return limit;
    }
  }
  return Long.MAX_VALUE;
}
org.openrdf.query.algebraSlice

Javadoc

The SLICE operator, as defined in SPARQL Query Language for RDF. The SLICE operator selects specific results from the underlying tuple expression based on an offset and limit value (both optional).

Most used methods

  • getLimit
  • getOffset
  • <init>
  • hasLimit
    Checks whether the row selection has a (valid) limit.
  • hasOffset
    Checks whether the row selection has a (valid) offset.
  • getArg
  • setLimit
  • setOffset
  • replaceWith
  • clone
  • setArg
  • visitChildren
  • setArg,
  • visitChildren

Popular in Java

  • Making http post requests using okhttp
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • Menu (java.awt)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now