org.semwebcentral.sweetrules.ruleml
Class SweetRuleMLCourteousCompiler

java.lang.Object
  extended byorg.semwebcentral.sweetrules.ruleml.SweetRuleMLCourteousCompiler

public final class SweetRuleMLCourteousCompiler
extends java.lang.Object

Created on Nov 15, 2004 A utility class to generate the courteous RuleML from a RuleML

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

Field Summary
private static SweetRuleMLCourteousCompiler courteousRuleMLGenerator
          The singleton object
 
Constructor Summary
private SweetRuleMLCourteousCompiler()
          The courteous RuleML Generator
 
Method Summary
 java.lang.String compile(java.lang.String unCompiledRawRuleML)
          CommonRules 3.3 does not seem to handle sensor statements well.
private  java.lang.String doCompile(java.lang.String unCompiledRuleML)
          Method to do the actual courteous compilation of pre-processed RuleML
static SweetRuleMLCourteousCompiler getInstance()
          The singleton accessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

courteousRuleMLGenerator

private static SweetRuleMLCourteousCompiler courteousRuleMLGenerator
The singleton object

Constructor Detail

SweetRuleMLCourteousCompiler

private SweetRuleMLCourteousCompiler()
The courteous RuleML Generator

Method Detail

getInstance

public static SweetRuleMLCourteousCompiler getInstance()
The singleton accessor

Returns:
The singleton converter

compile

public java.lang.String compile(java.lang.String unCompiledRawRuleML)
                         throws SweetException
CommonRules 3.3 does not seem to handle sensor statements well. This routine strips off the Sensor statements compiles the resulting RuleML via the CommonRules 3.3 compiler adds the sensors back to the compiled RuleML and returns the result

Parameters:
unCompiledRawRuleML - The uncompiled RuleML, can have sensor statements
Returns:
Compile RuleML AND the sensor statements
Throws:
SweetException

doCompile

private java.lang.String doCompile(java.lang.String unCompiledRuleML)
                            throws SweetTranslatorException
Method to do the actual courteous compilation of pre-processed RuleML

Parameters:
unCompiledRuleML - The uncompiled ruleml but without sensor statements
Returns:
The courteous compiled ruleml
Throws:
SweetTranslatorException