public class KnowledgeBase
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.util.HashSet<java.lang.String> |
abstractRoles
Abstract roles.
|
java.util.Hashtable<java.lang.String,Concept> |
atomicConcepts
Fuzzy concepts.
|
java.util.Hashtable<java.lang.String,FuzzyConcreteConcept> |
concreteConcepts
Fuzzy concepts.
|
java.util.Hashtable<java.lang.String,ConcreteFeature> |
concreteFeatures
Concrete features.
|
boolean |
concreteFuzzyConcepts
Concrete fuzzy concepts.
|
java.util.HashSet<java.lang.String> |
concreteRoles
Concrete roles.
|
java.util.ArrayList<Assertion> |
existAssertions
Exists assertions.
|
java.util.HashSet<java.lang.String> |
funcRoles
Functional roles.
|
java.util.Hashtable<java.lang.String,TriangularFuzzyNumber> |
fuzzyNumbers
Fuzzy numbers.
|
MILPHelper |
milp
MILP problem manager.
|
java.util.Hashtable<java.lang.String,Modifier> |
modifiers
Fuzzy modifiers.
|
static FuzzyLogic |
semantics
Fuzzy logic.
|
boolean |
showLanguage
Show the logic language to the user or not.
|
java.util.HashSet<java.lang.String> |
similarityRels
Similarity relations.
|
| Constructor and Description |
|---|
KnowledgeBase()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAssertion(Individual a,
Concept c,
Degree n)
Adds a fuzzy assertion of the form (a : C >= n )
|
void |
addAssertion(Individual a,
Restriction restric)
Adds a fuzzy assertion of the form (a : forall R.C >= n )
|
void |
addAtomicConceptsDisjoint(java.util.ArrayList<java.lang.String> disjointConcepts)
Adds some disjoint concept axioms.
|
void |
addConcept(java.lang.String conceptName,
FuzzyConcreteConcept conc)
Adds a fuzzy concept to the array of concepts in the fuzzy KB.
|
void |
addConceptsDisjoint(java.util.ArrayList<Concept> disjointConcepts)
Adds some disjoint concept axioms.
|
void |
addConceptsDisjoint(Concept c,
Concept d) |
Concept |
addDatatypeRestriction(int restrictionType,
java.lang.Object o,
java.lang.String fName)
Adds a datatype restriction of the form (restrictionType, fName, o).
|
void |
addDisjointUnionConcept(java.util.ArrayList<java.lang.String> disjointUnionConcepts)
Adds a disjoint union concept axiom.
|
void |
addEquivalenceRelation(java.lang.String role)
Adds a fuzzy equivalence relation.
|
void |
addEquivalentConcepts(java.util.ArrayList<Concept> equivConcepts)
Adds some equivalent concept axioms.
|
void |
addEquivalentRoles(java.util.ArrayList<java.lang.String> equivRoles)
Adds some equivalent funcRole axioms.
|
void |
addFuzzyNumber(java.lang.String fName,
TriangularFuzzyNumber f)
Adds a fuzzy number to the fuzzy KB.
|
void |
addIndividualToConcept(int conceptID,
Individual a)
Add the individual a to the individual list of the concept.
|
void |
addInverseRoles(java.lang.String role,
java.lang.String invRole)
Adds an inverse funcRole axiom.
|
void |
addModifier(java.lang.String modName,
Modifier mod)
Adds a fuzzy modifier to the fuzzy KB.
|
Relation |
addRelation(Individual indA,
java.lang.String role,
Individual indB,
Degree degree)
Adds a fuzzy relation of the form (indA, indB, funcRole, degree)
|
void |
addSimilarityRelation(java.lang.String role)
Adds a fuzzy similarity relation.
|
boolean |
checkFuzzyNumberConceptExists(java.lang.String concName)
Checks if there exists a fuzzy number with the indicated name.
|
void |
checkRole(java.lang.String roleName,
Concept conc)
Checks the disjointness between abstract and concrete roles.
|
KnowledgeBase |
clone()
Gets a copy of a knowledge base.
|
KnowledgeBase |
cloneWithoutABox()
Gets a copy of a knowledge base except the ABox.
|
void |
defineAtomicConcept(java.lang.String conceptName,
Concept conc,
int implication,
double n)
Adds an atomic fuzzy concept definition.
|
void |
defineBooleanConcreteFeature(java.lang.String funcRole)
Define a concrete feature with range boolean.
|
void |
defineConcept(java.lang.String conceptName,
Concept conc)
Adds a fuzzy concept definition.
|
void |
defineEquivalentConcepts(Concept c1,
Concept c2)
Adds a concept equivalence axiom.
|
void |
defineIntegerConcreteFeature(java.lang.String funcRole,
java.lang.Integer d1,
java.lang.Integer d2)
Define a concrete feature with range integers in [d1, d2].
|
void |
defineRealConcreteFeature(java.lang.String funcRole,
java.lang.Double d1,
java.lang.Double d2)
Define a concrete feature with range real numbers in [d1, d2].
|
void |
defineStringConcreteFeature(java.lang.String funcRole)
Define a concrete feature with range string.
|
Concept |
getConcept(java.lang.String name)
Gets a concept with indicated name.
|
Individual |
getIndividual(java.lang.String indName)
Gets an individual with the indicated name (creating it if necessary).
|
java.util.Hashtable<java.lang.String,Individual> |
getIndividuals()
Get the individuals.
|
java.lang.String |
getLanguage()
Gets the language of the fuzzy KB, from ALC to SHIF(D).
|
FuzzyLogic |
getLogic()
Gets the fuzzy logic of the fuzzy knowledge base.
|
double |
getVersion()
Gets the version of the fuzzyDL reasoner.
|
void |
gImplies(Concept conc1,
Concept conc2,
Degree degree)
Adds a Goedel General Concept Inclusion.
|
void |
implies(Concept conc1,
Concept conc2,
Degree degree)
Adds a General Concept Inclusion (conc1, conc2, degree)
|
void |
kdImplies(Concept conc1,
Concept conc2,
Degree degree)
Adds a Kleene-Dienes General Concept Inclusion.
|
void |
lImplies(Concept conc1,
Concept conc2,
Degree degree)
Adds a Lukasiewicz General Concept Inclusion.
|
void |
roleDomain(java.lang.String role,
Concept conc)
Adds a domain funcRole axiom.
|
void |
roleImplies(java.lang.String subsumed,
java.lang.String subsumer)
Adds a RIA (subsumed, subsumer, 1).
|
void |
roleImplies(java.lang.String subsumed,
java.lang.String subsumer,
java.lang.Double n)
Adds a RIA (subsumed, subsumer, degree).
|
void |
roleIsFunctional(java.lang.String role)
Adds a functional funcRole axiom.
|
void |
roleIsInverseFunctional(java.lang.String role)
Adds an inverse functional funcRole axiom.
|
void |
roleIsReflexive(java.lang.String role)
Adds a reflexive funcRole axiom.
|
void |
roleIsSymmetric(java.lang.String role)
Adds a symmetric funcRole axiom.
|
void |
roleIsTransitive(java.lang.String role)
Adds a transitive funcRole axiom.
|
void |
roleRange(java.lang.String role,
Concept conc)
Adds a funcRole range axiom.
|
void |
saveToFile(java.lang.String fileName)
Saves a fuzzy KB into a text file.
|
void |
setCrispConcept(Concept c)
Defines a concept to be crisp.
|
void |
setCrispRole(java.lang.String roleName)
Defines a role to be crisp.
|
void |
setLogic(FuzzyLogic logic)
Sets the fuzzy logic of the fuzzy knowledge base.
|
void |
solveAssertions()
Solves all the fuzzy assertions.
|
void |
solveKB()
Prepares the fuzzy knowledge base to reason with it.
|
void |
zImplies(Concept conc1,
Concept conc2)
Adds a Zadeh General Concept Inclusion.
|
public java.util.HashSet<java.lang.String> abstractRoles
public java.util.Hashtable<java.lang.String,Concept> atomicConcepts
public java.util.Hashtable<java.lang.String,FuzzyConcreteConcept> concreteConcepts
public java.util.Hashtable<java.lang.String,ConcreteFeature> concreteFeatures
public boolean concreteFuzzyConcepts
public java.util.HashSet<java.lang.String> concreteRoles
public java.util.ArrayList<Assertion> existAssertions
public java.util.HashSet<java.lang.String> funcRoles
public java.util.Hashtable<java.lang.String,TriangularFuzzyNumber> fuzzyNumbers
public MILPHelper milp
public java.util.Hashtable<java.lang.String,Modifier> modifiers
public static FuzzyLogic semantics
public boolean showLanguage
public java.util.HashSet<java.lang.String> similarityRels
public KnowledgeBase clone()
clone in class java.lang.Objectpublic KnowledgeBase cloneWithoutABox()
public void saveToFile(java.lang.String fileName)
throws FuzzyOntologyException
fileName - Name of the output fie.FuzzyOntologyException - fuzzy ontology exception.public Individual getIndividual(java.lang.String indName) throws InconsistentOntologyException
indName - Name of the individual.InconsistentOntologyException - Inconsistent ontology.public void addConcept(java.lang.String conceptName,
FuzzyConcreteConcept conc)
conceptName - Name of the concept.conc - Fuzzy concept.public Concept getConcept(java.lang.String name)
name - Name of the concept.public void addFuzzyNumber(java.lang.String fName,
TriangularFuzzyNumber f)
fName - Name of the fuzzy number.f - Fuzzy number.public boolean checkFuzzyNumberConceptExists(java.lang.String concName)
concName - Name of the fuzzy number.public void addModifier(java.lang.String modName,
Modifier mod)
throws FuzzyOntologyException
modName - Name of the fuzzy modifier.mod - Modifier.FuzzyOntologyException - fuzzy ontology exception.public void addIndividualToConcept(int conceptID,
Individual a)
conceptID - Concept numerical ID.a - Individualpublic Relation addRelation(Individual indA, java.lang.String role, Individual indB, Degree degree) throws InconsistentOntologyException
indA - A subbject individual.role - An abstract role.indB - An object individual.degree - Lower bound for the degree.InconsistentOntologyException - Inconsistent ontology.public void defineConcept(java.lang.String conceptName,
Concept conc)
conceptName - Name of an atomic fuzzy concept (defined).conc - A fuzzy concept (definition).public void defineAtomicConcept(java.lang.String conceptName,
Concept conc,
int implication,
double n)
conceptName - Name of an atomic fuzzy concept (defined).conc - A fuzzy concept (definition).implication - A fuzzy implication.n - Degree of truth.public void addAtomicConceptsDisjoint(java.util.ArrayList<java.lang.String> disjointConcepts)
disjointConcepts - A vector of concept names.public void addConceptsDisjoint(java.util.ArrayList<Concept> disjointConcepts) throws InconsistentOntologyException
disjointConcepts - A vector of concepts.InconsistentOntologyException - Inconsistent ontology.public void addConceptsDisjoint(Concept c, Concept d) throws InconsistentOntologyException
InconsistentOntologyExceptionpublic void addEquivalentRoles(java.util.ArrayList<java.lang.String> equivRoles)
equivRoles - An array list of equivalent fuzzy funcRole names.public void addEquivalentConcepts(java.util.ArrayList<Concept> equivConcepts) throws InconsistentOntologyException
equivConcepts - An array list of vector of equivalent fuzzy concepts.InconsistentOntologyException - Inconsistent ontology.public void defineEquivalentConcepts(Concept c1, Concept c2) throws InconsistentOntologyException
c1 - A concept.c2 - Another concept.InconsistentOntologyException - Inconsistent ontology.public void addDisjointUnionConcept(java.util.ArrayList<java.lang.String> disjointUnionConcepts)
disjointUnionConcepts - A vector of concepts names.public void roleIsFunctional(java.lang.String role)
role - A role.public void roleIsInverseFunctional(java.lang.String role)
role - A role.public void roleIsTransitive(java.lang.String role)
role - A role.public void roleIsReflexive(java.lang.String role)
role - A role.public void roleIsSymmetric(java.lang.String role)
role - A role.public void addSimilarityRelation(java.lang.String role)
role - A role.public void addEquivalenceRelation(java.lang.String role)
role - A role.public void addInverseRoles(java.lang.String role,
java.lang.String invRole)
role - A role.invRole - An inverse funcRole of funcRole.public void roleImplies(java.lang.String subsumed,
java.lang.String subsumer)
subsumed - Subsumed funcRole.subsumer - Subsumed funcRole.public void roleImplies(java.lang.String subsumed,
java.lang.String subsumer,
java.lang.Double n)
subsumed - Subsumed funcRole.subsumer - Subsumed funcRole.n - Lower bound for the degree.public void roleRange(java.lang.String role,
Concept conc)
role - A role.conc - of the funcRole.public void roleDomain(java.lang.String role,
Concept conc)
role - A role.conc - Domain of the funcRole.public void gImplies(Concept conc1, Concept conc2, Degree degree) throws InconsistentOntologyException
conc1 - Subsumed concept.conc2 - Subsumer concept.degree - Lower bound for the degree.InconsistentOntologyException - Inconsistent ontology.public void lImplies(Concept conc1, Concept conc2, Degree degree) throws InconsistentOntologyException
conc1 - Subsumed concept.conc2 - Subsumer concept.degree - Lower bound for the degree.InconsistentOntologyException - Inconsistent ontology.public void kdImplies(Concept conc1, Concept conc2, Degree degree) throws InconsistentOntologyException
conc1 - Subsumed concept.conc2 - Subsumer concept.degree - Lower bound for the degree.InconsistentOntologyException - Inconsistent ontology.public void zImplies(Concept conc1, Concept conc2) throws InconsistentOntologyException
conc1 - Subsumed concept.conc2 - Subsumer concept.InconsistentOntologyException - Inconsistent ontology.public void implies(Concept conc1, Concept conc2, Degree degree) throws InconsistentOntologyException
conc1 - Subsumed concept.conc2 - Subsumer concept.degree - Lower bound for the degree.InconsistentOntologyException - Inconsistent ontology.public Concept addDatatypeRestriction(int restrictionType, java.lang.Object o, java.lang.String fName) throws FuzzyOntologyException
restrictionType - Type of the datatype restriction.o - Value of the datatype restriction.fName - Concrete feature.FuzzyOntologyException - fuzzy ontology exception.public java.lang.String getLanguage()
public void solveKB()
throws FuzzyOntologyException,
InconsistentOntologyException
FuzzyOntologyException - fuzzy ontology exception.InconsistentOntologyException - Inconsistent ontology.public void solveAssertions()
throws FuzzyOntologyException,
InconsistentOntologyException
FuzzyOntologyException - fuzzy ontology exception.InconsistentOntologyException - Inconsistent ontology.public void addAssertion(Individual a, Concept c, Degree n)
a - An individualc - A fuzzy conceptn - A degree of truth.public void addAssertion(Individual a, Restriction restric)
a - An individualrestric - A restriction of the form (forall R.C >= n)public void checkRole(java.lang.String roleName,
Concept conc)
throws FuzzyOntologyException
roleName - A role name.conc - A concept appearing in a restrictions involving the role.FuzzyOntologyException - fuzzy ontology exception.public void defineBooleanConcreteFeature(java.lang.String funcRole)
throws FuzzyOntologyException
funcRole - Name of the concrete feature.FuzzyOntologyException - fuzzy ontology exception.public void defineStringConcreteFeature(java.lang.String funcRole)
throws FuzzyOntologyException
funcRole - Name of the concrete feature.FuzzyOntologyException - fuzzy ontology exception.public void defineIntegerConcreteFeature(java.lang.String funcRole,
java.lang.Integer d1,
java.lang.Integer d2)
throws FuzzyOntologyException
funcRole - Name of the concrete feature.d1 - Lower bound of the range.d2 - Upper bound of the range.FuzzyOntologyException - fuzzy ontology exception.public void defineRealConcreteFeature(java.lang.String funcRole,
java.lang.Double d1,
java.lang.Double d2)
throws FuzzyOntologyException
funcRole - Name of the concrete feature.d1 - Lower bound of the range.d2 - Upper bound of the range.FuzzyOntologyException - fuzzy ontology exception.public void setLogic(FuzzyLogic logic)
logic - Fuzzy logic of the fuzzy knowledge base.public FuzzyLogic getLogic()
public void setCrispConcept(Concept c)
c - A concept.public void setCrispRole(java.lang.String roleName)
roleName - A role.public double getVersion()
public java.util.Hashtable<java.lang.String,Individual> getIndividuals()