vs.knowledge
Class PrologKB

java.lang.Object
  extended by vs.knowledge.PrologKB

public class PrologKB
extends java.lang.Object

Contains all methods that have to call Prolog for their functionality. Do _NOT_ use any call to Prolog anywhere else than here. The idea is that this class provides _the_ interface to Prolog.

Author:
swartjes

Field Summary
static java.lang.String causalityClass
           
static java.lang.String createValidatedAction
           
static java.lang.String createValidatedEvent
           
static java.lang.String fabulaCause
           
static java.lang.String fabulaNode
           
static java.lang.String getFabulaCharacter
           
static java.lang.String getFabulaContents
           
static java.lang.String getFabulaContentTruth
           
static java.lang.String getSuggestion
           
static java.lang.String getSuggestionBody
           
static java.lang.String getSuggestionCausers
           
static java.lang.String getSuggestionIndividual
           
static java.lang.String getSuggestionName
           
static java.lang.String getSuggestionType
           
static java.lang.String length
           
static java.lang.String member
           
static java.lang.String nodeClass
           
 
Method Summary
 java.lang.String adaptPlan(java.lang.String character, java.lang.String intentions, java.lang.String oldPlan)
          Adapts an existing partial-order plan
static java.lang.String addQuotes(java.lang.String input)
           
 boolean adoptGoal(java.lang.String goal)
          Tell Prolog to adopt a goal.
 boolean adoptJustifiableGoal(java.lang.String goal)
          Tell Prolog to adopt a justifiable goal.
 boolean applyOperatorEffects(java.lang.String schema)
          Applies operator effects
 boolean ask(java.lang.String query)
           
 boolean call(java.lang.String prologCommand, java.lang.String input)
           
 java.util.Vector<java.lang.String> canDo(java.lang.String character, java.lang.String operator)
          Determine which actions given character can pursue
 boolean checkSchemaFacts(java.lang.String schema)
          Checks whether given schema's preconditions hold, and ignores fabula
 java.util.Vector<RDFtriple> conditionToTripleList(java.lang.String condition)
           
 boolean consult(java.lang.String filename)
          consult expects foreward slashes (/) in file names
 boolean dropGoal(java.lang.String goal)
          Tell Prolog to drop a goal.
 java.util.Vector<java.lang.String> executableEvents(java.lang.String plan)
          Returns the events in the plan that are executable, i.e. do not depend on the execution of other steps (in terms of causal links)
 java.util.Vector<java.lang.String> executableFramingOperators(java.lang.String plan)
          Returns the improvisations in the plan that are executable, i.e. do not depend on the execution of other steps (in terms of causal links)
 java.util.Vector<java.lang.String> executableInferenceOperators(java.lang.String plan)
          Returns the inferences in the plan that are executable, i.e. do not depend on the execution of other steps (in terms of causal links)
 java.util.Vector<java.lang.String> executableOperators(java.lang.String plan)
          Returns the operators in the plan that are executable, i.e. do not depend on the execution of other steps (in terms of causal links)
 boolean finishedPlan(java.lang.String plan)
          Determines whether given plan is "finished", i.e., there are no more steps that can be executed
 java.lang.String first(java.lang.String tuple)
          Get first element of tuple
static java.lang.String fromNrSign(java.lang.String input)
          Substring from '#'
 java.util.Vector<java.lang.String> getAllResults(jpl.Query q, jpl.Variable v)
          Given a query and a variable occurring in this query, get all resulting binding from the answers
 java.util.Set<java.lang.String> getEnablingFabulaElements(GoalSchema gs)
          This method returns a number of Strings that represent the URIs of Individuals of fabula elements, that enable the given schema.
 java.util.Set<java.lang.String> getEnablingFabulaElements(Operator op)
           
 java.lang.String getGoalPossibleAfterPlan(java.lang.String character, java.lang.String goal)
           
 java.util.Map<java.lang.String,java.lang.String> getGoalsPossibleAfterPlan(java.lang.String character)
           
 float getGoalUrgency(java.lang.String schema)
           
