org.semwebcentral.sweetrules.ruleml
Class SweetKBMergeManager

java.lang.Object
  extended byorg.semwebcentral.sweetrules.ruleml.SweetKBMergeManager
All Implemented Interfaces:
ISweetKBMergeManager

public class SweetKBMergeManager
extends java.lang.Object
implements ISweetKBMergeManager

Created on Oct 24, 2004 The merge manager implemented as part of SWEET with RuleML as common format

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

Constructor Summary
SweetKBMergeManager()
           
 
Method Summary
 void augmentWithImportClosure(java.util.List ruleMLStore)
          Augments the specified ruleMLStore with it's import closure
 void computeImportClosure(ISweetKBDescriptor source, java.util.Vector importClosureKBs)
          Computes the import closure for a given source
 java.util.Vector getImports(ISweetKBDescriptor source)
          Computes the first level imports of the specified source
 boolean isRuleMLV08(ISweetKBDescriptor kbDesc)
          Checks to see if the given KB is RuleML
 boolean isRuleMLV08(org.semwebcentral.sweetrules.ruleml.sweetrulemlobjectmodel.RbaseincludesType rbaseIncludesDirective)
          Returns true if the kbtype is RuleML and version is 0.8
 java.lang.String mergeKBs(ISweetKBMergeDescriptor mergeDescriptor, ISweetInvocationDescriptor invocationDesc, ISweetInvocationPreferences preferenceDesc)
          This API merges multiple heterogenous KBs by using appropriate translators.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SweetKBMergeManager

public SweetKBMergeManager()
Method Detail

mergeKBs

public java.lang.String mergeKBs(ISweetKBMergeDescriptor mergeDescriptor,
                                 ISweetInvocationDescriptor invocationDesc,
                                 ISweetInvocationPreferences preferenceDesc)
                          throws SweetException
Description copied from interface: ISweetKBMergeManager
This API merges multiple heterogenous KBs by using appropriate translators. It also processes knowledge base INCLUDE directives.

Specified by:
mergeKBs in interface ISweetKBMergeManager
Parameters:
mergeDescriptor - The merge descriptor on which the merge should be performed Note: The sources specified in the mergeDescriptor must be unique after merging and should not cause conflicts
invocationDesc - Options to be set on specific tools (for e.g. use courteous compiler while using translator provided by SWEET)
preferenceDesc - These dictate which tool is to be preferred if there are multiple tools (e.g. use IBM CommonRules XSB translator as opposed some other XSB translator)
Throws:
SweetException - if translation cannot be performed

augmentWithImportClosure

public void augmentWithImportClosure(java.util.List ruleMLStore)
                              throws SweetException
Augments the specified ruleMLStore with it's import closure

Parameters:
ruleMLStore - The ruleMLStore to be augmented
Throws:
SweetException - if an error occurs

computeImportClosure

public void computeImportClosure(ISweetKBDescriptor source,
                                 java.util.Vector importClosureKBs)
                          throws SweetException,
                                 java.lang.IllegalArgumentException
Computes the import closure for a given source

Parameters:
source - The source whose import closure should be computed
importClosureKBs - The vector having the import closure
Throws:
SweetException - if an error occurs
java.lang.IllegalArgumentException - if either the source is null or the vector for holding import results is null

getImports

public java.util.Vector getImports(ISweetKBDescriptor source)
                            throws SweetException,
                                   java.lang.IllegalArgumentException
Computes the first level imports of the specified source

Parameters:
source - The source whose first level imports should be computed
Returns:
The imports of the source (does not include source)
Throws:
SweetException - if an error occurs
java.lang.IllegalArgumentException - if the source is null

isRuleMLV08

public boolean isRuleMLV08(org.semwebcentral.sweetrules.ruleml.sweetrulemlobjectmodel.RbaseincludesType rbaseIncludesDirective)
Returns true if the kbtype is RuleML and version is 0.8

Parameters:
rbaseIncludesDirective - The rbase include directive to be processed
Returns:
true if the href has kbtype substring ruleml and version has 0.8 substring

isRuleMLV08

public boolean isRuleMLV08(ISweetKBDescriptor kbDesc)
Checks to see if the given KB is RuleML

Parameters:
kbDesc - The KB descriptor
Returns:
true if