org.semwebcentral.sweetrules.sweetxsb
Class SweetXSBUtil

java.lang.Object
  extended byorg.semwebcentral.sweetrules.sweetxsb.SweetXSBUtil

class SweetXSBUtil
extends java.lang.Object

A utility class providing common routines to deal with XSB Since it is not expected to be used outside the package it is package private

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

Constructor Summary
(package private) SweetXSBUtil()
           
 
Method Summary
(package private) static java.lang.String getTableDeclaration(java.lang.String predicateName, int arity)
          Returns the table declaration given a predicate name and its arity
(package private) static boolean isNonGroundTerm(java.lang.String xsbTerm)
          Utility to detect if a given term is a variable (non ground term).
(package private) static java.lang.String[] splitXSBQueryToTerms(java.lang.String xsbQuery)
          Splits the XSB query to terms based on the comma separator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SweetXSBUtil

SweetXSBUtil()
Method Detail

isNonGroundTerm

static boolean isNonGroundTerm(java.lang.String xsbTerm)
Utility to detect if a given term is a variable (non ground term). This is done by seeing if it starts with a capital letter or underscore, if so it is a non-ground term

Parameters:
xsbTerm - The xsbTerm to be checked
Returns:
true if it is a non ground term false otherwise

getTableDeclaration

static java.lang.String getTableDeclaration(java.lang.String predicateName,
                                            int arity)
Returns the table declaration given a predicate name and its arity

Parameters:
predicateName - The name of the predicate
arity - Arity of the predicate
Returns:
The table declaration

splitXSBQueryToTerms

static java.lang.String[] splitXSBQueryToTerms(java.lang.String xsbQuery)
Splits the XSB query to terms based on the comma separator

Parameters:
xsbQuery - The xsb query to split
Returns:
The list of split terms