|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.representation.Entity
jcreek.representation.EntityType
jcreek.representation.RelationType
Title: RelationType
Description: Represents a type of relation.
Constructor Summary | |
RelationType(Entity relationTypeEntity)
This constructor does not create a new relation type in the model, but merely creates a new RelationType object to encapsulate an entity that represents a RelationType already. |
|
RelationType(KnowledgeModel km,
RelationType superclass,
java.lang.String name,
java.lang.String description,
double defaultExplanationStrength)
Creates a new relation type which is its own inverse type (i.e. it is bidirectional). |
|
RelationType(KnowledgeModel km,
RelationType superclass,
java.lang.String relationName,
java.lang.String description,
double defaultExplanationStrength,
java.lang.String inverseName,
java.lang.String inverseDesc,
double inverseDefaultExplanationStrength)
Creates a new relation type with an inverse type. |
|
RelationType(KnowledgeModel km,
RelationType superclass,
java.lang.String relationName,
java.lang.String description,
java.lang.String inverseName,
java.lang.String inverseDesc,
double defaultExplanationStrength)
Creates a new relation type with an inverse type, where the default explanation strength of both are the same. |
Method Summary | |
double |
getExplanationStrength()
Returns the default explanation strength of new relations created of this type. |
Relation[] |
getInstances()
Returns all instances of this relation type and all of its subclasses. |
java.lang.String |
getInverseName()
Returns the name of the inverse relation-type. |
RelationType |
getInverseType()
Returns the RelationType object for the inverse of this type. |
java.lang.String |
getNaturalInverseName()
Returns the natural name (a verb phrase) of the inverse relation-type. |
java.lang.String |
getNaturalName()
Returns a complete verb phrase useable for natural language generatation. |
Entity |
getValueType()
Returns the value type of this relation type. |
boolean |
hasInverseType()
Returns true if this relation type has an inverse. |
static boolean |
matches(Entity ent)
An Entity is a RelationType if and only if and only if it is an (indirect) subclass of the Relation object. |
Relation |
newInstance(Entity from,
Entity to)
Creates a new relation of the type represented by this RelationType between the two supplied relations. |
Relation |
newInstance(Entity from,
Entity to,
double explanationStrength)
Creates a new relation of the type represented by this RelationType between the two supplied relations. |
void |
remove()
Removes this relation type. |
void |
setExplanationStrength(double strength)
Sets the default explanation strength of new relations created of this relation type. |
void |
setNaturalName(java.lang.String name)
Sets the natural name of this RelationType. |
void |
setValueType(Entity type)
Sets the value type of this relation type. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RelationType(KnowledgeModel km, RelationType superclass, java.lang.String name, java.lang.String description, double defaultExplanationStrength) throws NameAlreadyExistException
km
- The KnowledgeModel this RelationType is a part of.superclass
- The superclass of the new RelationType.name
- The name of the new RelationType.description
- The description of the new RelationType.defaultExplanationStrength
- The explanation strength used for new relations of this type.public RelationType(KnowledgeModel km, RelationType superclass, java.lang.String relationName, java.lang.String description, double defaultExplanationStrength, java.lang.String inverseName, java.lang.String inverseDesc, double inverseDefaultExplanationStrength) throws NameAlreadyExistException
km
- The KnowledgeModel this RelationType is a part of.superclass
- The superclass of the new RelationType.description
- The description of the new RelationType.defaultExplanationStrength
- The explanation strength used when creating new relations of this type.inverseName
- The name of the inverse of this RelationType.inverseDesc
- The description of the inverse of this RelationType.inverseDefaultExplanationStrength
- The explanation strength used for new relations of the inverse type.public RelationType(KnowledgeModel km, RelationType superclass, java.lang.String relationName, java.lang.String description, java.lang.String inverseName, java.lang.String inverseDesc, double defaultExplanationStrength) throws NameAlreadyExistException
km
- The KnowledgeModel this RelationType is a part of.superclass
- The superclass of the new RelationType.description
- The description of the new RelationType.inverseName
- The name of the inverse of this RelationType.inverseDesc
- The description of the inverse of this RelationType.defaultExplanationStrength
- The explanation strength used for new relations of this type and the inverse type.public RelationType(Entity relationTypeEntity) throws EntityTypeNotMatchedException
Method Detail |
public RelationType getInverseType()
public boolean hasInverseType()
public java.lang.String getNaturalName()
public java.lang.String getInverseName()
public java.lang.String getNaturalInverseName()
public void setNaturalName(java.lang.String name)
name
- The natural name.public void setExplanationStrength(double strength)
strength
- A double in the range [0.0, 1.0] that is the new default explanation strength.public double getExplanationStrength()
public Entity getValueType()
public void setValueType(Entity type)
public void remove()
remove
in class Entity
public Relation[] getInstances()
public Relation newInstance(Entity from, Entity to)
from
- The origin entity of the new relation.to
- The value entity of the new relation.public Relation newInstance(Entity from, Entity to, double explanationStrength)
from
- The origin entity of the new relation.to
- The value entity of the new relation.explanationStrength
- The strength of the new relation.public static boolean matches(Entity ent)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |