The methods that retrieve BDs and examplars are coded in BDRetriever class located under Learning/behavior. They retrieve the exemplars of a given trick and build the corresponding CompositeBehaviorDescription.
The following information about how tricks and examplars are represented in the AtomSpace would help you retrieving some or all BDs pertaining to exemplars:
1. Representation of a trick's exemplar:
InheritanceLink ConceptNode:"<trickName>" ConceptNode:"exemplar"
Note: the trickName is usually in uppercase, since it comes from PredaveseInterpreter.
2. Representation of a specific (instance of an) exemplar of a trick:
AtTimeLink TimeNode:"<exemplarStartTimeStamp:exemplarEndTimeStamp>" ConceptNode:"<trickName>"
3. Representation of the BDs that belongs to a specific exemplar of a trick:
MemberLink EvalLink (specific predicate for this BD representation) AtTimeLink TimeNode:"<exemplarStartTimeStamp:exemplarEndTimeStamp>" ConceptNode:"<trickName>"
Given that representation, one needs to make the right lookups to find whatever is wanted.
For instance, to get all exemplars, you can start by looking to the ConceptNode:"exemplar". Then, you find all the tricks (that have exemplars) by getting all ConceptNodes that inherit from it. Finally, for each trick's ConceptNode, you call AtomSpace::getTimeInfo(OurIterator, trick's ConceptNode's handle) to get the corresponding (trick's ConceptNode Handle, exemplar's interval temporal) pairs. Then use the AtomSpace::getAtTimeLink(pair) to get each AtTimeLink that represents an instance of the trick's exemplar.
-- Main.BenGoertzel - 21 Oct 2007