org.deri.wsmo4j.logicalexpression
Class ConstantTransformer

java.lang.Object
  extended by org.deri.wsmo4j.logicalexpression.ConstantTransformer

public class ConstantTransformer
extends Object

This singleton class is used to transform forth and back the built-in predicate names and datatypes from IRI to short notation.

The Singleton design pattern allows to ensure that only one instance of a class is created, to provide a global point of access to the object and to allow multiple instances in the future without affecting a singleton class's clients

Version:
$Revision$ $Date$
Author:
DERI Innsbruck, reto.krummenacher@deri.org
See Also:
Constants, Singleton Pattern

Method Summary
 String findIri(String notation)
           
 String findNotation(String iri)
           
static ConstantTransformer getInstance()
          Singletons maintain a static reference to the sole singleton instance and return a reference to that instance from a static instance() method.
 boolean isBuiltInAtom(String iri)
          Check if iri stands for a built-in predicate.
 boolean isBuiltInFunctionSymbol(String iri)
          There are built-in predicates (atoms) and built-in function symbols in a logical expression.
 boolean isDataType(String iriOrNotion)
           
 boolean isInfix(String iri)
          Some of the built-in predicates and function symbols like e.g.
 boolean isSimpleDataType(String iriOrNotation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ConstantTransformer getInstance()
Singletons maintain a static reference to the sole singleton instance and return a reference to that instance from a static instance() method.

Returns:
the singleton instance of the ConstantTransformer

findIri

public String findIri(String notation)
Parameters:
notation - the short notation available
Returns:
the full IRI corresponding to the short notation
See Also:
Hashtable.get(java.lang.Object)

findNotation

public String findNotation(String iri)
Parameters:
iri - the full IRI available
Returns:
the short notation of the given IRI

isInfix

public boolean isInfix(String iri)
Some of the built-in predicates and function symbols like e.g. comparisons or mathematical functions have an infix notation in WSML human-readable syntax. This method allows you to find out if the predicate corresponding to a given IRI has an infix notation.

Parameters:
iri - the IRI for which one needs to know if there is an infix notation
Returns:
a boolean that is true if there is an infix notation

isSimpleDataType

public boolean isSimpleDataType(String iriOrNotation)

isDataType

public boolean isDataType(String iriOrNotion)

isBuiltInFunctionSymbol

public boolean isBuiltInFunctionSymbol(String iri)
There are built-in predicates (atoms) and built-in function symbols in a logical expression. This method allows one to find out if a built-in construction is actually an atom or a function symbol.

Parameters:
iri - the IRI for which the information is required
Returns:
a boolean that is true if the construction is a function symbol

isBuiltInAtom

public boolean isBuiltInAtom(String iri)
Check if iri stands for a built-in predicate.

Parameters:
iri -
Returns:
true if iri is a built in predicate


Copyright © 2004-2008 Ontotext Lab.. All Rights Reserved.