|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--SemanticNetwork.RelationshipInstance
Defines a relationship to be associated with a concept instance to specify spatial relations.
| Field Summary | |
private boolean |
m_is_inferred
|
private java.util.ArrayList |
m_referent_concept_nodes
|
private java.lang.String |
m_relation_name
|
private SemanticNetwork |
m_semantic_network
|
private java.lang.String |
m_source_label
|
private java.util.ArrayList |
m_target_labels
|
| Constructor Summary | |
RelationshipInstance(java.lang.String relation_name,
java.lang.String source_label,
java.util.ArrayList target_labels,
boolean is_inferred)
Creates a new instance of an relationship instance to be added to a semantic network, thereby associating it with a concept instance. |
|
RelationshipInstance(java.lang.String source_label,
java.lang.String relation_name,
java.lang.String target_label)
Creates a new instance of an relationship instance to be added to a semantic network, thereby associating it with a concept instance. |
|
| Method Summary | |
RelationshipInstance |
getClone()
Returns a mixed clone of this relationship instance. |
java.util.ArrayList |
getReferentConceptNodes()
Returns the referent concept nodes that many knowledge-base methods require to evaluate contexts based on which other concept nodes play a role in this relationship. |
java.lang.String |
getRelationName()
Returns the relation name of this relationship instance as specified in the knowledge base. |
java.lang.String |
getSourceLabel()
Returns the unique label of the concept instance that roots this relationship instance. |
java.util.ArrayList |
getTargetLabels()
Returns the labels of the concept instances to which this relationship instance is directed. |
boolean |
hasAsTargetLabel(java.lang.String target_label)
Returns whether the given label is in the set of labels of the concept instances to which this relationship instance is directed. |
boolean |
isInferred()
Returns whether this relationship instance is inferred. |
private void |
relink()
Builds or updates the referent concept nodes that many knowledge-base methods require to evaluate contexts based on which other concept nodes play a role in this relationship. |
java.lang.String |
serialize()
Returns a serialized representation of this relationship instance. |
protected void |
setSemanticNetwork(SemanticNetwork semantic_network)
Sets the semantic network this relationship instance was added to. |
java.lang.String |
toString()
Returns a string representation of this object. |
protected void |
validate()
Verifies that all concept instances this relationship instance is directed to are present in the semantic network. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.lang.String m_relation_name
private java.lang.String m_source_label
private java.util.ArrayList m_target_labels
private boolean m_is_inferred
private SemanticNetwork m_semantic_network
private java.util.ArrayList m_referent_concept_nodes
| Constructor Detail |
public RelationshipInstance(java.lang.String relation_name,
java.lang.String source_label,
java.util.ArrayList target_labels,
boolean is_inferred)
relation_name - - the relation name as specified in the knowledge basesource_label - - the label of the concept instance from which this relationship instance originatestarget_labels - - the labels of the concept instances to which this relationship is directed. Since only binary
relations are currently supported, this list must contain only one elementis_inferred - - whether this relationship instance is inferredConceptInstance,
SemanticNetwork.addRelationshipInstance(SemanticNetwork.RelationshipInstance)
public RelationshipInstance(java.lang.String source_label,
java.lang.String relation_name,
java.lang.String target_label)
source_label - - the label of the concept instance from which this relationship instance originatesrelation_name - - the relation name as specified in the knowledge basetarget_label - - the label of the concept instance to which this relationship is directedConceptInstance,
SemanticNetwork.addRelationshipInstance(SemanticNetwork.RelationshipInstance)| Method Detail |
public RelationshipInstance getClone()
public java.util.ArrayList getReferentConceptNodes()
ConceptNode.getAttributeIntervalNodes(java.lang.String, java.util.ArrayList, SemanticNetwork.ConceptInstance),
ConceptNode.getConstraintNodes(java.lang.String, java.util.ArrayList, SemanticNetwork.ConceptInstance),
ConceptNode.getFieldNodes(java.lang.String, java.util.ArrayList, SemanticNetwork.ConceptInstance),
ConceptNode.getInferenceNodes(java.lang.String, java.util.ArrayList, SemanticNetwork.ConceptInstance, boolean, Reasoner.ObjectInference, Reasoner.ObjectInference),
ConceptNode.getPropertyNodes(java.lang.String, java.util.ArrayList, SemanticNetwork.ConceptInstance),
ConceptNode.getRelationNodes(java.lang.String, java.util.ArrayList, SemanticNetwork.ConceptInstance),
ConceptNode.inheritFieldOrRelationOrPropertyOrAttributeInterval(int, java.lang.String, java.util.ArrayList, SemanticNetwork.ConceptInstance),
ConceptNode.inheritInferencesOrConstraints(int, java.lang.String, java.util.ArrayList, SemanticNetwork.ConceptInstance, boolean, Reasoner.ObjectInference, Reasoner.ObjectInference),
ConceptInstance.getAllReferentConceptNodes()public java.lang.String getRelationName()
public java.lang.String getSourceLabel()
public java.util.ArrayList getTargetLabels()
public boolean hasAsTargetLabel(java.lang.String target_label)
target_label - - the target label
public boolean isInferred()
private void relink()
getReferentConceptNodes()public java.lang.String serialize()
protected void setSemanticNetwork(SemanticNetwork semantic_network)
semantic_network - - the semantic networkpublic java.lang.String toString()
toString in class java.lang.ObjectSupport.toPrettyString(java.lang.String)
protected void validate()
throws java.lang.Exception
It also builds or updates the links from this relationship instance to the knowledge base.
java.lang.Exception - - if the relationship instance does not satisfy the requirementsSemanticNetwork.validate()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||