Package org.projog.api
Provides a programming interface for Java applications to interact with Projog.
As well as interacting with Projog using the console application it is also possible to embed Projog in your Java applications. The steps required for applications to interact with Projog are as follows:
- Create a new
Projoginstance. - Load in clauses and facts using
Projog.consultFile(File)orProjog.consultReader(Reader). - Create a
QueryStatementby usingProjog.createStatement(String). - Create a
QueryResultby usingQueryStatement.executeQuery(). - Iterate through all possible solutions to the query by using
QueryResult.next(). - For each solution get the
Terminstantiated to aVariablein the query by callingQueryResult.getTerm(String).
-
Class Summary Class Description Projog Provides an entry point for other Java code to interact with Projog.ProjogStackTraceElement An element in a stack trace, as returned byProjog.getStackTrace(Throwable).QueryPlan Represents a plan for executing a Prolog query.QueryResult Represents an executing query.QueryStatement Represents a query.