org.semwebcentral.sweetrules.infrastructure
Class AbstractSweetQueryResult

java.lang.Object
  extended byorg.semwebcentral.sweetrules.infrastructure.AbstractSweetQueryResult
All Implemented Interfaces:
ISweetQueryResult
Direct Known Subclasses:
SweetQueryResult

public abstract class AbstractSweetQueryResult
extends java.lang.Object
implements ISweetQueryResult

Abstract class for the ISweetQueryResult interface

Author:
Shashidhara K Ganjugunte, Dr. Benjamin Grosof, Dr. Said Tabet, Chitravanu Neogy

Field Summary
protected  java.lang.String[] allAnswers
          The set of TRUE entailed answers i.e. binding lists
protected  java.lang.String[] allAtoms
          The string array representing all the TRUE entailed conclusions
protected  Logger logger
          The logger object
protected  java.lang.String[] trueOrUndefinedAnswers
          This represents both true/undefined bindings
protected  java.lang.String[] trueOrUndefinedAtoms
          This represents both true/undefined the conclusions
protected  java.lang.String[] undefinedAnswers
          The undefined answers
 
Constructor Summary
AbstractSweetQueryResult(java.lang.String[] allAnswers, java.lang.String[] allAtoms, java.lang.String[] trueOrUndefinedAnswers, java.lang.String[] trueOrUndefinedAtoms, java.lang.String[] undefinedAnswerList)
          Constructor for the query result
 
Method Summary
 boolean equals(java.lang.Object obj)
          Method to compare to query results
 java.lang.String[] getAllAnswers()
          Returns the answer set representing the variables and their corresponding bindings for the "true" i.e. entailed conclusions
 java.lang.String[] getAllAtomsOrCslits()
          This is a getter method which returns the entailed(true) atoms/Cslits (as strings)
 java.lang.String[] getTrueOrUndefinedAnswers()
          Returns all the bindings both for true or undefined answers
 java.lang.String[] getTrueOrUndefinedAtomsOrCslits()
          Returns all atoms/cslits (as strings), which are either true or undefined
 java.lang.String[] getUndefinedAnswers()
          Returns all the undefined answers
 void print()
          Implementation of print
private  void printStringArray(java.lang.String[] stringArray)
          Prints a string array
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allAtoms

protected java.lang.String[] allAtoms
The string array representing all the TRUE entailed conclusions


allAnswers

protected java.lang.String[] allAnswers
The set of TRUE entailed answers i.e. binding lists


trueOrUndefinedAtoms

protected java.lang.String[] trueOrUndefinedAtoms
This represents both true/undefined the conclusions


trueOrUndefinedAnswers

protected java.lang.String[] trueOrUndefinedAnswers
This represents both true/undefined bindings


undefinedAnswers

protected java.lang.String[] undefinedAnswers
The undefined answers


logger

protected Logger logger
The logger object

Constructor Detail

AbstractSweetQueryResult

public AbstractSweetQueryResult(java.lang.String[] allAnswers,
                                java.lang.String[] allAtoms,
                                java.lang.String[] trueOrUndefinedAnswers,
                                java.lang.String[] trueOrUndefinedAtoms,
                                java.lang.String[] undefinedAnswerList)
Constructor for the query result

Parameters:
allAnswers - Entailed var/value bindings. This will be a single element with answerSet XML in case of ruleML. For XSB it will be a String array of the form ["Var1/value11, ..., VarN/value1N", "Var1/value21, ..., Var2N"] where "Vari" is a variable and "valuei" is its value.
allAtoms - Entailed conclusions
trueOrUndefinedAnswers - All conclusions (including undefined)
trueOrUndefinedAtoms - All Bindings (including undefined). The format is similar to entailedBindingList
undefinedAnswerList - The answer list for which conclusions are undefined
Method Detail

getAllAtomsOrCslits

public java.lang.String[] getAllAtomsOrCslits()
Description copied from interface: ISweetQueryResult
This is a getter method which returns the entailed(true) atoms/Cslits (as strings)

Specified by:
getAllAtomsOrCslits in interface ISweetQueryResult
Returns:
The entailed atoms/cslits

getAllAnswers

public java.lang.String[] getAllAnswers()
Description copied from interface: ISweetQueryResult
Returns the answer set representing the variables and their corresponding bindings for the "true" i.e. entailed conclusions

Specified by:
getAllAnswers in interface ISweetQueryResult
Returns:
The answer set in terms of bindings. Each property element is a binding list in the form of name-value pair. This will be a single element with answerSet XML in case of ruleML. For XSB it will be a String array of the form ["Var1/value11, ..., VarN/value1N", "Var1/value21, ..., Var2N"] where "Vari" is a variable and "valuei" is its value.

getTrueOrUndefinedAtomsOrCslits

public java.lang.String[] getTrueOrUndefinedAtomsOrCslits()
Description copied from interface: ISweetQueryResult
Returns all atoms/cslits (as strings), which are either true or undefined

Specified by:
getTrueOrUndefinedAtomsOrCslits in interface ISweetQueryResult
Returns:
All the entailed atoms/cslits (including undefined ones) (undefined is particularly relevant to XSB)

getTrueOrUndefinedAnswers

public java.lang.String[] getTrueOrUndefinedAnswers()
Description copied from interface: ISweetQueryResult
Returns all the bindings both for true or undefined answers

Specified by:
getTrueOrUndefinedAnswers in interface ISweetQueryResult
Returns:
All the bindings both for true or undefined answers (undefined is particularly relevant to XSB)

print

public void print()
Implementation of print

Specified by:
print in interface ISweetQueryResult

printStringArray

private void printStringArray(java.lang.String[] stringArray)
Prints a string array

Parameters:
stringArray - The string array to print

getUndefinedAnswers

public java.lang.String[] getUndefinedAnswers()
Returns all the undefined answers

Specified by:
getUndefinedAnswers in interface ISweetQueryResult
Returns:
The set of undefined answers

equals

public boolean equals(java.lang.Object obj)
Method to compare to query results

Returns:
true if the objects are equal