static PrologKB getInstance()
           
 java.util.Set<java.lang.String> getMotivatingFabulaElements(GoalSchema gs)
          This method returns a number of Strings that represent the URIs of Individuals of fabula elements, that motivate the given schema.
 java.lang.String getOneResult(jpl.Query q, jpl.Variable v)
          Given a query and a variable occurring in this query, get one resulting binding from the answers
 int getOperatorDuration(java.lang.String operator)
           
 java.util.Vector<RDFtriple> getOperatorEffects(java.lang.String schema)
          Retrieve effects of operator schema assumption is that effects can be applied
 java.util.Vector<PlanLink> getPlanLinks(java.lang.String plan)
          Returns a collection of the plan links of given plan
 java.util.Vector<PlanOrdering> getPlanOrderings(java.lang.String plan)
          Returns a collection of the plan orderings of given plan
 java.util.Vector<PlanStep> getPlanSteps(java.lang.String plan)
           
 java.util.Vector<java.lang.String> getPossibleGoals(java.lang.String character)
          Returns a vector containing all goals that are possible to pursue for given character.
 java.lang.String getPrologSingleVariable(java.lang.String prologCommand, java.lang.String input)
          Deprecated. - use getOneResult() in future
 java.util.Vector<java.lang.String> getPrologSingleVariableList(java.lang.String prologCommand)
          Deprecated. 
 java.util.Vector<java.lang.String> getPrologSingleVariableList(java.lang.String prologCommand, java.lang.String input)
          Deprecated. - use getAllResults() in future
 java.lang.String getQNPF(java.lang.String command, java.lang.String action)
           
 java.lang.String getSchemaAgens(java.lang.String schema)
          Returns the URI of the agens of given schema (if it has any)
 java.lang.String getSchemaClass(java.lang.String schema)
          Returns the class of given schema (e.g. action, goal, event, etc) TODO: make in prolog using =..
 java.lang.String getSchemaInstrument(java.lang.String schema)
          Returns the URI of the instrument of given schema (if it has any)
 java.lang.String getSchemaOpponent(java.lang.String schema)
          Returns the URI of the opponent of given schema (if it has any)
 java.lang.String getSchemaPatiens(java.lang.String schema)
          Returns the URI of the patiens of given schema (if it has any)
 java.lang.String getSchemaPreconditions(java.lang.String schema)
          Retrieves preconditions of given schema
 java.lang.String getSchemaTarget(java.lang.String schema)
          Returns the URI of the target of given schema (if it has any)
 java.lang.String getSchemaType(java.lang.String schema)
          Returns the type of given schema (its corresponding URI in the ontology)
 java.lang.String getUntruePreconditionsOfSchema(java.lang.String schema)
           
 boolean goalFailureConditionsTrue(java.lang.String schema)
          Checks whether given goal's failure conditions are true
 java.lang.String goalIntention(java.lang.String goalSchema)
           
 java.util.Vector<java.lang.String> hasAction(java.lang.String character)
          Determine which actions given character can pursue
 boolean invalidPlan(java.lang.String plan)
          Determines whether plan is still valid in given context, i.e., replanning is not needed.
 boolean isAdoptedGoal(java.lang.String goal)
           
 boolean isAdoptedJustifiableGoal(java.lang.String goal)
           
 boolean isFramingScopeAll(java.lang.String schema)
           
 boolean isFramingScopeHidden(java.lang.String schema)
           
 boolean isFramingScopePersonal(java.lang.String schema)
           
 boolean isSuggestedGoal(java.lang.String goal)
           
