code: def get_relation_cardinality_types_df(
      *,
      dataset: Dataset,
      parts: Optional[Collection[str]] = None,
      add_labels: bool = True,
  ) -> pd.DataFrame:
      r"""
      Determine the relation cardinality types.
  
      The possible types are given in relation_cardinality_types.
  
      .. note ::
          In the current implementation, we have by definition
  
          .. math ::
              1 = \sum_{type} conf(relation, type)
  
      .. note ::
         These relation types are also mentioned in [wang2014]_. However, the paper does not provide any details on
         their definition, nor is any code provided. Thus, their exact procedure is unknown and may not coincide with this
         implementation.
  
      :param dataset:
          The dataset to investigate.
      :param parts:
          Only use certain parts of the dataset, e.g., train triples. Defaults to using all triples, i.e.
          {"training", "validation", "testing}.
      :param add_labels:
          Whether to add relation labels (if available).
  
      :return:
          A dataframe with columns ( relation_id | relation_type )
      """
      # TODO: Consider merging with other analysis methods
      parts = _normalize_parts(dataset=dataset, parts=parts)
      mapped_triples = _get_mapped_triples(dataset=dataset, parts=parts)
      return triple_analysis.relation_cardinality_types(
          mapped_triples=mapped_triples,
          add_labels=add_labels,
          label_to_id=dataset.relation_to_id,
      )
  
file_path: pykeen/src/pykeen/datasets/analysis.py
imports: import logging
  from typing import Callable, Collection, Optional, Tuple, Union
  import pandas
  import torch
  from .base import Dataset
  from ..constants import PYKEEN_DATASETS
  from ..triples import analysis
  from ..typing import MappedTriples
label_desc: Use image node_id 8 for calling a global function with example usage: get_relation_cardinality_types_df() and returns: triple_analysis