<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_triple(self, sub, pred=None, obj=None, **kwargs):
 """ Adds a triple to the dataset args: sub: The subject of the triple or dictionary contaning a triple pred: Optional if supplied in sub, predicate of the triple obj: Optional if supplied in sub, object of the triple kwargs: map: Optional, a ditionary mapping for a supplied dictionary strip_orphans: Optional, remove triples that have an orphan blanknode as the object obj_method: if "list" than the object will be returned in the form of a list """

        self.__set_map__(**kwargs)
        strip_orphans = kwargs.get("strip_orphans", False)
        obj_method = kwargs.get("obj_method")
        if isinstance(sub, DictClass) or isinstance(sub, dict):
            pred = sub[self.pmap]
            obj = sub[self.omap]
            sub = sub[self.smap]

        pred = pyrdf(pred)
        obj = pyrdf(obj)
        sub = pyrdf(sub)
        # reference existing attr for bnodes and uris
        if obj.type in self.relate_obj_types :
            if strip_orphans and not self.get(obj):
                return
            obj = self.get(obj,obj)
        try:
            self[sub].add_property(pred, obj)
        except KeyError:
            self[sub] = RdfClassBase(sub, self, **kwargs)
            self[sub].add_property(pred, obj)