static java.lang.String listToProlog(java.util.List<RDFtriple> l)
           
 boolean loadKB(java.lang.String file)
          Load RDF/OWL knowledge
 java.lang.String narrate(java.lang.String prologString)
          Make a narration of given prolog string
 java.util.Vector<java.lang.String> necessaryCharacters(java.lang.String thread)
          Retrieves characters necessary as a result of plot thread executions (asserted in Prolog)
 java.lang.String plan(java.lang.String character, java.lang.String intentions)
          Builds and retrieves a partial-order plan
 java.util.Vector<java.lang.String> possibleThreads()
          Retrieve plot threads that are now possible
 java.util.Hashtable[] prologCall(java.lang.String prologString)
           
 java.util.Hashtable[] prologCall(java.lang.String prologCommand, java.lang.String input, java.util.Vector<java.lang.String> vars)
           
 java.util.Hashtable prologCallOneSolution(java.lang.String prologString)
           
 java.util.List<RDFtriple> prologToList(java.lang.String prologTripleList, boolean truth)
           
 RDFtriple prologToTriple(java.lang.String prologTriple, boolean truth)
          Builds an RDFtriple object from prolog string representation of an rdf triple TODO: replace getSubject...etc by JPL parsing
 jpl.Query query(java.lang.String triple)
          RDF query method
static java.lang.String removeQuotes(java.lang.String input)
          Remove the single quotes from a Prolog value
 boolean saveKB(java.lang.String file)
          Save knowledge base.
 java.lang.String second(java.lang.String tuple)
          Get second element of tuple
 java.util.Vector<java.lang.String> selectReactiveActions(java.lang.String character)
          Returns a collection of settings based on executed plot threads (asserted in Prolog)
 boolean setAgentID(java.lang.String agentID)
          Set the character ID for this agent (e.g. ps:leChuck)
 boolean suggestGoal(java.lang.String goal)
           
 boolean tellRDF(java.lang.String term)
           
 boolean tellRDFtriple(RDFtriple t)
           
 java.util.Vector<java.lang.String> threadGoals(java.lang.String episode, java.lang.String characterURI)
          Returns a collection of plot thread goals for given character
 java.util.Vector<java.lang.String> threadResolveGoals(java.lang.String episode, java.lang.String characterURI)
          Returns a collection of plot thread resolve goals for given character
 java.util.Vector<java.lang.String> threadSettings(java.lang.String thread)
          Returns a collection of settings based on executed plot threads (asserted in Prolog)
static java.lang.String tripleToProlog(RDFtriple t)
          Turns an RDF triple Java object back into a Prolog fact
 boolean unifies(java.lang.String lhs, java.lang.String rhs)
          Returns true iff left hand side unifies with right hand side
 boolean untellRDF(java.lang.String term)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

member

public static final java.lang.String member
See Also:
Constant Field Values

length

public static final java.lang.String length
See Also:
Constant Field Values

getSuggestion

public static final java.lang.String getSuggestion
See Also:
Constant Field Values

getSuggestionName

public static final java.lang.String getSuggestionName
See Also:
Constant Field Values

getSuggestionIndividual

public static final java.lang.String getSuggestionIndividual
See Also:
Constant Field Values

getSuggestionType

public static final java.lang.String getSuggestionType
See Also:
Constant Field Values

getSuggestionCausers

public static final java.lang.String getSuggestionCausers
See Also:
Constant Field Values

getSuggestionBody

public static final java.lang.String getSuggestionBody
See Also:
Constant Field Values

nodeClass

public static final java.lang.String nodeClass
See Also:
Constant Field Values

causalityClass

public static final java.lang.String causalityClass
See Also:
Constant Field Values

fabulaNode

public static final java.lang.String fabulaNode
See Also:
Constant Field Values

fabulaCause

public static final java.lang.String fabulaCause
See Also:
Constant Field Values

getFabulaCharacter

public static final java.lang.String getFabulaCharacter
See Also:
Constant Field Values

getFabulaContents

public static final java.lang.String getFabulaContents
See Also:
Constant Field Values

getFabulaContentTruth

public static final java.lang.String getFabulaContentTruth
See Also:
Constant Field Values

createValidatedEvent

public static final java.lang.String createValidatedEvent
See Also:
Constant Field Values

createValidatedAction

