org.deri.wsmo4j.factory
Class LogicalExpressionFactoryImpl

java.lang.Object
  extended by org.deri.wsmo4j.factory.AbstractLogicalExpressionFactoryImpl
      extended by org.deri.wsmo4j.factory.LogicalExpressionFactoryImpl
All Implemented Interfaces:
org.wsmo.factory.LogicalExpressionFactory

public class LogicalExpressionFactoryImpl
extends AbstractLogicalExpressionFactoryImpl


  Created on Jun 20, 2005
  Committed by $Author: morcen $

 

Version:
$Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
Author:
reto.krummenacher@deri.org, holger.lausen@deri.org, thomas.haselwanter@deri.org
See Also:
org.omwg.logexpression.LogicalExpressionFactory

Field Summary
 
Fields inherited from interface org.wsmo.factory.LogicalExpressionFactory
LEFACTORY_DATA_FACTORY, LEFACTORY_WSMO_FACTORY
 
Constructor Summary
LogicalExpressionFactoryImpl()
          Creates a default LogicalExpressionFactory.
LogicalExpressionFactoryImpl(Map properties)
          Creates a LogicalExpressionFactory.
 
Method Summary
 org.omwg.logicalexpression.terms.NumberedAnonymousID createAnonymousID(byte number)
           
 org.omwg.logicalexpression.Atom createAtom(org.wsmo.common.Identifier id, List<org.omwg.logicalexpression.terms.Term> params)
           
 org.omwg.logicalexpression.AttributeConstraintMolecule createAttributeConstraint(org.omwg.logicalexpression.terms.Term leftTerm, org.omwg.logicalexpression.terms.Term attributeName, org.omwg.logicalexpression.terms.Term rightTerm)
           
 org.omwg.logicalexpression.AttributeInferenceMolecule createAttributeInference(org.omwg.logicalexpression.terms.Term leftTerm, org.omwg.logicalexpression.terms.Term attributeName, org.omwg.logicalexpression.terms.Term rightTerm)
           
 org.omwg.logicalexpression.AttributeValueMolecule createAttributeValue(org.omwg.logicalexpression.terms.Term leftTerm, org.omwg.logicalexpression.terms.Term attributeName, org.omwg.logicalexpression.terms.Term rightTerm)
           
 org.omwg.logicalexpression.CompoundMolecule createCompoundMolecule(List<org.omwg.logicalexpression.Molecule> molecules)
           
 org.omwg.logicalexpression.Conjunction createConjunction(org.omwg.logicalexpression.LogicalExpression exprLeft, org.omwg.logicalexpression.LogicalExpression exprRight)
           
 org.omwg.logicalexpression.Constraint createConstraint(org.omwg.logicalexpression.LogicalExpression expr)
           
 org.omwg.logicalexpression.terms.ConstructedTerm createConstructedTerm(org.wsmo.common.IRI functionSymbol, List<org.omwg.logicalexpression.terms.Term> terms)
           
 org.omwg.logicalexpression.Disjunction createDisjunction(org.omwg.logicalexpression.LogicalExpression exprLeft, org.omwg.logicalexpression.LogicalExpression exprRight)
           
 org.omwg.logicalexpression.Equivalence createEquivalence(org.omwg.logicalexpression.LogicalExpression exprLeft, org.omwg.logicalexpression.LogicalExpression exprRight)
           
 org.omwg.logicalexpression.ExistentialQuantification createExistentialQuantification(Set<org.omwg.ontology.Variable> variables, org.omwg.logicalexpression.LogicalExpression expr)
           
 org.omwg.logicalexpression.ExistentialQuantification createExistentialQuantification(org.omwg.ontology.Variable variable, org.omwg.logicalexpression.LogicalExpression expr)
           
 org.omwg.logicalexpression.Implication createImplication(org.omwg.logicalexpression.LogicalExpression exprLeft, org.omwg.logicalexpression.LogicalExpression exprRight)
           
 org.omwg.logicalexpression.InverseImplication createInverseImplication(org.omwg.logicalexpression.LogicalExpression exprLeft, org.omwg.logicalexpression.LogicalExpression exprRight)
           
 org.omwg.logicalexpression.LogicalExpression createLogicalExpression(String expr)
          Creates a logical expression object model from a string.
 org.omwg.logicalexpression.LogicalExpression createLogicalExpression(String expr, org.wsmo.common.TopEntity nsHolder)
          Creates a logical expression object model from a string.
 org.omwg.logicalexpression.LogicProgrammingRule createLogicProgrammingRule(org.omwg.logicalexpression.LogicalExpression exprLeft, org.omwg.logicalexpression.LogicalExpression exprRight)
           
 org.omwg.logicalexpression.MembershipMolecule createMemberShipMolecule(org.omwg.logicalexpression.terms.Term identifier, org.omwg.logicalexpression.terms.Term concept)
           
 org.omwg.logicalexpression.Negation createNegation(org.omwg.logicalexpression.LogicalExpression expr)
           
 org.omwg.logicalexpression.NegationAsFailure createNegationAsFailure(org.omwg.logicalexpression.LogicalExpression expr)
           
 org.omwg.logicalexpression.SubConceptMolecule createSubConceptMolecule(org.omwg.logicalexpression.terms.Term identifier, org.omwg.logicalexpression.terms.Term superConcept)
           
 org.omwg.logicalexpression.UniversalQuantification createUniversalQuantification(Set<org.omwg.ontology.Variable> variables, org.omwg.logicalexpression.LogicalExpression expr)
           
 org.omwg.logicalexpression.UniversalQuantification createUniversalQuantification(org.omwg.ontology.Variable variable, org.omwg.logicalexpression.LogicalExpression expr)
           
 org.omwg.ontology.Variable createVariable(String varName)
          Creates a new Variable instance
 
