OpenCog

Link

From OpenCog

Links are Atom types that connect other Atoms. A Link is uniquely defined by its type and its outgoing set, i.e., the set of Atoms linked by it. If a Link with the same type and outgoing set of a previously inserted Link is inserted in the Atomspace, they are merged.

   class Link : public Atom {
       public:
       Link(Type, Arity, Handle*);
       Trail* getTrail();
       void setTrail(Trail *);
       float getWeight();
       char* toString();
       char* toShortString();
       bool isSource(Handle);
       bool isSource(int);
       bool isTarget(Handle);
       bool isTarget(int);
       bool equals(Link *);
   };

getTrail() and setTrail() are used by the reasoning module.

getWeight() return a float representation for its TruthValue.

toString() and toShortString() return string representations of the link.

_isSource() _ and isTarget() are convenience methods which answer if a given Atom (or the Atom in position 'n' of Link's outgoing set) is source/target in the relationship represented by the Link.

equals() returns true if both links have the same type and the same elements in their outgoing sets.