public static final java.lang.String createValidatedAction
See Also:
Constant Field Values
Method Detail

addQuotes

public static java.lang.String addQuotes(java.lang.String input)

fromNrSign

public static java.lang.String fromNrSign(java.lang.String input)
Substring from '#'

Parameters:
input - a String containing a '#'
Returns:
the string after the first '#'

getInstance

public static PrologKB getInstance()

listToProlog

public static java.lang.String listToProlog(java.util.List<RDFtriple> l)

removeQuotes

public static java.lang.String removeQuotes(java.lang.String input)
Remove the single quotes from a Prolog value

Parameters:
input - the string with potential quotes
Returns:
a string with quotes removed

tripleToProlog

public static java.lang.String tripleToProlog(RDFtriple t)
Turns an RDF triple Java object back into a Prolog fact

Parameters:
t - the RDF triple in Java
Returns:
a Prolog string representing the triple

adoptGoal

public boolean adoptGoal(java.lang.String goal)
Tell Prolog to adopt a goal. This makes it no longer eligible for goal selection

Parameters:
goal - the Prolog string representing the goal to adopt

dropGoal

public boolean dropGoal(java.lang.String goal)
Tell Prolog to drop a goal.

Parameters:
goal - the Prolog string representing the goal to drop

isAdoptedGoal

public boolean isAdoptedGoal(java.lang.String goal)

isAdoptedJustifiableGoal

public boolean isAdoptedJustifiableGoal(java.lang.String goal)

suggestGoal

public boolean suggestGoal(java.lang.String goal)

isSuggestedGoal

public boolean isSuggestedGoal(java.lang.String goal)

adoptJustifiableGoal

public boolean adoptJustifiableGoal(java.lang.String goal)
Tell Prolog to adopt a justifiable goal. This makes it no longer eligible for goal selection

Parameters:
goal - the Prolog string representing the goal to justify

applyOperatorEffects

public boolean applyOperatorEffects(java.lang.String schema)
Applies operator effects

Parameters:
schema - the operator schema to apply the effects of
Returns:
wether successful

ask

public boolean ask(java.lang.String query)

call

public boolean call(java.lang.String prologCommand,
                    java.lang.String input)

canDo

public java.util.Vector<java.lang.String> canDo(java.lang.String character,
                                                java.lang.String operator)
Determine which actions given character can pursue

Parameters:
character - the URI of the character
Returns:
a vector of actions

checkSchemaFacts

public boolean checkSchemaFacts(java.lang.String schema)
Checks whether given schema's preconditions hold, and ignores fabula

Parameters:
schema - the schema to validate, as prolog string
Returns:
whether the schemas preconditions (that are not fabula preconditions) are true

conditionToTripleList

public java.util.Vector<RDFtriple> conditionToTripleList(java.lang.String condition)

consult

public boolean consult(java.lang.String filename)
consult expects foreward slashes (/) in file names


executableEvents

public java.util.Vector<java.lang.String> executableEvents(java.lang.String plan)
Returns the events in the plan that are executable, i.e. do not depend on the execution of other steps (in terms of causal links)

Parameters:
plan - a prolog string representation of a plan
Returns:
a collection of prolog strings representing the schemas of steps in the plan

executableFramingOperators

public java.util.Vector<java.lang.String> executableFramingOperators(java.lang.String plan)
Returns the improvisations in the plan that are executable, i.e. do not depend on the execution of other steps (in terms of causal links)

Parameters:
plan - a prolog string representation of a plan
Returns:
a collection of prolog strings representing the schemas of steps in the plan

executableInferenceOperators

public java.util.Vector<java.lang.String> executableInferenceOperators(java.lang.String plan)
Returns the inferences in the plan that are executable, i.e. do not depend on the execution of other steps (in terms of causal links)

Parameters:
plan - a prolog string representation of a plan
Returns:
a collection of prolog strings representing the schemas of steps in the plan

executableOperators

public java.util.Vector<java.lang.String> executableOperators(java.lang.String plan)
Returns the operators in the plan that are executable, i.e. do not depend on the execution of other steps (in terms of causal links)