Methods inherited from class org.deri.wsmo4j.factory.AbstractLogicalExpressionFactoryImpl
createAttribusteValues, createAttributeConstraints, createAttributeInferences, createMemberShipMolecules, createSubConceptMolecules
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicalExpressionFactoryImpl

public LogicalExpressionFactoryImpl()
Creates a default LogicalExpressionFactory. The LogicalExpressionFactory used by default handles logical expressions as plain strings, instead of objects (variables, molecules, operators,...)

See Also:
Factory.createLogicalExpressionFactory(Map)

LogicalExpressionFactoryImpl

public LogicalExpressionFactoryImpl(Map properties)
Creates a LogicalExpressionFactory. The LogicalExpressionFactory used by default handles logical expressions as plain strings, instead of objects (variables, molecules, operators,...) The LogicalExpressionFactory is initialised based on the supplied preferences. The properties map can contain the factories to be used as Strings or as instances. If a factory to use is only indicated as String, the constructor needs to create an instance of this given factory.

Parameters:
map - properties used to create the LogicalExpressionFactory, if properties==null, the default LogicalExpressionFactory is used
See Also:
Factory.createLogicalExpressionFactory(Map)
Method Detail

createLogicalExpression

public org.omwg.logicalexpression.LogicalExpression createLogicalExpression(String expr)
                                                                     throws org.wsmo.wsml.ParserException
Creates a logical expression object model from a string. Note: only works if no sqname is in the logical expression if sqname is there namespace information are required

Parameters:
expr - String representation of a Logical Expression
Returns:
logical expression object model
Throws:
org.wsmo.wsml.ParserException - provides information about where and why the parse process failed

createLogicalExpression

public org.omwg.logicalexpression.LogicalExpression createLogicalExpression(String expr,
                                                                            org.wsmo.common.TopEntity nsHolder)
                                                                     throws org.wsmo.wsml.ParserException
Creates a logical expression object model from a string.

Parameters:
expr - String representation of a Logical Expression
nsHolder - TopEntity
Returns:
logical expression object model
Throws:
org.wsmo.wsml.ParserException - provides information about where and why the parse process failed

createAtom

public org.omwg.logicalexpression.Atom createAtom(org.wsmo.common.Identifier id,
                                                  List<org.omwg.logicalexpression.terms.Term> params)
                                           throws IllegalArgumentException
