org.wsmo.factory
Interface LogicalExpressionFactory


public interface LogicalExpressionFactory

This interface represents a logical expression factory it extends the generic logical expression factory by providing methods for the creation of an object model

Version:
$Revision: 1.14 $ $Date: 2005/09/21 06:28:56 $
Author:
DERI Innsbruck, reto.krummenacher@deri.org
See Also:
LogicalExpressionFactory

Field Summary
static java.lang.String LEFACTORY_DATA_FACTORY
           
static java.lang.String LEFACTORY_WSMO_FACTORY
           
 
Method Summary
 NumberedAnonymousID createAnonymousID(byte number)
          creates a numbered anonymous ID (e.g.
 Atom createAtom(Identifier id, java.util.List params)
          creates an atom (e.g.
 AttributeConstraintMolecule createAttributeConstraint(Term instanceID, Term attributeID, Term attributeType)
          Creates a simple molecule of the form: john[age ofType _integer]
 AttributeInferenceMolecule createAttributeInference(Term instanceID, Term attributeID, Term attributeType)
          Creates a simple molecule of the form: john[anchestor impliesType human]
 AttributeValueMolecule createAttributeValue(Term instanceID, Term attributeID, Term attributeValue)
          Creates a simple molecule of the form: john[age hasValue 2]
 CompoundMolecule createCompoundMolecule(java.util.List molecules)
          creates an compund molecule (e.g.
 Conjunction createConjunction(LogicalExpression exprLeft, LogicalExpression exprRight)
          Creates a conjunction (e.g.
 Constraint createConstraint(LogicalExpression expr)
          creates a constraint
 ConstructedTerm createConstructedTerm(IRI functionSymbol, java.util.List terms)
          creates a constructed term (e.g.
 Disjunction createDisjunction(LogicalExpression exprLeft, LogicalExpression exprRight)
          Creates a disjunction (e.g.
 Equivalence createEquivalence(LogicalExpression exprLeft, LogicalExpression exprRight)
          Creates a Equivalence implication (e.g.
 ExistentialQuantification createExistentialQuantification(java.util.Set variables, LogicalExpression expr)
          creates a existentialy quantified expression (e.g.
 ExistentialQuantification createExistentialQuantification(Variable variable, LogicalExpression expr)
          creates a universally quantified expression (e.g.
 Implication createImplication(LogicalExpression exprLeft, LogicalExpression exprRight)
          Creates a Implication (e.g.
 InverseImplication createInverseImplication(LogicalExpression exprLeft, LogicalExpression exprRight)
          Creates a InverseImplication (e.g.
 LogicalExpression createLogicalExpression(java.lang.String expr)
          Creates a LogicalExpression object from string.
 LogicalExpression createLogicalExpression(java.lang.String expr, TopEntity nsHolder)
          Creates a Logical Expression object from a string given a particular namespace context of a TopEntity
 LogicProgrammingRule createLogicProgrammingRule(LogicalExpression exprLeft, LogicalExpression exprRight)
          Creates a LogicProgrammingRule (e.g.
 MembershipMolecule createMemberShipMolecule(Term idInstance, Term idConcept)
          Creates a simple molecule of the form: a memberOf b
 Negation createNegation(LogicalExpression expr)
          creates a negation (e.g.
 NegationAsFailure createNegationAsFailure(LogicalExpression expr)
          creates a naf (e.g.
 SubConceptMolecule createSubConceptMolecule(Term idConcept, Term idSuperConcept)
          Creates a simple molecule of the form: a subConceptOf b
 UniversalQuantification createUniversalQuantification(java.util.Set variables, LogicalExpression expr)
          creates a universally quantified expression (e.g.
 UniversalQuantification createUniversalQuantification(Variable variable, LogicalExpression expr)
          creates a universally quantified expression (e.g.
 

Field Detail

LEFACTORY_WSMO_FACTORY

static final java.lang.String LEFACTORY_WSMO_FACTORY
See Also:
Constant Field Values

LEFACTORY_DATA_FACTORY

static final java.lang.String LEFACTORY_DATA_FACTORY
See Also:
Constant Field Values
Method Detail

createLogicalExpression

LogicalExpression createLogicalExpression(java.lang.String expr)
                                          throws ParserException
Creates a LogicalExpression object from string.

Parameters:
expr - the string representation of the logical expression
Returns:
The newly created LogicalExpression object.
Throws:
ParserException

createLogicalExpression

LogicalExpression createLogicalExpression(java.lang.String expr,
                                          TopEntity nsHolder)
                                          throws ParserException
Creates a Logical Expression object from a string given a particular namespace context of a TopEntity

Parameters:
expr - the string representation of the logical expression
nsHolder - some Top entity that contains the namespace context (e.g.default Namespace)
Returns:
The newly created LogicalExpression object.
Throws:
ParserException

createNegation

Negation createNegation(LogicalExpression expr)
                        throws java.lang.IllegalArgumentException
creates a negation (e.g. "not a")

Parameters:
expr - the expression that is affected by the operator
Returns:
negation
Throws:
java.lang.IllegalArgumentException - in case the logical expression contains a nested CONSTRAINT

createNegationAsFailure

NegationAsFailure createNegationAsFailure(LogicalExpression expr)
                                          throws java.lang.IllegalArgumentException
creates a naf (e.g. "naf a")

Parameters:
expr - the expression that is affected by the operator
Returns:
naf
Throws:
java.lang.IllegalArgumentException - in case the logical expression contains a nested CONSTRAINT

createConstraint

Constraint createConstraint(LogicalExpression expr)
                            throws java.lang.IllegalArgumentException
creates a constraint

Parameters:
expr - the expression that is affected by the operator
Returns:
constraint
Throws:
java.lang.IllegalArgumentException - in case the logical expression contains a nested CONSTRAINT

createConjunction

Conjunction createConjunction(LogicalExpression exprLeft,
                              LogicalExpression exprRight)
                              throws java.lang.IllegalArgumentException
Creates a conjunction (e.g. "a and b")

Parameters:
exprLeft - the left expression that is conjunctively connected
exprRight - the right expression that is conjunctively connected
Returns:
conjunction
Throws:
java.lang.IllegalArgumentException -

in case one of the two logical expressions is null

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


createDisjunction

Disjunction createDisjunction(LogicalExpression exprLeft,
                              LogicalExpression exprRight)
                              throws java.lang.IllegalArgumentException
Creates a disjunction (e.g. "a or b").

Parameters:
exprLeft - the left expression that is connected
exprRight - the right expression that is connected
Returns:
conjunction
Throws:
java.lang.IllegalArgumentException -

in case one of the two logical expressions is null

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


createImplication

Implication createImplication(LogicalExpression exprLeft,
                              LogicalExpression exprRight)
                              throws java.lang.IllegalArgumentException
Creates a Implication (e.g. "a implies b").

Parameters:
exprLeft - the left expression that is connected
exprRight - the right expression that is connected
Returns:
Implication
Throws:
java.lang.IllegalArgumentException -

in case one of the two logical expressions is null

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


createEquivalence

Equivalence createEquivalence(LogicalExpression exprLeft,
                              LogicalExpression exprRight)
                              throws java.lang.IllegalArgumentException
Creates a Equivalence implication (e.g. "a equivalent b").

Parameters:
exprLeft - the left expression that is connected
exprRight - the right expression that is connected
Returns:
Implication
Throws:
java.lang.IllegalArgumentException -

in case one of the two logical expressions is null

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


createLogicProgrammingRule

LogicProgrammingRule createLogicProgrammingRule(LogicalExpression exprLeft,
                                                LogicalExpression exprRight)
                                                throws java.lang.IllegalArgumentException
Creates a LogicProgrammingRule (e.g. "a :- b").

Parameters:
exprLeft - the left expression that is connected
exprRight - the right expression that is connected
Returns:
LogicProgrammingRule
Throws:
java.lang.IllegalArgumentException -

in case one of the two logical expressions is null

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


createInverseImplication

InverseImplication createInverseImplication(LogicalExpression exprLeft,
                                            LogicalExpression exprRight)
                                            throws java.lang.IllegalArgumentException
Creates a InverseImplication (e.g. "a impliedBy b").

Parameters:
exprLeft - the left expression that is connected
exprRight - the right expression that is connected
Returns:
LogicProgrammingRule
Throws:
InverseImplication -

in case one of the two logical expressions is null

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

java.lang.IllegalArgumentException

createUniversalQuantification

UniversalQuantification createUniversalQuantification(java.util.Set variables,
                                                      LogicalExpression expr)
                                                      throws java.lang.IllegalArgumentException
creates a universally quantified expression (e.g. "forall {?a,?b} (?a memberOf ?b)")

Parameters:
variables - Set of variables that are quantified (e.g. [?a, ?b])
expr - the expression that is quantified
Returns:
a quantified expression
Throws:
java.lang.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


createUniversalQuantification

UniversalQuantification createUniversalQuantification(Variable variable,
                                                      LogicalExpression expr)
                                                      throws java.lang.IllegalArgumentException
creates a universally quantified expression (e.g. "forall ?a (?a memberOf A)")

Parameters:
variables - that is quantified (e.g. "?a")
expr - the expression that is quantified
Returns:
a quantified expression
Throws:
java.lang.IllegalArgumentException -

in case the logical expression contains a nested CONSTRAINT


createExistentialQuantification

ExistentialQuantification createExistentialQuantification(java.util.Set variables,
                                                          LogicalExpression expr)
                                                          throws java.lang.IllegalArgumentException
creates a existentialy quantified expression (e.g. "exists {?a,?b} (?a memberOf ?b)")

Parameters:
variables - that is quantified (e.g. [?a,?b])
expr - the expression that is quantified
Returns:
a quantified expression
Throws:
java.lang.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


createExistentialQuantification

ExistentialQuantification createExistentialQuantification(Variable variable,
                                                          LogicalExpression expr)
                                                          throws java.lang.IllegalArgumentException
creates a universally quantified expression (e.g. "forall ?a (?a memberOf A)")

Parameters:
variable - that is quantified (e.g. "?a")
expr - the expression that is quantified
Returns:
a quantified expression
Throws:
java.lang.IllegalArgumentException -

in case the logical expression contains a nested CONSTRAINT


createAtom

Atom createAtom(Identifier id,
                java.util.List params)
                throws java.lang.IllegalArgumentException
creates an atom (e.g. distance(a,2,3))

Parameters:
id - identifier of Atom
params - list of parameters for that atom
Returns:
an atom
Throws:
java.lang.IllegalArgumentException - in case the parameter id is a Value or the arguments of the list args aren't all of Type Term

createCompoundMolecule

CompoundMolecule createCompoundMolecule(java.util.List molecules)
                                        throws java.lang.IllegalArgumentException
creates an compund molecule (e.g. a[b hasValue c]memberOf d).

Parameters:
molecules - a list of molecules that shall be grouped
Returns:
A CompoundMolecule
Throws:
java.lang.IllegalArgumentException - in case:
  • the list does not only contain molecules or contains has less then 2 molecules
  • not all contained molecules have the same identifier
  • both MemberShip and SubConcept molecules are contained

  • createMemberShipMolecule

    MembershipMolecule createMemberShipMolecule(Term idInstance,
                                                Term idConcept)
                                                throws java.lang.IllegalArgumentException
    Creates a simple molecule of the form: a memberOf b

    Parameters:
    idInstance - A Term identifying the Molecule (left parameter)
    idConcept - A Term identifying the Concept the idInstance is member of
    Returns:
    A MemberShipMolecule
    Throws:
    java.lang.IllegalArgumentException - if one of the arguments is null

    createSubConceptMolecule

    SubConceptMolecule createSubConceptMolecule(Term idConcept,
                                                Term idSuperConcept)
                                                throws java.lang.IllegalArgumentException
    Creates a simple molecule of the form: a subConceptOf b

    Parameters:
    idConcept - A Term identifying the Molecule (left parameter)
    idSuperConcept - A Term identifying the super concept of IdConcept
    Returns:
    A MemberShipMolecule
    Throws:
    java.lang.IllegalArgumentException - if one of the arguments is null

    createAttributeValue

    AttributeValueMolecule createAttributeValue(Term instanceID,
                                                Term attributeID,
                                                Term attributeValue)
                                                throws java.lang.IllegalArgumentException
    Creates a simple molecule of the form: john[age hasValue 2]

    Parameters:
    instanceID - A Term identifying the Molecule (left parameter)
    attributeID - A Term identifying the Attribute of the Molecule
    attributeValue - A Term identifying the Value of the attributeID
    Returns:
    AttributeValueMolecule
    Throws:
    java.lang.IllegalArgumentException - in case one of the terms is null

    createAttributeConstraint

    AttributeConstraintMolecule createAttributeConstraint(Term instanceID,
                                                          Term attributeID,
                                                          Term attributeType)
                                                          throws java.lang.IllegalArgumentException
    Creates a simple molecule of the form: john[age ofType _integer]

    Parameters:
    instanceID - A Term identifying the Molecule (left parameter)
    attributeID - A Term identifying the Attribute of the Molecule
    attributeType - A Term identifying the range of attributeID
    Returns:
    AttributeConstraintMolecule
    Throws:
    java.lang.IllegalArgumentException - in case one of the terms is null

    createAttributeInference

    AttributeInferenceMolecule createAttributeInference(Term instanceID,
                                                        Term attributeID,
                                                        Term attributeType)
                                                        throws java.lang.IllegalArgumentException
    Creates a simple molecule of the form: john[anchestor impliesType human]

    Parameters:
    instanceID - A Term identifying the Molecule (left parameter)
    attributeID - A Term identifying the Attribute of the Molecule
    attributeType - A Term identifying the range of attributeID
    Returns:
    AttributeConstraintMolecule
    Throws:
    java.lang.IllegalArgumentException - in case one of the terms is null

    createConstructedTerm

    ConstructedTerm createConstructedTerm(IRI functionSymbol,
                                          java.util.List terms)
                                          throws java.lang.IllegalArgumentException
    creates a constructed term (e.g. "_date(2005,2,2)")

    Parameters:
    functionSymbol - identifier of the constructed term
    terms - arguments of the constructed term
    Returns:
    a constructed term
    Throws:
    java.lang.IllegalArgumentException - in case the functionSymbol is null or the arguments of the list aren't all of Type Term

    createAnonymousID

    NumberedAnonymousID createAnonymousID(byte number)
    creates a numbered anonymous ID (e.g. "_#2")

    Parameters:
    number - the number of the anonymous ID
    Returns:
    a numbered anonymous id