Parameters:
plan - a prolog string representation of a plan
Returns:
a collection of prolog strings representing the schemas of steps in the plan

finishedPlan

public boolean finishedPlan(java.lang.String plan)
Determines whether given plan is "finished", i.e., there are no more steps that can be executed

Parameters:
plan - Prolog string representing the plan
Returns:
whether plan is finished

invalidPlan

public boolean invalidPlan(java.lang.String plan)
Determines whether plan is still valid in given context, i.e., replanning is not needed. This is a speedup for the planner.

Parameters:
plan - a Prolog string representing the plan
Returns:
whether the plan is "invalid"

first

public java.lang.String first(java.lang.String tuple)
Get first element of tuple

Parameters:
tuple - a string representing the tuple
Returns:
first element of the tuple

getAllResults

public java.util.Vector<java.lang.String> getAllResults(jpl.Query q,
                                                        jpl.Variable v)
Given a query and a variable occurring in this query, get all resulting binding from the answers


getEnablingFabulaElements

public java.util.Set<java.lang.String> getEnablingFabulaElements(GoalSchema gs)
This method returns a number of Strings that represent the URIs of Individuals of fabula elements, that enable the given schema. For instance, if #belief_23 and #belief_25 make the preconditions of #goal_22 true, this method returns <#belief_23, #belief_25>.

Parameters:
gs - the goal schema under investigation
Returns:
a set of individuals

getEnablingFabulaElements

public java.util.Set<java.lang.String> getEnablingFabulaElements(Operator op)

getGoalPossibleAfterPlan

public java.lang.String getGoalPossibleAfterPlan(java.lang.String character,
                                                 java.lang.String goal)

getGoalsPossibleAfterPlan

public java.util.Map<java.lang.String,java.lang.String> getGoalsPossibleAfterPlan(java.lang.String character)

getGoalUrgency

public float getGoalUrgency(java.lang.String schema)

getMotivatingFabulaElements

public java.util.Set<java.lang.String> getMotivatingFabulaElements(GoalSchema gs)
This method returns a number of Strings that represent the URIs of Individuals of fabula elements, that motivate the given schema. For instance, if #goal_23 and #goal_25 make the preconditions of #goal_22 true, this method returns <#goal_23, #goal_25>.

Parameters:
gs - the Goal schema under investigation
Returns:
the set of Individuals as described

getOneResult

public java.lang.String getOneResult(jpl.Query q,
                                     jpl.Variable v)
Given a query and a variable occurring in this query, get one resulting binding from the answers


getOperatorEffects

public java.util.Vector<RDFtriple> getOperatorEffects(java.lang.String schema)
Retrieve effects of operator schema assumption is that effects can be applied

Parameters:
schema - the schema to retrieve the effects of, in prolog string
Returns:
a vector of the retrieved triples, or null if applying failed

getPlanLinks

public java.util.Vector<PlanLink> getPlanLinks(java.lang.String plan)
Returns a collection of the plan links of given plan

Parameters:
plan - a prolog string representation of a plan
Returns:
a collection of plan links

getPlanOrderings

public java.util.Vector<PlanOrdering> getPlanOrderings(java.lang.String plan)
Returns a collection of the plan orderings of given plan

Parameters:
plan - a prolog string representation of a plan
Returns:
a collection of plan orderings

getPlanSteps

public java.util.Vector<PlanStep> getPlanSteps(java.lang.String plan)

getPossibleGoals

public java.util.Vector<java.lang.String> getPossibleGoals(java.lang.String character)
Returns a vector containing all goals that are possible to pursue for given character. In BDI terms, these are the "desires" of the agent. Prolog is responsible for establishing this set of desires; Java is responsible for selecting what to pursue. No choices are made yet as to a consistent set of goals that the agent is actually pursuing (in BDI terms, the "goals" of the agent).

Parameters:
character - the URI of the character agent for which to retrieve possible goals
Returns:
a list of possible goals