Parameters:
id - identifier of Atom
params - list of parameters for that atom
Returns:
an atom
Throws:
IllegalArgumentException - in case the parameter id is a Value or the arguments of the list args aren't all of Type Term
See Also:
org.omwg.logexpression.LogicalExpressionFactory#createAtom(org.omwg.logexpression.terms.Identifier, java.util.List)

createCompoundMolecule

public org.omwg.logicalexpression.CompoundMolecule createCompoundMolecule(List<org.omwg.logicalexpression.Molecule> molecules)
                                                                   throws IllegalArgumentException
Throws:
IllegalArgumentException
See Also:
LogicalExpressionFactory.createCompoundMolecule(List)

createSubConceptMolecule

public org.omwg.logicalexpression.SubConceptMolecule createSubConceptMolecule(org.omwg.logicalexpression.terms.Term identifier,
                                                                              org.omwg.logicalexpression.terms.Term superConcept)
See Also:
LogicalExpressionFactory#createSubConceptMolecule(List)

createMemberShipMolecule

public org.omwg.logicalexpression.MembershipMolecule createMemberShipMolecule(org.omwg.logicalexpression.terms.Term identifier,
                                                                              org.omwg.logicalexpression.terms.Term concept)
See Also:
LogicalExpressionFactory.createMemberShipMolecule(Term, Term)

createAttributeValue

public org.omwg.logicalexpression.AttributeValueMolecule createAttributeValue(org.omwg.logicalexpression.terms.Term leftTerm,
                                                                              org.omwg.logicalexpression.terms.Term attributeName,
                                                                              org.omwg.logicalexpression.terms.Term rightTerm)
                                                                       throws IllegalArgumentException
Throws:
IllegalArgumentException
See Also:
LogicalExpressionFactory.createAttributeValue(Term, Term, Term)

createAttributeConstraint

public org.omwg.logicalexpression.AttributeConstraintMolecule createAttributeConstraint(org.omwg.logicalexpression.terms.Term leftTerm,
                                                                                        org.omwg.logicalexpression.terms.Term attributeName,
                                                                                        org.omwg.logicalexpression.terms.Term rightTerm)
                                                                                 throws IllegalArgumentException
Throws:
IllegalArgumentException
See Also:
LogicalExpressionFactory.createAttributeConstraint(Term, Term, Term)

createAttributeInference

public org.omwg.logicalexpression.AttributeInferenceMolecule createAttributeInference(org.omwg.logicalexpression.terms.Term leftTerm,
                                                                                      org.omwg.logicalexpression.terms.Term attributeName,
                                                                                      org.omwg.logicalexpression.terms.Term rightTerm)
                                                                               throws IllegalArgumentException
Throws:
IllegalArgumentException
See Also:
LogicalExpressionFactory.createAttributeInference(Term, Term, Term)

createConstructedTerm

public org.omwg.logicalexpression.terms.ConstructedTerm createConstructedTerm(org.wsmo.common.IRI functionSymbol,
                                                                              List<org.omwg.logicalexpression.terms.Term> terms)
                                                                       throws IllegalArgumentException
Parameters:
functionSymbol - identifier of the constructed term
terms - arguments of the constructed term
Returns:
a constructed term
Throws:
IllegalArgumentException - in case the functionSymbol is null or the arguments of the list aren't all of Type Term
See Also:
org.omwg.logexpression.LogicalExpressionFactory#createConstructedTerm(IRI, List)

createAnonymousID

public org.omwg.logicalexpression.terms.NumberedAnonymousID createAnonymousID(byte number)
Parameters:
number - the number of the anonymous id
Returns:
a numbered anonymous id
See Also:
org.omwg.logexpression.LogicalExpressionFactory#createAnonymousID(byte)

createNegation

public org.omwg.logicalexpression.Negation createNegation(org.omwg.logicalexpression.LogicalExpression expr)
                                                   throws IllegalArgumentException
Parameters:
expr - the expression that is affected by the operator
Returns:
unary expression
Throws:
in - case the logical expression contains a nested CONSTRAINT
IllegalArgumentException
See Also:
org.omwg.logexpression.LogicalExpressionFactory#createNegation(LogicalExpression)

