/********************************************************************* * calls for general learning *********************************************************************/ public void learn(clsConcept subjectConcept, clsConcept typeConcept, clsConcept objectConcept) { clsRelationship relationship = subjectConcept.objectRelationship(typeConcept, objectConcept); if (relationship == null) { subjectConcept.connectObject(typeConcept, objectConcept); } }
public void connectObject(clsRelationship relationship) { if (relationship.subjectConcept == this) { if (!_objectRelationships.Contains(relationship)) { _objectRelationships.Add(relationship); } } }
// make a parent relationship between this object and a subject (subject is object) public clsRelationship connectObject(clsConcept typeConcept, clsConcept objectConcept) { clsRelationship relationship = this.objectRelationship(typeConcept, objectConcept); if (relationship == null) { relationship = new clsRelationship(this, typeConcept, objectConcept); _objectRelationships.Add(relationship); objectConcept.connectSubject(relationship); } return(relationship); }
// make a child relationship between this subject and an object (subject is object) public clsRelationship connectSubject(clsConcept typeConcept, clsConcept subjectConcept) { clsRelationship relationship = this.subjectRelationship(typeConcept, subjectConcept); if (relationship == null) { relationship = new clsRelationship(subjectConcept, typeConcept, this); _subjectRelationships.Add(relationship); subjectConcept.connectObject(relationship); } return(relationship); }