All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ShoeKb.Query

java.lang.Object
   |
   +----ShoeKb.Sentence
           |
           +----ShoeKb.Query

public class Query
extends Sentence
A query that can be issued to a knowledge base. A query can consist of one or more atoms conjuncted together, where an atom is a predicate with one or more arguments. An argument may be a literal or a variable, where varaibles are indicated by preceding them with a question mark.


Variable Index

 o ALL_ANSWERS
Constant for specifying that all answers should be returned.

Constructor Index

 o Query()
Construct a new Query without initializing it.
 o Query(String, String, String)
Constructs a new Query which consists of a single predicate with two arguments.
 o Query(String, String[])
Construct a new Query which consists of a single predicate with any number of arguments.

Method Index

 o getNumAnswersRequested()
Returns the maximum number of answers that should be returned by the query.
 o setNumAnswersRequested(int)
Sets the maximum number of answers that should be returned by the query.

Variables

 o ALL_ANSWERS
 public static final int ALL_ANSWERS
Constant for specifying that all answers should be returned.

Constructors

 o Query
 public Query()
Construct a new Query without initializing it.

 o Query
 public Query(String predicate,
              String args[])
Construct a new Query which consists of a single predicate with any number of arguments.

 o Query
 public Query(String predicate,
              String arg1,
              String arg2)
Constructs a new Query which consists of a single predicate with two arguments.

Methods

 o getNumAnswersRequested
 public int getNumAnswersRequested()
Returns the maximum number of answers that should be returned by the query.

 o setNumAnswersRequested
 public void setNumAnswersRequested(int numAnswersRequested)
Sets the maximum number of answers that should be returned by the query. Some KBs may choose to ignore this value.


All Packages  Class Hierarchy  This Package  Previous  Next  Index