createNegationAsFailure

public org.omwg.logicalexpression.NegationAsFailure createNegationAsFailure(org.omwg.logicalexpression.LogicalExpression expr)
                                                                     throws IllegalArgumentException
Parameters:
expr - the expression that is affected by the operator
Returns:
unary expression
Throws:
in - case the logical expression contains a nested CONSTRAINT
IllegalArgumentException
See Also:
org.omwg.logexpression.LogicalExpressionFactory#createNegationAsFailure(LogicalExpression)

createConstraint

public org.omwg.logicalexpression.Constraint createConstraint(org.omwg.logicalexpression.LogicalExpression expr)
                                                       throws IllegalArgumentException
Parameters:
expr - the expression that is affected by the operator
Returns:
unary expression
Throws:
in - case the logical expression contains a nested CONSTRAINT
IllegalArgumentException
See Also:
org.omwg.logexpression.LogicalExpressionFactory#createConstraint(LogicalExpression)

createConjunction

public org.omwg.logicalexpression.Conjunction createConjunction(org.omwg.logicalexpression.LogicalExpression exprLeft,
                                                                org.omwg.logicalexpression.LogicalExpression exprRight)
                                                         throws IllegalArgumentException
Parameters:
exprLeft - the left expression that is conected by the operator
exprRight - the right expression that is conected by the operator
Returns:
binary expression
Throws:
IllegalArgumentException -

in case one of the two logical expressions is null

in case one of the two logical expressions contains a nested CONSTRAINT

See Also:
org.omwg.logexpression.LogicalExpressionFactory#createConjunction(LogicalExpression, LogicalExpression)

createDisjunction

public org.omwg.logicalexpression.Disjunction createDisjunction(org.omwg.logicalexpression.LogicalExpression exprLeft,
                                                                org.omwg.logicalexpression.LogicalExpression exprRight)
                                                         throws IllegalArgumentException
Parameters:
exprLeft - the left expression that is conected by the operator
exprRight - the right expression that is conected by the operator
Returns:
binary expression
Throws:
IllegalArgumentException -

in case one of the two logical expressions is null

in case one of the two logical expressions contains a nested CONSTRAINT

See Also:
org.omwg.logexpression.LogicalExpressionFactory#createDisjunction(LogicalExpression, LogicalExpression)

createImplication

public org.omwg.logicalexpression.Implication createImplication(org.omwg.logicalexpression.LogicalExpression exprLeft,
                                                                org.omwg.logicalexpression.LogicalExpression exprRight)
                                                         throws IllegalArgumentException
Parameters:
exprLeft - the left expression that is conected by the operator
exprRight - the right expression that is conected by the operator
Returns:
binary expression
Throws:
IllegalArgumentException -

in case one of the two logical expressions is null

in case one of the two logical expressions contains a nested CONSTRAINT

See Also:
org.omwg.logexpression.LogicalExpressionFactory#createImplication(LogicalExpression, LogicalExpression)

createEquivalence

public org.omwg.logicalexpression.Equivalence createEquivalence(org.omwg.logicalexpression.LogicalExpression exprLeft,
                                                                org.omwg.logicalexpression.LogicalExpression exprRight)
                                                         throws IllegalArgumentException
Parameters:
exprLeft - the left expression that is conected by the operator
exprRight - the right expression that is conected by the operator
Returns:
binary expression
Throws:
IllegalArgumentException -

in case one of the two logical expressions is null

in case one of the two logical expressions contains a nested CONSTRAINT

See Also:
org.omwg.logexpression.LogicalExpressionFactory#createEquivalence(LogicalExpression, LogicalExpression)

createLogicProgrammingRule

public org.omwg.logicalexpression.LogicProgrammingRule createLogicProgrammingRule(org.omwg.logicalexpression.LogicalExpression exprLeft,
                                                                                  org.omwg.logicalexpression.LogicalExpression exprRight)
                                                                           throws IllegalArgumentException
