Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mindswap.pellet.query
Interface Query

All Known Implementing Classes:
  QueryImpl

    public interface Query

Author:
  Evren Sirin

Method Summary
`void` | `addConstraint(aterm.ATermAppl lit, Datatype dt)`
`void` | `addDistVar(aterm.ATermAppl var)` Add a distinguished variable to the query but not change the result variables.
`void` | `addEdgePattern(aterm.ATermAppl s, aterm.ATermAppl p, aterm.ATermAppl o)`
`void` | `addPattern(QueryPattern pattern)`
`void` | `addResultVar(aterm.ATermAppl var)` Add a result variable to the query which makes this variable distinguished and appear in the results.
`void` | `addTypePattern(aterm.ATermAppl ind, aterm.ATermAppl c)`
`Query` | `apply(QueryResultBinding binding)` Replace the variables in the query with the values specified in the binding and return a new query instance.
`java.util.List` | `findPatterns(aterm.ATermAppl subj, aterm.ATermAppl pred, aterm.ATermAppl obj)` Find edges in the query graph that matches the pattern (where null matches anything)
`aterm.ATermList` | `getClasses(aterm.ATermAppl objTerm)`
`java.util.Set` | `getConstants()` Return all the (individual) constants used in this query.
`Datatype` | `getDatatype(aterm.ATermAppl term)`
`java.util.Set` | `getDistLitVars()` Return the distinguished literal variables.
`java.util.Set` | `getDistObjVars()` Return the distinguished object variables.
`java.util.Set` | `getDistVars()` Return all the distinguished variables.
`KnowledgeBase` | `getKB()` The KB that will be used to answer this query.
`java.util.Set` | `getLitVars()` Return all the literal variables, i.e.
`java.util.Set` | `getObjVars()` Return all the object variables, i.e.
`java.util.List` | `getQueryPatterns()` Return all the query patterns in this query.
`java.util.List` | `getResultVars()` Return all the variables that will be in the results.
`java.util.Set` | `getVars()` Return all the variables used in this query.
`boolean` | `hasUndefinedPredicate()`
`boolean` | `isGround()` Returns true if there are not variables in the query (only constants).
`void` | `prepare()`
`void` | `removePattern(QueryPattern pattern)`
`Query` | `reorder(int[] ordering)` Reorder the patterns in the query with respect to given ordering.
`aterm.ATermAppl` | `rollUpTo(aterm.ATermAppl term)`
`void` | `setKB(KnowledgeBase kb)`
`java.lang.String` | `toString(boolean multiLine)`

Method Detail

### addResultVar

    void addResultVar(aterm.ATermAppl var)

  Add a result variable to the query which makes this variable distinguished and appear in the results.

  Parameters:
    `var` - Variable

### addDistVar

    void addDistVar(aterm.ATermAppl var)

  Add a distinguished variable to the query but not change the result variables.

  Parameters:
    `var` - Variable

### getVars

    java.util.Set getVars()

  Return all the variables used in this query.

  Returns:
    Set of variables

### getObjVars

    java.util.Set getObjVars()

  Return all the object variables, i.e. variables that will be replaced with individual names.

  Returns:
    Set of variables

### getLitVars

    java.util.Set getLitVars()

  Return all the literal variables, i.e. variables that will be replaced with data values.

  Returns:
    Set of variables

### getConstants

    java.util.Set getConstants()

  Return all the (individual) constants used in this query.

  Returns:

### getResultVars

    java.util.List getResultVars()

  Return all the variables that will be in the results. For SPARQL, these are the variables in the SELECT clause.

  Returns:
    Set of variables

### getDistVars

    java.util.Set getDistVars()

  Return all the distinguished variables. These are variables that will be bound to individuals (or data values) existing in the KB.

  Returns:
    Set of variables

### getDistObjVars

    java.util.Set getDistObjVars()

  Return the distinguished object variables.

  Returns:
    Set of variables

### getDistLitVars

    java.util.Set getDistLitVars()

  Return the distinguished literal variables.

  Returns:
    Set of variables

### isGround

    boolean isGround()

  Returns true if there are not variables in the query (only constants).

  Returns:

### getQueryPatterns

    java.util.List getQueryPatterns()

  Return all the query patterns in this query.

  Returns:
    List of `QueryPattern`s

### findPatterns

    java.util.List findPatterns(aterm.ATermAppl subj,
                                aterm.ATermAppl pred,
                                aterm.ATermAppl obj)

  Find edges in the query graph that matches the pattern (where null matches anything)

  Parameters:
    `subj` -
    `pred` -
    `obj` -
  Returns:

### addPattern

    void addPattern(QueryPattern pattern)

### addTypePattern

    void addTypePattern(aterm.ATermAppl ind,
                        aterm.ATermAppl c)

### addEdgePattern

    void addEdgePattern(aterm.ATermAppl s,
                        aterm.ATermAppl p,
                        aterm.ATermAppl o)

### addConstraint

    void addConstraint(aterm.ATermAppl lit,
                       Datatype dt)

### removePattern

    void removePattern(QueryPattern pattern)

### rollUpTo

    aterm.ATermAppl rollUpTo(aterm.ATermAppl term)

### getClasses

    aterm.ATermList getClasses(aterm.ATermAppl objTerm)

### getDatatype

    Datatype getDatatype(aterm.ATermAppl term)

### apply

    Query apply(QueryResultBinding binding)

  Replace the variables in the query with the values specified in the binding and return a new query instance.

  Parameters:
    `binding` -
  Returns:

### getKB

    KnowledgeBase getKB()

  The KB that will be used to answer this query.

  Returns:

### setKB

    void setKB(KnowledgeBase kb)

### reorder

    Query reorder(int[] ordering)

  Reorder the patterns in the query with respect to given ordering. In the new query, the pattern at position `i` will be the pattern `ordering[i]` from the previous query.

  Parameters:
    `ordering` -
  Returns:

### hasUndefinedPredicate

    boolean hasUndefinedPredicate()

### prepare

    void prepare()

### toString

    java.lang.String toString(boolean multiLine)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Evren Sirin. All Rights Reserved.