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: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
Author:
DERI Innsbruck, reto.krummenacher@deri.org
See Also:
LogicalExpressionFactory

Field Summary
static String LEFACTORY_DATA_FACTORY
           
static String LEFACTORY_WSMO_FACTORY
           
 
Method Summary
 NumberedAnonymousID createAnonymousID(byte number)
          creates a numbered anonymous ID (e.g.
 Atom createAtom(Identifier id, List<Term> params)
          creates an atom (e.g.
 CompoundMolecule createAttribusteValues(Term instanceID, Term attributeID, List attributeValues)
          Creates a compound molecule of the form: john[relative hasValue {mary,lisa}]
 AttributeConstraintMolecule createAttributeConstraint(Term instanceID, Term attributeID, Term attributeType)
          Creates a simple molecule of the form: john[age ofType _integer]
 CompoundMolecule createAttributeConstraints(Term instanceID, Term attributeID, List attributeTypes)
          Creates a compund molecule of the form: john[age ofType {human,man}]
 AttributeInferenceMolecule createAttributeInference(Term instanceID, Term attributeID, Term attributeType)
          Creates a simple molecule of the form: john[anchestor impliesType human]
 CompoundMolecule createAttributeInferences(Term instanceID, Term attributeID, List attributeType)
          Creates a compund molecule of the form: john[anchestor impliesType {human,man}]
 AttributeValueMolecule createAttributeValue(Term instanceID, Term attributeID, Term attributeValue)
          Creates a simple molecule of the form: john[age hasValue 2]
 CompoundMolecule createCompoundMolecule(List<Molecule> 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, List<Term> 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(Set<Variable> 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(String expr)
          Creates a LogicalExpression object from string.
 LogicalExpression createLogicalExpression(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
 CompoundMolecule createMemberShipMolecules(Term idInstance, List idConcepts)
          Creates a compound molecule of the form: a memberOf {b,c}.
 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
 CompoundMolecule createSubConceptMolecules(Term idConcept, List idSuperConcept)
          Creates a simple molecule of the form: a subConceptOf {b,c}
 UniversalQuantification createUniversalQuantification(Set<Variable> variables, LogicalExpression expr)
          creates a universally quantified expression (e.g.
 UniversalQuantification createUniversalQuantification(Variable variable, LogicalExpression expr)
          creates a universally quantified expression (e.g.
 Variable createVariable(String varName)
          Creates a new Variable instance
 

Field Detail

LEFACTORY_WSMO_FACTORY

static final String LEFACTORY_WSMO_FACTORY
See Also:
Constant Field Values

LEFACTORY_DATA_FACTORY

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

createLogicalExpression

LogicalExpression createLogicalExpression(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(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 IllegalArgumentException
creates a negation (e.g. "not a")

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

createNegationAsFailure

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

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

createConstraint

Constraint createConstraint(LogicalExpression expr)
                            throws IllegalArgumentException
creates a constraint

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

createConjunction

Conjunction createConjunction(LogicalExpression exprLeft,
                              LogicalExpression exprRight)
                              throws 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:
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 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:
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 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:
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 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:
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 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:
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 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

IllegalArgumentException

createUniversalQuantification

UniversalQuantification createUniversalQuantification(Set<Variable> variables,
                                                      LogicalExpression expr)
                                                      throws 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:
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 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:
IllegalArgumentException -

in case the logical expression contains a nested CONSTRAINT


createExistentialQuantification

ExistentialQuantification createExistentialQuantification(Set<Variable> variables,
                                                          LogicalExpression expr)
                                                          throws 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:
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 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:
IllegalArgumentException -

in case the logical expression contains a nested CONSTRAINT


createAtom

Atom createAtom(Identifier id,
                List<Term> params)
                throws 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:
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(List<Molecule> molecules)
                                        throws 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:
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 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:
    IllegalArgumentException - if one of the arguments is null

    createMemberShipMolecules

    CompoundMolecule createMemberShipMolecules(Term idInstance,
                                               List idConcepts)
                                               throws IllegalArgumentException
    Creates a compound molecule of the form: a memberOf {b,c}. This is just a convinience method for creating the compoung molecule using other existing methods of this factory

    Parameters:
    idInstance - A Term identifying the Molecule (left parameter)
    idConcept - A list of terms identifying the concepts that idInstance is member of
    Returns:
    A CompoundMolecule
    Throws:
    IllegalArgumentException - if one of the arguments is null, or idConcepts contains less then 2 terms or an object that is not a term

    createSubConceptMolecule

    SubConceptMolecule createSubConceptMolecule(Term idConcept,
                                                Term idSuperConcept)
                                                throws 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:
    IllegalArgumentException - if one of the arguments is null

    createSubConceptMolecules

    CompoundMolecule createSubConceptMolecules(Term idConcept,
                                               List idSuperConcept)
                                               throws IllegalArgumentException
    Creates a simple molecule of the form: a subConceptOf {b,c}

    Parameters:
    idConcept - A Term identifying the Molecule (left parameter)
    idSuperConcepts - A list of terms identifying the super concepts of IdConcept
    Returns:
    A CompoundMolecule
    Throws:
    IllegalArgumentException - if one of the arguments is null, or if idConcepts has less then 2 elements or one of them is not a Term.

    createAttributeValue

    AttributeValueMolecule createAttributeValue(Term instanceID,
                                                Term attributeID,
                                                Term attributeValue)
                                                throws 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:
    IllegalArgumentException - in case one of the terms is null

    createAttribusteValues

    CompoundMolecule createAttribusteValues(Term instanceID,
                                            Term attributeID,
                                            List attributeValues)
                                            throws IllegalArgumentException
    Creates a compound molecule of the form: john[relative hasValue {mary,lisa}]

    Parameters:
    instanceID - A Term identifying the Molecule (left parameter)
    attributeID - A Term identifying the Attribute of the Molecule
    attributeValue - A List of terms identifying the Values of the attributeID
    Returns:
    CompoundMolecule
    Throws:
    IllegalArgumentException - in case one of the parameters is null, or attributeValues contains less then 2 elements or one element in the list is not a term.

    createAttributeConstraint

    AttributeConstraintMolecule createAttributeConstraint(Term instanceID,
                                                          Term attributeID,
                                                          Term attributeType)
                                                          throws 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:
    IllegalArgumentException - in case one of the terms is null

    createAttributeConstraints

    CompoundMolecule createAttributeConstraints(Term instanceID,
                                                Term attributeID,
                                                List attributeTypes)
                                                throws IllegalArgumentException
    Creates a compund molecule of the form: john[age ofType {human,man}]

    Parameters:
    instanceID - A Term identifying the Molecule (left parameter)
    attributeID - A Term identifying the Attribute of the Molecule
    attributeTypes - A List of terms identifying the range of attributeID
    Returns:
    CompoundMolecule
    Throws:
    IllegalArgumentException - in case one of the terms is null or attributeTypes is null, contains less then 2 molecules or an object that is not a term.

    createAttributeInference

    AttributeInferenceMolecule createAttributeInference(Term instanceID,
                                                        Term attributeID,
                                                        Term attributeType)
                                                        throws 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:
    CompoundMolecule
    Throws:
    IllegalArgumentException - in case one of the terms is null

    createAttributeInferences

    CompoundMolecule createAttributeInferences(Term instanceID,
                                               Term attributeID,
                                               List attributeType)
                                               throws IllegalArgumentException
    Creates a compund molecule of the form: john[anchestor impliesType {human,man}]

    Parameters:
    instanceID - A Term identifying the Molecule (left parameter)
    attributeID - A Term identifying the Attribute of the Molecule
    attributeTypes - A List of terms identifying the range of attributeID
    Returns:
    CompoundMolecule
    Throws:
    IllegalArgumentException - in case one of the terms is null

    createConstructedTerm

    ConstructedTerm createConstructedTerm(IRI functionSymbol,
                                          List<Term> terms)
                                          throws 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:
    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

    createVariable

    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.