org.semwebcentral.sweetrules.sweetonto
Class SweetRuleMLFacts2RDFTranslator

java.lang.Object
  extended byorg.semwebcentral.sweetrules.infrastructure.AbstractSweetTranslator
      extended byorg.semwebcentral.sweetrules.sweetonto.SweetRuleMLFacts2RDFTranslator
All Implemented Interfaces:
java.lang.Cloneable, ISweetTranslator

public class SweetRuleMLFacts2RDFTranslator
extends AbstractSweetTranslator

Created on Oct 23, 2004 This translator translates the RuleML facts into RDF

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

Field Summary
 
Fields inherited from class org.semwebcentral.sweetrules.infrastructure.AbstractSweetTranslator
logger, sourceKBDescriptor, targetKBDescriptor, translatorDescriptor
 
Constructor Summary
SweetRuleMLFacts2RDFTranslator()
          Constructor for RuleML facts to rdf translator
 
Method Summary
private  void addToPredicateTable(java.lang.Object key, java.lang.String predicateName, java.util.Hashtable unaryIndividualToPredicatesTable)
           
private  java.lang.String generateRDFFromFacts(org.semwebcentral.sweetrules.ruleml.sweetrulemlobjectmodel.FactType[] groundFacts)
          Generates the RDF facts from a given input of facts
private  boolean isValidDatatype(java.lang.String datatype)
          Check to see if the specified datatype is valid
 java.lang.String translate()
          Perfroms translation from the specified source format to the target format
 
Methods inherited from class org.semwebcentral.sweetrules.infrastructure.AbstractSweetTranslator
clone, getSourceData, getTranslatorDescriptor, loadAllNamespacesAndEntities, print, setSourceData, setSourceKBDescriptor, setTargetKBDescriptor, setTranslatorDescriptor, trace, writeToTargetKB
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SweetRuleMLFacts2RDFTranslator

public SweetRuleMLFacts2RDFTranslator()
Constructor for RuleML facts to rdf translator

Method Detail

translate

public java.lang.String translate()
                           throws SweetTranslatorException
Description copied from interface: ISweetTranslator
Perfroms translation from the specified source format to the target format

Returns:
The translated string in the target format
Throws:
SweetTranslatorException

addToPredicateTable

private void addToPredicateTable(java.lang.Object key,
                                 java.lang.String predicateName,
                                 java.util.Hashtable unaryIndividualToPredicatesTable)

generateRDFFromFacts

private java.lang.String generateRDFFromFacts(org.semwebcentral.sweetrules.ruleml.sweetrulemlobjectmodel.FactType[] groundFacts)
                                       throws java.lang.IllegalStateException
Generates the RDF facts from a given input of facts

Parameters:
groundFacts - The ground facts which need to be converted into RDF
Returns:
The RDF format of the facts
Throws:
java.lang.IllegalStateException - if any ground facts are not valid

isValidDatatype

private boolean isValidDatatype(java.lang.String datatype)
Check to see if the specified datatype is valid

Parameters:
datatype - The datatype to be checked
Returns:
true if the datatype is valid, false if not