selectReactiveActions

public java.util.Vector<java.lang.String> selectReactiveActions(java.lang.String character)
Returns a collection of settings based on executed plot threads (asserted in Prolog)

Returns:
a collection of (thread) settings as Prolog strings

getPrologSingleVariable

public java.lang.String getPrologSingleVariable(java.lang.String prologCommand,
                                                java.lang.String input)
Deprecated. - use getOneResult() in future

Builds the following structure prologCommand ( input , GPLVar )


getPrologSingleVariableList

@Deprecated
public java.util.Vector<java.lang.String> getPrologSingleVariableList(java.lang.String prologCommand)
Deprecated. 


getPrologSingleVariableList

public java.util.Vector<java.lang.String> getPrologSingleVariableList(java.lang.String prologCommand,
                                                                      java.lang.String input)
Deprecated. - use getAllResults() in future


getQNPF

public java.lang.String getQNPF(java.lang.String command,
                                java.lang.String action)

getSchemaAgens

public java.lang.String getSchemaAgens(java.lang.String schema)
Returns the URI of the agens of given schema (if it has any)

Parameters:
schema - the schema as prolog string
Returns:
the agens of the schema

getSchemaClass

public java.lang.String getSchemaClass(java.lang.String schema)
Returns the class of given schema (e.g. action, goal, event, etc) TODO: make in prolog using =..

Parameters:
schema - the schema as Prolog string
Returns:
the class of the schema

getSchemaInstrument

public java.lang.String getSchemaInstrument(java.lang.String schema)
Returns the URI of the instrument of given schema (if it has any)

Parameters:
schema - the schema as prolog string
Returns:
the instrument of the schema

getSchemaOpponent

public java.lang.String getSchemaOpponent(java.lang.String schema)
Returns the URI of the opponent of given schema (if it has any)

Parameters:
schema - the schema as prolog string
Returns:
the instrument of the schema

getOperatorDuration

public int getOperatorDuration(java.lang.String operator)

getSchemaPatiens

public java.lang.String getSchemaPatiens(java.lang.String schema)
Returns the URI of the patiens of given schema (if it has any)

Parameters:
schema - the schema as prolog string
Returns:
the patiens of the schema

getSchemaPreconditions

public java.lang.String getSchemaPreconditions(java.lang.String schema)
Retrieves preconditions of given schema

Parameters:
schema - the schema to retrieve the preconditions of
Returns:
Prolog string representing the preconditions

getSchemaTarget

public java.lang.String getSchemaTarget(java.lang.String schema)
Returns the URI of the target of given schema (if it has any)

Parameters:
schema - the schema as prolog string
Returns:
the target of the schema

getSchemaType

public java.lang.String getSchemaType(java.lang.String schema)
Returns the type of given schema (its corresponding URI in the ontology)

Parameters:
schema - the schema as Prolog string
Returns:
the type of the schema

isFramingScopeAll

public boolean isFramingScopeAll(java.lang.String schema)

isFramingScopePersonal

public boolean isFramingScopePersonal(java.lang.String schema)

isFramingScopeHidden

public boolean isFramingScopeHidden(java.lang.String schema)

getUntruePreconditionsOfSchema

public java.lang.String getUntruePreconditionsOfSchema(java.lang.String schema)

goalFailureConditionsTrue

public boolean goalFailureConditionsTrue(java.lang.String schema)
Checks whether given goal's failure conditions are true

Parameters:
schema - the goal schema
Returns:
whether failure conditions of goal schema are true

goalIntention

public java.lang.String goalIntention(java.lang.String goalSchema)

hasAction

public java.util.Vector<java.lang.String> hasAction(java.lang.String character)
Determine which actions given character can pursue

Parameters:
character - the URI of the character
Returns:
a vector of actions

loadKB

public boolean loadKB(java.lang.String file)
Load RDF/OWL knowledge

Parameters:
file - filename of the knowledge base
Returns:
whether loading succeeded