Parameters:
exprLeft - the left expression that is conected by the operator
exprRight - the right expression that is conected by the operator
Returns:
binary expression
Throws:
IllegalArgumentException -

in case one of the two logical expressions is null

in case one of the two logical expressions contains a nested CONSTRAINT

See Also:
org.omwg.logexpression.LogicalExpressionFactory#createLogicProgrammingRule(LogicalExpression, LogicalExpression)

createInverseImplication

public org.omwg.logicalexpression.InverseImplication createInverseImplication(org.omwg.logicalexpression.LogicalExpression exprLeft,
                                                                              org.omwg.logicalexpression.LogicalExpression exprRight)
                                                                       throws IllegalArgumentException
Parameters:
exprLeft - the left expression that is conected by the operator
exprRight - the right expression that is conected by the operator
Returns:
binary expression
Throws:
IllegalArgumentException -

in case one of the two logical expressions is null

in case one of the two logical expressions contains a nested CONSTRAINT

See Also:
org.omwg.logexpression.LogicalExpressionFactory#createInverseImplication(LogicalExpression, LogicalExpression)

createUniversalQuantification

public org.omwg.logicalexpression.UniversalQuantification createUniversalQuantification(Set<org.omwg.ontology.Variable> variables,
                                                                                        org.omwg.logicalexpression.LogicalExpression expr)
                                                                                 throws IllegalArgumentException
Parameters:
variables - Set of variables that are quantified (e.g. "?a")
expr - the expression that is quantified
Returns:
a universally quantified expression
Throws:
IllegalArgumentException -

in case the logical expression contains a nested CONSTRAINT

in case the Set of variables is null

in case the arguments of the list aren't all of Type Variable

See Also:
org.omwg.logexpression.LogicalExpressionFactory#createUniversalQuantification(Set, LogicalExpression)

createUniversalQuantification

public org.omwg.logicalexpression.UniversalQuantification createUniversalQuantification(org.omwg.ontology.Variable variable,
                                                                                        org.omwg.logicalexpression.LogicalExpression expr)
                                                                                 throws IllegalArgumentException
Parameters:
variable - variable that is quantified (e.g. "?a")
expr - the expression that is quantified
Returns:
a universally quantified expression
Throws:
IllegalArgumentException -

in case the logical expression contains a nested CONSTRAINT

in case the Set of variables is null

in case the arguments of the list aren't all of Type Variable

See Also:
org.omwg.logexpression.LogicalExpressionFactory#createUniversalQuantification(Variable, LogicalExpression)

createExistentialQuantification

public org.omwg.logicalexpression.ExistentialQuantification createExistentialQuantification(Set<org.omwg.ontology.Variable> variables,
                                                                                            org.omwg.logicalexpression.LogicalExpression expr)
                                                                                     throws IllegalArgumentException
Parameters:
variables - Set of variables that are quantified (e.g. "?a")
expr - the expression that is quantified
Returns:
a existentially quantified expression
Throws:
IllegalArgumentException -

in case the logical expression contains a nested CONSTRAINT

in case the Set of variables is null

in case the arguments of the list aren't all of Type Variable

See Also:
org.omwg.logexpression.LogicalExpressionFactory#createExistentialQuantification(Set, LogicalExpression)

createExistentialQuantification

public org.omwg.logicalexpression.ExistentialQuantification createExistentialQuantification(org.omwg.ontology.Variable variable,
                                                                                            org.omwg.logicalexpression.LogicalExpression expr)
                                                                                     throws IllegalArgumentException
Parameters:
variable - variable that is quantified (e.g. "?a")
expr - the expression that is quantified
Returns:
a existentially quantified expression
Throws:
IllegalArgumentException -

in case the logical expression contains a nested CONSTRAINT

in case the Set of variables is null

in case the arguments of the list aren't all of Type Variable

See Also:
org.omwg.logexpression.LogicalExpressionFactory#createExistentialQuantification(Variable, LogicalExpression)

createVariable

public org.omwg.ontology.Variable createVariable(String varName)
Creates a new Variable instance

Parameters:
varName - The name of the new variable
Returns:
A newly created variable


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