pydrepr/drepr/models/sm.py
def class2dict(self, class_id: str) -> Dict[str, Union[List[int], int]]:
        """
        Get a dictionary that contains information (predicates) about a given class
        """
        info = {}
        for eid, e in self.edges.items():
            if e.source_id != class_id:
                continue

            if e.label in info:
                if not isinstance(info[e.label], list):
                    info[e.label] = [info[e.label], eid]
                else:
                    info[e.label].append(eid)
            else:
                info[e.label] = eid
        return info

        Get a dictionary that contains information (predicates) about a given class
        
Get a dictionary that contains information (predicates) about a given class
Get a dictionary that contains information ( predicates ) about a given class
def class2dict(self, class_id: str) -> Dict[str, Union[List[int], int]]:
        info = {}
        for eid, e in self.edges.items():
            if e.source_id != class_id:
                continue
            if e.label in info:
                if not isinstance(info[e.label], list):
                    info[e.label] = [info[e.label], eid]
                else:
                    info[e.label].append(eid)
            else:
                info[e.label] = eid
        return info
def class2dict ( self , class_id : str ) -> Dict [ str , Union [ List [ int ] , int ] ] : info = { } for eid , e in self . edges . items ( ) : if e . source_id != class_id : continue if e . label in info : if not isinstance ( info [ e . label ] , list ) : info [ e . label ] = [ info [ e . label ] , eid ] else : info [ e . label ] . append ( eid ) else : info [ e . label ] = eid return info
Get a dictionary that contains information (predicates) about a given class
Get a dictionary that contains information ( predicates ) about a given class
"""
        Get a dictionary that contains information (predicates) about a given class
        """
self
class_id
str