narrate

public java.lang.String narrate(java.lang.String prologString)
Make a narration of given prolog string

Parameters:
prologString - prolog string representing a narratable structure.
Returns:
narration of this prolog string in "natural language"

necessaryCharacters

public java.util.Vector<java.lang.String> necessaryCharacters(java.lang.String thread)
Retrieves characters necessary as a result of plot thread executions (asserted in Prolog)

Returns:
a vector containing URIs of characters that are necessary

plan

public java.lang.String plan(java.lang.String character,
                             java.lang.String intentions)
Builds and retrieves a partial-order plan

Parameters:
intentions - the intentions as prolog list
Returns:
a plan as prolog String, or null if there was no solution.

adaptPlan

public java.lang.String adaptPlan(java.lang.String character,
                                  java.lang.String intentions,
                                  java.lang.String oldPlan)
Adapts an existing partial-order plan

Parameters:
intentions - the intentions as prolog list
Returns:
a plan as prolog String, or null if there was no solution.

possibleThreads

public java.util.Vector<java.lang.String> possibleThreads()
Retrieve plot threads that are now possible

Returns:
vector containing string representations of possible plot threads

prologCall

public java.util.Hashtable[] prologCall(java.lang.String prologString)

prologCall

public java.util.Hashtable[] prologCall(java.lang.String prologCommand,
                                        java.lang.String input,
                                        java.util.Vector<java.lang.String> vars)

prologCallOneSolution

public java.util.Hashtable prologCallOneSolution(java.lang.String prologString)

prologToList

public java.util.List<RDFtriple> prologToList(java.lang.String prologTripleList,
                                              boolean truth)

prologToTriple

public RDFtriple prologToTriple(java.lang.String prologTriple,
                                boolean truth)
Builds an RDFtriple object from prolog string representation of an rdf triple TODO: replace getSubject...etc by JPL parsing

Parameters:
prologTriple - the string representation of the triple
truth - whether the triple should be interpreted as true or false
Returns:
an RDFtriple object if successful, or null if unsuccessful

query

public jpl.Query query(java.lang.String triple)
RDF query method

Parameters:
triple - the RDF triple we want to query Prolog about.
Returns:
a Query object

saveKB

public boolean saveKB(java.lang.String file)
Save knowledge base. Not implemented yet.

Parameters:
file - file name to save KB to
Returns:
whether saving succeeded

second

public java.lang.String second(java.lang.String tuple)
Get second element of tuple

Parameters:
tuple - a string representing the tuple
Returns:
second element of the tuple

setAgentID

public boolean setAgentID(java.lang.String agentID)
Set the character ID for this agent (e.g. ps:leChuck)


tellRDF

public boolean tellRDF(java.lang.String term)

tellRDFtriple

public boolean tellRDFtriple(RDFtriple t)

threadGoals

public java.util.Vector<java.lang.String> threadGoals(java.lang.String episode,
                                                      java.lang.String characterURI)
Returns a collection of plot thread goals for given character

Parameters:
characterURI - the URI of the character to retrieve plot thread goals for
Returns:
a collection of goals that the character should adopt

threadResolveGoals

public java.util.Vector<java.lang.String> threadResolveGoals(java.lang.String episode,
                                                             java.lang.String characterURI)
Returns a collection of plot thread resolve goals for given character

Parameters:
characterURI - the URI of the character to retrieve plot thread goals for
Returns:
a collection of goals that the character should adopt

threadSettings

public java.util.Vector<java.lang.String> threadSettings(java.lang.String thread)
Returns a collection of settings based on executed plot threads (asserted in Prolog)

Returns:
a collection of (thread) settings as Prolog strings

unifies

public boolean unifies(java.lang.String lhs,
                       java.lang.String rhs)
Returns true iff left hand side unifies with right hand side

Parameters:
lhs - left hand side of the unification
rhs - right hand side of the unification
Returns:
whether unification succeeds

untellRDF

public boolean untellRDF(java.lang.String term)